好吧,我想出了這一點,但有時ALSA說,該流不處於正常狀態..
GST_DEBUG=3 gst-launch-1.0 concat name=c2 ! videoconvert ! videorate ! autovideosink concat name=c ! audioconvert ! audiorate ! alsasink filesrc location=big.mp4 ! decodebin name=d1 ! audio/x-raw ! queue ! c. filesrc location=big2.mp4 ! decodebin name=d2 ! audio/x-raw ! queue ! c. d1. ! video/x-raw ! queue ! c2. d2. ! video/x-raw ! queue ! c2.
一點信息給管:
1,你不必使用audioconvert/videoconvert識別來自decodebin的流的類型 - 您可以分別安全地分別使用audio/x-raw
或video/x-raw
..解碼後,音頻/視頻始終爲原始格式。
2,使用2個連續元素作爲一個只能處理一個流......但如果你使用兩個連接你可能會擔心音頻/視頻不同步..我希望它是同步的,因爲他們都住在同一個管道有一個時鐘提供商的一切理論上它應該沒問題..當你需要適當的同步時,將所有東西放在一個管道中總是很重要的。
3,我用alsasink但你可以使用任何片適合你..有時autoaudiosink挑pulsesink對我來說,我不很喜歡。我喜歡用這種管道的聲音結束:audioconvert ! audiorate ! alsasink
4,我已經看到了這些錯誤,但加入隊列後就走了..但他們可能會出現你我不知道..
0:00:00.053972316 11839 0x7f0274003b70 WARN audiobasesink gstaudiobasesink.c:1139:gst_audio_base_sink_wait_event:<alsasink0> error: Sink not negotiated before eos event.
ERROR: from element /GstPipeline:pipeline0/GstAlsaSink:alsasink0: The stream is in the wrong format.
Additional debug info:
gstaudiobasesink.c(1139): gst_audio_base_sink_wait_event(): /GstPipeline:pipeline0/GstAlsaSink:alsasink0:
Sink not negotiated before eos event.
ERROR: pipeline doesn't want to preroll.
什麼你的意思做「至今沒有運氣」?這條管道適用於我,我可以連續播放兩個mp4視頻:'gst-launch-1.0 concat name = c! videoconvert! videoscale! autovideosink filesrc location = video1.mp4!解碼器! C。 filesrc location = video2.mp4!解碼器! c.' –
@EzequielGarcia是的它的工作原理..但他需要在相同的管道音頻:) – nayana