我正在尝试学习gstreamer管道。现在我想播放一个包含h264编码的视频帧和aac编码的音频样本的mp4视频。为了播放视频样本,我使用了以下管道
gst-launch-0.10 filesrc location=~/samples/step_up_dance_1080p.mp4 ! qtdemux name=dmux dmux.video_00 ! h264parse ! ffdec_h264 ! autovideosink 我使用了以下管道来单独播放音频
gst-launch-0.10 filesrc location=~/samples/step_up_dance_1080p.mp4 ! qtdemux name=dmux dmux.audio_00 ! aacparse ! faad ! autoaudiosink两者都工作得很好,但我想将音频和视频结合起来。我该怎么做呢?我试过了
gst-launch-0.10 filesrc location=~/samples/step_up_dance_1080p.mp4 ! qtdemux name=dmux dmux.video_00 ! h264parse ! ffdec_h264 ! autovideosink dmux.audio_00 ! aacparse ! faad ! autoaudiosink但它并没有起作用。音视频如何同时播放?
发布于 2013-03-12 02:44:49
首先,当你说有些东西不能工作时,请告诉我发生了什么。如果管道停滞,您只是忘记了为解码器创建新线程的队列元素。
gst-launch-0.10 filesrc location=~/samples/step_up_dance_1080p.mp4 ! qtdemux name=dmux dmux.video_00 ! queue ! h264parse ! ffdec_h264 ! autovideosink dmux.audio_00 ! queue ! aacparse ! faad ! autoaudiosink使用playbin会更简单。看一下管道布局。
GST_DEBUG_DUMP_DOT_DIR=$PWD gst-launch-0.10 playbin2 uri=file://$HOME/samples/step_up_dance_1080p.mp4并使用graphviz (dot -Tsvg xxx.dot -o xxx.svg)渲染它创建的点文件。
https://stackoverflow.com/questions/15319526
复制相似问题