2013-11-04 54 views
0

嗨,所有我嘗試播放和錄製mp3 souphttpsrc在同一時間,但我沒有一個好結果有人可以幫助嗎?使用gstreamer播放和記錄流在同一時間

gst-launch-1.0 -e filesrc location=/dev/fd/0 ! h264parse ! tee name=myvid \! queue ! decodebin ! xvimagesink sync=false \ myvid. ! queue ! mux.video_0 \ alsasrc device="plughw:2,0" ! "audio/x-raw,rate=44100,channels=1,depth=24" ! audioconvert ! queue ! filesink location=/tmp/out.mp4 

謝謝

回答

1

嗨您的管道是稍有不妥。

  1. 音頻沒有發生編碼,因此您將原始音頻保存到容器中。
  2. 沒有muxer和mux.video_0因此不解析任何元素上的任何墊。

這裏是沒有這些問題的管道:

gst-launch-1.0 -e mp4mux name=mux ! filesink location=/tmp/out.mp4 filesrc location=/dev/fd/0 ! h264parse ! tee name=myvid ! queue ! decodebin ! xvimagesink sync=false myvid. ! queue ! mux.video_0 \ alsasrc device="plughw:2,0" ! "audio/x-raw,rate=44100,channels=1,depth=24" ! audioconvert ! queue ! lame ! mux.audio_0