So I'm trying to demux a .ts file with mpegtsdemux, make some calculations with the elementary streams and re-mux everything back to using the same mpegts container, this works pretty well with the video and audio streams, however im having some difficulties with the data stream(#2) that holds timed_id3
packets. In this case, i simply want to passthrough them as they are untouched, however, neither the deumxer nor the muxer can identify that stream or create the appropriate pads, needless to say, connect the successfully after the pipeline goes from paused to running.
here's the details of my file, extracted using ffmpeg
:
Stream #0:0[0x101]: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 48000
Hz, stereo, fltp, 117 kb/s
Stream #0:1[0x102]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(tv, bt709, progressive), 1280x720, Closed Captions, 59.94 fps, 59.94
tbr, 90k tbn, 96k tbc
Stream #0:2[0x103]: Data: timed_id3 (ID3 / 0x20334449)
so far, I have managed to generate only meta/x-klv caps but that's not what i really need. Any other attempts ended with not-negotiated
error or internal stream error
.
i have also read that one may request-pads
from the muxer, but that also failed.
std::stringstream ss;
ss << "src_" << streamIdx_;
gstSrc_ = gst_element_factory_make("appsrc", ss.str().c_str());
gst_bin_add_many(GST_BIN(pipeline), gstSrc_, nullptr);
GstPadTemplate* mux_src_pad_template = gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(mux), "sink_%d");
GstCaps* caps = gst_caps_new_simple("private/x-timed_id3", NULL);
GstPad* pad = gst_element_request_pad(mux, mux_src_pad_template, nullptr, caps);
gboolean success = gst_element_link_pads(gstSrc_, "src", mux, gst_pad_get_name(pad));
g_object_set(gstSrc_, "format", GST_FORMAT_TIME, nullptr);
gst_caps_unref(caps);