我正试图将GESPipeline编码和mux到MPEG-TS中,以便在UDP上进行流传输。
在预览模式下,流水线在屏幕上播放得很好。
我的尝试,实质上是:
GstEncodingContainerProfile *prof;
GstCaps *caps;
caps = gst_caps_from_string("video/mpegts");
prof = gst_encoding_container_profile_new("test-app-profile", NULL, caps, NULL);
caps = gst_caps_from_string("video/x-h264");
gst_encoding_container_profile_add_profile(prof,
(GstEncodingProfile*) gst_encoding_video_profile_new(caps, NULL, NULL, 0));
caps = gst_caps_from_string("audio/x-ac3");
gst_encoding_container_profile_add_profile(prof,
(GstEncodingProfile*) gst_encoding_audio_profile_new(caps, NULL, NULL, 0));
// this fails:
ges_pipeline_set_render_settings (pl, "file:///path/out.ts", prof);在输出中使用GST_DEBUG=3:
encodebin gstencodebin.c:1976:create_elements_and_pads: error:格式视频/mpegts没有可用的muxer
Update:更详细的调试显示,它实际上查看了mpegtsmux,但跳过了它。为什么?
相关信息:
gst_encode_bin_setup_profile:设置配置文件0x557c3c98c460:test-app-profile (类型:容器)
create_elements_and_pads:当前配置文件:测试-应用-配置文件
_get_muxer:获取格式视频/mpegts的muxers列表
gst_element_factory_list_filter:寻找工厂
..。
gst_element_factory_list_filter:尝试mpegtsmux
gst_structure_parse_field:尝试字段名“系统流”
_priv_gst_value_parse_value:尝试输入名称'boolean‘
gst_structure_parse_field:尝试字段名“数据包大小”
_priv_gst_value_parse_value:尝试输入名称'int‘
..。尝试其他的木匠..。
如果我将视频/mpegts更改为视频/x-matroska,则会生成mkv文件(虽然很难看,而且没有声音)。
如何将其编码成mpegts?
发布于 2020-08-18 11:02:20
问题是缺少了gst-inspect-1.0 mpegtsmux中src大写中列出的字段。这些都是必需的,如果您不指定它们,它将与muxer不匹配。
mpegtsmux解决方案:
gst_caps_from_string(“视频/电子设备,systemstream=true,packetsize=188");
感谢Freenode #gstreamer频道。
https://stackoverflow.com/questions/63252330
复制相似问题