使用 GStreamer(版本 1.12.4)我一直在使用以下语句成功地从 jpegs 创建视频:
gst-launch-1.0 multifilesrc location=image-%06d.jpg \
! image/jpeg,framerate=25/1 \
! decodebin \
! videoscale \
! video/x-raw \
! x264enc bitrate=10000 \
! mpegtsmux \
! filesink location=test-H264-10Mbps.ts
正如声明所暗示的,这会创建 H.264 编码的 MPEG-TS 文件,这些文件以 25 fps 的速度使用 jpeg 文件。
我目前也有类似命名的 klv 文件,并希望将它们混合到相同的输出 ts 文件中。我的最佳尝试(基于其他示例)看起来像这样:
gst-launch-1.0 multifilesrc location=data-%06d.klv \
! meta/x-klv \
! mpegtsmux name=mux \
! multifilesrc location=image-%06d.jpg \
! image/jpeg,framerate=25/1 \
! decodebin \
! videoscale \
! video/x-raw \
! x264enc bitrate=10000 \
! mux. \
! filesink location=test-H264-KLV-10Mbps.ts
这会导致相当多的语法错误:
0:00:00.081526898 20796 000000000529E360 WARN default grammar.y:1137:priv_gst_parse_yyerror: Error during parsing: syntax error, unexpected LINK
0:00:00.087062261 20796 000000000529E360 ERROR GST_PIPELINE grammar.y:1061:priv_gst_parse_yyparse: syntax error
0:00:00.091393840 20796 000000000529E360 ERROR GST_PIPELINE grammar.y:1061:priv_gst_parse_yyparse: syntax error
0:00:00.099172303 20796 000000000529E360 ERROR GST_PIPELINE grammar.y:740:gst_parse_perform_link: could not link mux to multifilesrc1
WARNING: erroneous pipeline: syntax error
如果这样可以简化答案,我也不介意以不同的格式提供 KLV 数据。我还尝试过添加队列语句以及在不同位置进行多路复用,但到目前为止,这会导致相同的错误消息。
有什么想法、资源或其他建议可以让我找到正确的多路复用 KLV 方向吗?