现在想尝试使用mp4mux,但常常遇到执行到某一点时会卡住的问题。
在pipeline中使用--gst-debug-level=3
观察,
卡住的时候,会在 Redistribute latency...
或者在New clock: GstSystemClock
这两个位。
在没有进行编解码时,gst-launch-1.0运行正常:
gst-launch-1.0 --gst-debug-level=3 \
mp4mux name=mp4muxer ! filesink location="/VodDir/test.mp4" \
\
filesrc location="/VodDir/wildlife_h264.mp4" ! qtdemux name=qtdemuxer \
qtdemuxer. ! queue ! h264parse disable-passthrough=true ! mp4muxer. \
qtdemuxer. ! queue ! aacparse disable-passthrough=true ! mp4muxer.
进行编解码时:
/// 报错:
/// Setting pipeline to PAUSED ...
/// Pipeline is PREROLLING ...
/// 0:00:00.021482039 4945 0xa8ad40 WARN qtdemux qtdemux_types.c:196:qtdemux_type_get: unknown QuickTime node type iods
/// 0:00:00.021546482 4945 0xa8ad40 WARN qtdemux qtdemux_types.c:196:qtdemux_type_get: unknown QuickTime node type btrt
/// 0:00:00.021638450 4945 0xa8ad40 WARN qtdemux qtdemux.c:7975:qtdemux_parse_trak:<qtdemuxer> unknown version 00000000
/// Redistribute latency...
/// Redistribute latency...
gst-launch-1.0 --gst-debug-level=3 \
mp4mux name=mp4muxer ! filesink location="/VodDir/test.mp4" \
\
filesrc location="/VodDir/wildlife_h264.mp4" ! qtdemux name=qtdemuxer \
qtdemuxer. ! queue ! h264parse disable-passthrough=true ! avdec_h264 ! x264enc ! mp4muxer. \
qtdemuxer. ! queue ! aacparse disable-passthrough=true ! mp4muxer.
如果加上queue,虽然没有报Redistribute latency,但是会卡在New Clock那里:
/// 报错: 没报错,但是在最后的语句阻塞,New clock:GstSystemClock
/// Setting pipeline to PAUSED ...
/// Pipeline is PREROLLING ...
/// 0:00:00.024210373 2532 0x26f0940 WARN qtdemux qtdemux_types.c:196:qtdemux_type_get: unknown QuickTime node type iods
/// 0:00:00.024244094 2532 0x26f0940 WARN qtdemux qtdemux_types.c:196:qtdemux_type_get: unknown QuickTime node type btrt
/// 0:00:00.024334756 2532 0x26f0940 WARN qtdemux qtdemux.c:7975:qtdemux_parse_trak:<qtdemuxer> unknown version 00000000
/// Redistribute latency...
/// Redistribute latency...
/// 0:00:00.396850769 2532 0x26f09e0 FIXME basesink gstbasesink.c:3022:gst_base_sink_default_event:<filesink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements
/// Pipeline is PREROLLED ...
/// Setting pipeline to PLAYING ...
/// New clock: GstSystemClock
gst-launch-1.0 --gst-debug-level=4 \
mp4mux name=mp4muxer ! queue ! filesink location="/VodDir/test.mp4" \
\
filesrc location="/VodDir/wildlife_h264.mp4" ! queue ! qtdemux name=qtdemuxer \
qtdemuxer.video_0 ! queue ! h264parse disable-passthrough=true ! avdec_h264 ! x264enc ! queue ! mp4muxer.video_0 \
qtdemuxer.audio_0 ! queue ! aacparse disable-passthrough=true ! queue ! mp4muxer.audio_0
上网找到的资料很少,看资料一般会说是同步的问题,但是这里的组件不能设同步,想知道是什么问题导致的,该如何解决才好呢?
最后竟然在将 x264enc的tune参数设为zerolatency就OK了。