【发布时间】:2017-02-23 06:10:49
【问题描述】:
以下管道生成一个 3kb 的 .ogg 文件(我假设它只是一个空容器):
gst-launch-1.0 --gst-debug=3 filesrc location=test.raw
! 'audio/x-raw, format=S16LE, channels=1, rate=32000'
! audioconvert
! vorbisenc
! oggmux
! filesink location=test.ogg
这是调试输出:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
0:00:00.048490941 813 0x556bf3625000 FIXME basesink gstbasesink.c:3077:gst_base_sink_default_event:<filesink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements
0:00:00.048541997 813 0x556bf3625000 WARN audioencoder gstaudioencoder.c:985:gst_audio_encoder_finish_frame:<vorbisenc0> Can't copy metadata because input buffer disappeared
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.139954729 813 0x556bf3625000 WARN basesrc gstbasesrc.c:2400:gst_base_src_update_length:<filesrc0> processing at or past EOS
Got EOS from element "pipeline0".
Execution ended after 0:00:00.091883401
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
当我添加这个 wav 编码/解码时,我得到了一个很好的 .ogg 文件:
gst-launch-1.0 --gst-debug=3 filesrc location=test.raw
! 'audio/x-raw, format=S16LE, channels=1, rate=32000'
! audioconvert
! wavenc
! wavparse
! audioconvert
! vorbisenc
! oggmux
! filesink location=test.ogg
调试输出:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
0:00:00.135676651 822 0x562b3cd64770 FIXME basesink gstbasesink.c:3077:gst_base_sink_default_event:<filesink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements
0:00:00.135718946 822 0x562b3cd64770 WARN audioencoder gstaudioencoder.c:985:gst_audio_encoder_finish_frame:<vorbisenc0> Can't copy metadata because input buffer disappeared
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.219188746 822 0x562b3cd64770 WARN wavenc gstwavenc.c:795:gst_wavenc_write_toc:<wavenc0> have no toc
Got EOS from element "pipeline0".
Execution ended after 0:00:00.083921991
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
所以我的问题是:第二个管道是什么,使用 wavenc ! wavparse,前提是缺少第一种形式,是否有更直接的方式来指定它,或者第二种形式实际上是“正确”的方式来做到这一点?
【问题讨论】: