Tsdemux synchronous file, klv metadata extraction failed

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Tsdemux synchronous file, klv metadata extraction failed

AurelienV
Hi,

I'm trying to write an application which is able to extract (and process/convert) KLV metadata from a TS file or stream.

I found KLV support in private section of tsdemux, and I succeeded to extract them (in file for example) with this pipeline:
(gst-launch-1.0) filesrc location=mytsfile ! tsparse ! tsdemux ! meta/x-klv ! filesink location=klvextract.log

But, this only works with asynchronous TS file (no synchronization between AVC stream and KLV stream).
When I try with synchronous file from command line (gst-launch-1.0), i got this error:

./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstTSDemux:tsdemux0:
failed delayed linking some pad of GstTSDemux named tsdemux0 to some pad of GstFileSink named filesink0
ERROR: from element /GstPipeline:pipeline0/MpegTSParse2:mpegtsparse2-0: Internal data stream error.

When i try to do same in an application like this:
main.c:
[...]
GstElement *pipeline, *filesrc, *ts_parser, *demuxer, *filter_caps_mtd, *filesink;
[...]
filesrc = gst_element_factory_make ("multifilesrc", "multifilesrc");
if(!filesrc) {
    g_print ("Filesrc not created.\n");
    return -1;
}
g_object_set(G_OBJECT (filesrc), "location", argv[1], NULL);

ts_parser = gst_element_factory_make("tsparse", "ts_parser");
if(!ts_parser) {
    g_print("Unable to created tsparse.\n");
    return -1;
}

filter_caps_mtd = gst_element_factory_make("capsfilter","mtd_filter");
if(!filter_caps_mtd) {
    g_print ("Filter caps not created.\n");
    return -1;
}
GstCaps *mtd_caps = gst_caps_new_empty_simple("meta/x-klv");
g_object_set(G_OBJECT (filter_caps_mtd), "caps", mtd_caps, NULL);

demuxer = gst_element_factory_make("tsdemux", "tsdemux");
if(!demuxer) {
    g_print ("Demuxer not created.\n");
    return -1;
}
g_object_set(G_OBJECT (demuxer), "emit-stats", true, NULL);
g_object_set(G_OBJECT (demuxer), "parse-private-sections", true, NULL);

filesink = gst_element_factory_make("filesink","filesink");
if(!filesink) {
    g_print ("Filesink not created.\n");
    return -1;
}
g_object_set(G_OBJECT (filesink), "location", argv[2], NULL);

gst_bin_add_many (GST_BIN (pipeline), filesrc, ts_parser, demuxer, filter_caps_mtd, filesink, NULL);

if(!gst_element_link(filesrc, ts_parser)) {
    g_print ("Failed to link filesrc and ts_parser!\n");
    return -1;
}

if(!gst_element_link(ts_parser, demuxer)) {
    g_print ("Failed to link ts_parser and demuxer!\n");
    return -1;
}

if(!gst_element_link(demuxer, filter_caps_mtd)) {
    g_print ("Failed to link demuxer and filter_caps_mtd!\n");
    return -1;
}

if(!gst_element_link(filter_caps_mtd, filesink)) {
    g_print ("Failed to link filter_caps_mtd and filesink!\n");
    return -1;
}
[...]

I got an error when linking demuxer(tsdemux) and filter_caps_mtd(meta/x-klv).

If someone have an idea about it ...

Thanks,
Regards
Reply | Threaded
Open this post in threaded view
|

Re: Tsdemux synchronous file, klv metadata extraction failed

gagankumarnigam
Hi,
 
Can u show me your full code ??



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel