Problem extracting KLV data from .ts stream

John Hanks jhanks at vsicorp.com
Thu Mar 15 01:57:08 UTC 2018


I'm trying to write a program to play the audio and video portions of an 
MPEG2 string with KLV data and extract the KLV data.  Once I add the 
sink for the KLV data, the program seems to hang after it has 
initialized all of the pipeline pieces.

I've tried to simplify it from the command line to make sure the concept 
works (this helped with past issues).  If I try to extract the data to a 
file:

gst-launch-1.0 -v --gst-debug=*:2 -e  filesrc location=/data/file.ts 
typefind=true ! tsparse set-timestamps=true ! video/mpegts ! tsdemux 
name=src  src. ! queue max-size-time=3000000000  ! avdec_aac ! 
audioconvert ! autoaudiosink src. ! queue ! h264parse ! "video/x-h264, 
alignment=au" ! avdec_h264 ! queue max-size-time=3000000000  ! 
"video/x-raw" ! videoconvert ! autovideosink src. ! queue 
max-size-time=3000000000 ! "meta/x-klv" ! filesink 
location=/tmp/klvextract.log

It hangs.  If I simplify it more to just throw away the data:

gst-launch-1.0 -v --gst-debug=*:2 -e  filesrc location=/data/file.ts 
typefind=true ! tsparse set-timestamps=true ! video/mpegts ! tsdemux 
name=src  src. ! queue max-size-time=3000000000  ! avdec_aac ! 
audioconvert ! autoaudiosink src. ! queue ! h264parse ! "video/x-h264, 
alignment=au" ! avdec_h264 ! queue max-size-time=3000000000  ! 
"video/x-raw" ! videoconvert ! autovideosink src. ! queue 
max-size-time=3000000000 ! "meta/x-klv" ! fakesink

I get he same thing.  My best guess is that there is not a constant 
stream of KLV data for the 'sink' but I know the KLV data is 'in there' 
because I can see it if I look at the file in a binary editor. (I have 
another pipeline/program that created the file with specific KLV data.)

Any help would be appreciated,

John



More information about the gstreamer-devel mailing list