【发布时间】:2015-01-20 02:31:46
【问题描述】:
我想使用 gstreamer 对 mp4.(mp4-h264_1920x1080/aac => mp4-h264_640x480/mp3) 进行转码和调整大小。我写下了这个命令。
$ gst-launch-0.10 filesrc location=./gain_1.mp4 ! qtdemux name=demux demux.video_00 ! queue ! ffdec_h264 ! videoscale ! 'video/x-raw-yuv,width=640,height=480' ! x264enc ! queue ! qtmux name=mux mux.video_0 demux.audio_00 ! queue ! ffdec_aac ! lame bitrate=128 ! queue ! mux.audio_0 mux. ! filesink location=0000.mp4 –v -e
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
(gst-launch-0.10:17958): GLib-CRITICAL **: Source ID 1 was not found when attempting to remove it
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
这没用。
仅对视频进行转码:
gst-launch-0.10 filesrc location=./gain_1.mp4 ! qtdemux name=demux demux.video_00 ! queue ! ffdec_h264 ! videoscale ! 'video/x-raw-yuv, width=640, height=480' ! x264enc ! queue ! mux. mp4mux name=mux ! filesink location=0000.mp4 –v -e
也只转码音频:
gst-launch-0.10 filesrc location=./gain_1.mp4 ! qtdemux name=demux demux.audio_00 ! ffdec_aac ! lame bitrate=128 ! queue ! mux. mp4mux name=mux ! filesink location=0000.mp4 –v -e
如何使用相同的命令对音频和视频进行转码?
【问题讨论】:
-
第一个命令的具体问题是什么?
-
@Mathieu_Du 当我被要求运行该命令时,该消息是下一个。 => 将管道设置为 PAUSED ... Pipeline 正在 PREROLLING ... 重新分配延迟... 并且刚刚结束。
-
尝试在解复用器的音频垫之后放置一个队列,也许在 ffdec_aac 之前?
-
@Mathieu_Du 我试图排个队。像这样~~~x264enc!队列 !多路复用器。 demux.audio_00 !队列 ! ffdec_aac !蹩脚~~~~ 但是,结果是一样的。
-
好吧,我不确定那里会发生什么,你应该用 gstreamer 1.0 试试这个,如果你仍然重现,请在 gtsreamer IRC 上讨论。
标签: gstreamer mp4 h.264 aac gst-launch