0rphu
Posts: 38
Joined: Sun Oct 23, 2011 1:45 pm

gstreamer h264 ts transcoding

Mon Dec 09, 2013 6:55 pm

Hello everybody,

I've been trying to transcode some h264 HD tv recordings in .ts to h264, just a bit lower bitrate than the original. Tried omxtx, but the results were not really satisfactory. Now with gstreamer 1.0 and gst-omx, it should be working, but it isn't. Transcoding mpeg2 TS to h264 works fine, but h264 to h264 doesn't work. When using decodebin or uridecodebin it keeps complaining about missing decoder for h264, even thou omxh264dec is in place. when using tsdemux ! h264parse ! omxh264dec it just gives me a cryptic error: ERROR: from element /GstPipeline:pipeline0/GstTSDemux:tsdemux0: Internal data stream error

I've read a lot in this forum and others, didn't want to hijack other threads, so I opened a new one. Does anyone have an idea how to accomplish this? A pipeline that actually works?

Thanks in advance

User avatar
Defiant
Posts: 179
Joined: Tue Oct 30, 2012 6:17 pm
Location: Hamburg, Germany

Re: gstreamer h264 ts transcoding

Sat Dec 14, 2013 7:27 pm

Please try a pipeline with only omxh264dec and one with only omxh264enc. They both should work.

0rphu
Posts: 38
Joined: Sun Oct 23, 2011 1:45 pm

Re: gstreamer h264 ts transcoding

Mon Dec 16, 2013 10:58 am

Thanks Defiant,

in the meantime I asked at gstremer-devel mailing list:
http://gstreamer-devel.966125.n4.nabble ... 64013.html

Seems there is a problem, quoting Tim Müller
I think the problem here might be that h264parse does not put
width/height on the output (src) caps, and omxh264dec requires that.

If I remember correctly, this was fixed in 1.2.x.
Sure enough, when I compiled the 1.2, the problem went away. I also noticed the matroska files produced by 1.0 refused to be played on my satellite receiver - this problem also went away when I moved to 1.2. Unfortunately there is another bug present in 1.2 when omxmpeg2dec can't handle aspect ratio changes in midstream.

rocketsbay
Posts: 1
Joined: Wed Jan 15, 2014 5:16 pm

Re: gstreamer h264 ts transcoding

Wed Jan 15, 2014 5:26 pm

Hi 0rphu,

If not too much trouble would it be possible for you to outline the steps needed to get MPEG2 ts and HD h264 transcoded to lower bitrate? I'd like to do the same but I'm new to video decoding/encoding. If you give me the basic steps, I should be able to figure it out myself and if you have specific online documentation (forum post, blog...) that would be great!

Thanks in advance.

m][sko
Posts: 106
Joined: Fri Jul 20, 2012 6:37 am
Location: Slovakia

Re: gstreamer h264 ts transcoding

Thu Jan 23, 2014 9:25 pm

you can use my set of patches
hw decoder simple ignore aspect ratio changes as gstreamer pipeline don't need it and openmax don't generate proper aspect ration in H264 SPS NAL
http://pastebin.com/JDbuGzyQ

omxh264 encoder with more settings
http://pastebin.com/b5avcxpm

If anybody have some time to add more h264 specific options, you can use my patch as good example
broadcom openmax api support looot of stuff

hevilp
Posts: 64
Joined: Sun Sep 09, 2012 6:13 pm

Re: gstreamer h264 ts transcoding

Tue Oct 06, 2015 7:10 pm

Code: Select all

[email protected] ~ $ sudo gst-launch-1.0 souphttpsrc location="http://192.168.178.37:31339/0,0x0060,0x00ff,0x0103" is-live=true ! decodebin name=demux demux. ! queue ! audioresample ! mux. matroskamux name=mux streamable=true ! tcpserversink host=192.168.178.56 port=5600 demux. ! queue ! videoconvert ! omxh264enc target-bitrate=20000 control-rate=variable ! "video/x-h264,profile=high" ! h264parse ! mux.
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Missing element: Teletext decoder
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:demux/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0: Could not configure supporting library.
Additional debug info:
gstomxvideodec.c(2840): gst_omx_video_dec_loop (): /GstPipeline:pipeline0/GstDecodeBin:demux/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0:
Unable to reconfigure output port
Execution ended after 0:00:07.653194319
Setting pipeline to PAUSED ...
Setting pipeline to READY ...

** (gst-launch-1.0:24487): CRITICAL **: gst_omx_component_close_tunnel: assertion 'port1->tunneled && port2->tunneled' failed

** (gst-launch-1.0:24487): CRITICAL **: gst_omx_component_close_tunnel: assertion 'port1->tunneled && port2->tunneled' failed
Setting pipeline to NULL ...
Freeing pipeline ...
I can some1 help me?

Return to “Graphics, sound and multimedia”