2013-11-04 52 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