mikearm
Posts: 2
Joined: Tue Jun 25, 2013 6:37 pm

success with transcode for vdr (mpeg2) to roku (h264)

Wed Jun 26, 2013 2:34 am

Of course, I get this to work just after my post...

I guess I had to put in a bit rate. Here's what worked:

[code]
gst-launch-1.0 --gst-debug=*:3 filesrc location=00001.ts ! decodebin name=demux demux. ! queue ! audioconvert ! "audio/x-raw,format=F32LE" ! avenc_ac3 bitrate=192000 ! mux. matroskamux name=mux ! filesink location=test.mkv demux. ! queue ! videoconvert ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! mux.
[/code]

There was a nice bonus, too... my $50 Roku LT is spec'ed for 2 channels, but I got 5.1 audio! Also, this was a 1080 resolution video... who knows what will happen when when/if I turn up the bit rate on the video encode, but it certainly displayed fine as it is currently spec'ed. The Roku LT uses the same hardware as the pi (and Rokus that are spec'ed for 1080), but at a lower clock...

-------

Hi!

I posted this to the general forum before I realized this would probably be the better place...

I'm trying to use gstreamer to transcode .ts (mpeg2) to h264. The plan is to use an hdhomerun and vdr to record video from cable, convert it, then stream to my Roku using something like Roksbox...

I've got the rpi hardware acceleration working (for the video) with the latest version of gstreamer, but I'm having trouble with the audio... the Roku wants to see ac3. If I use this (encoded with vorbisenc),
[code]gst-launch-1.0 --gst-debug=decodebin:4 filesrc location=00001.ts ! decodebin name=demux demux. ! queue ! audioresample ! "audio/x-raw,rate=44100" ! audioconvert ! "audio/x-raw,format=F32LE" ! vorbisenc ! mux. matroskamux name=mux ! filesink location=test.mkv demux. ! queue ! videoconvert ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! mux.[/code]
it works, both video and audio are encoded as expected and play nicely (on VLC, not roku). Some extra stuff might be in there (like resampling, which I don't think was necessary), but I don't think that matters too much.

Now, with avenc_ac3 (since this is the codec the Roku wants to see):
[code]gst-launch-1.0 --gst-debug=decodebin:4 filesrc location=00001.ts ! decodebin name=demux demux. ! queue ! audioresample ! "audio/x-raw,rate=44100" ! audioconvert ! "audio/x-raw,format=F32LE" ! avenc_ac3 ! mux. matroskamux name=mux ! filesink location=test.mkv demux. ! queue ! videoconvert ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! mux.[/code]
It fails, with...
[code] Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:01.328599672 3558 0x11add20 INFO decodebin gstdecodebin2.c:3767:gst_decode_bin_expose:<demux:src_0> added new decoded pad
0:00:01.346484969 3558 0x11add20 INFO decodebin gstdecodebin2.c:3767:gst_decode_bin_expose:<demux:src_1> added new decoded pad
0:00:01.348397894 3558 0x11add20 INFO decodebin gstdecodebin2.c:3767:gst_decode_bin_expose:<demux:src_2> added new decoded pad
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:demux/GstTSDemux:tsdemux0: Internal data stream error.
Additional debug info:
mpegtsbase.c(1646): mpegts_base_loop (): /GstPipeline:pipeline0/GstDecodeBin:demux/GstTSDemux:tsdemux0:
stream stopped, reason not-negotiated
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
[/code]
It's not obvious to me that there's an audio stream problem, since aplay works on the raw audio stream (with the right format), and avconv can convert the raw audio stream (if I put this alone in a file using gstreamer) to ac3, which also plays nicely using VLC.

I'm using gstreamer 1.0.7 compiled from source based on the instructions at:

http://www.trans-omni.co.uk/pi/GStreame ... _gstreamer

I tend to think that there's some syntax or container problem... I'm totally new to gstreamer - I'm using it for the rpi gpu implementation. I might be able to convert the audio separately, but I'm not sure how to mux it... tried a couple of things which just didn't work. Conversion doesn't work with the above command on the pi or my amd64 desktop.

I'll probably try the precompiled bins for gstreamer as well... the original plan was to compile so I could increase the bit rate in the video conversion (which I understand is having some problems in the current versions)...

Advice welcome...

Thanks in advance,

Mike

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

Re: success with transcode for vdr (mpeg2) to roku (h264)

Sat Jul 06, 2013 1:51 pm

try aac or mp3 encoder
and latest gst omx from git support bitrate in omxh264

http://cgit.freedesktop.org/gstreamer/gst-omx/

jviyer
Posts: 30
Joined: Mon Nov 04, 2013 3:48 pm

Re: success with transcode for vdr (mpeg2) to roku (h264)

Thu Nov 28, 2013 3:36 pm

mikearm wrote:Of course, I get this to work just after my post...

I guess I had to put in a bit rate. Here's what worked:

Code: Select all

gst-launch-1.0 --gst-debug=*:3 filesrc location=00001.ts ! decodebin name=demux demux. ! queue ! audioconvert ! "audio/x-raw,format=F32LE" ! avenc_ac3 bitrate=192000 ! mux. matroskamux name=mux ! filesink location=test.mkv demux. ! queue ! videoconvert ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! mux.
There was a nice bonus, too... my $50 Roku LT is spec'ed for 2 channels, but I got 5.1 audio! Also, this was a 1080 resolution video... who knows what will happen when when/if I turn up the bit rate on the video encode, but it certainly displayed fine as it is currently spec'ed. The Roku LT uses the same hardware as the pi (and Rokus that are spec'ed for 1080), but at a lower clock...

-------

Hi!

I posted this to the general forum before I realized this would probably be the better place...

I'm trying to use gstreamer to transcode .ts (mpeg2) to h264. The plan is to use an hdhomerun and vdr to record video from cable, convert it, then stream to my Roku using something like Roksbox...

I've got the rpi hardware acceleration working (for the video) with the latest version of gstreamer, but I'm having trouble with the audio... the Roku wants to see ac3. If I use this (encoded with vorbisenc),

Code: Select all

gst-launch-1.0 --gst-debug=decodebin:4 filesrc location=00001.ts ! decodebin name=demux demux. ! queue ! audioresample ! "audio/x-raw,rate=44100" ! audioconvert ! "audio/x-raw,format=F32LE" ! vorbisenc ! mux. matroskamux name=mux ! filesink location=test.mkv demux. ! queue ! videoconvert ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! mux.
it works, both video and audio are encoded as expected and play nicely (on VLC, not roku). Some extra stuff might be in there (like resampling, which I don't think was necessary), but I don't think that matters too much.

Now, with avenc_ac3 (since this is the codec the Roku wants to see):

Code: Select all

gst-launch-1.0 --gst-debug=decodebin:4 filesrc location=00001.ts ! decodebin name=demux demux. ! queue ! audioresample ! "audio/x-raw,rate=44100" ! audioconvert ! "audio/x-raw,format=F32LE" ! avenc_ac3 ! mux. matroskamux name=mux ! filesink location=test.mkv demux. ! queue ! videoconvert ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! mux.
It fails, with...

Code: Select all

    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    0:00:01.328599672  3558  0x11add20 INFO               decodebin gstdecodebin2.c:3767:gst_decode_bin_expose:<demux:src_0> added new decoded pad
    0:00:01.346484969  3558  0x11add20 INFO               decodebin gstdecodebin2.c:3767:gst_decode_bin_expose:<demux:src_1> added new decoded pad
    0:00:01.348397894  3558  0x11add20 INFO               decodebin gstdecodebin2.c:3767:gst_decode_bin_expose:<demux:src_2> added new decoded pad
    ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:demux/GstTSDemux:tsdemux0: Internal data stream error.
    Additional debug info:
    mpegtsbase.c(1646): mpegts_base_loop (): /GstPipeline:pipeline0/GstDecodeBin:demux/GstTSDemux:tsdemux0:
    stream stopped, reason not-negotiated
    ERROR: pipeline doesn't want to preroll.
    Setting pipeline to NULL ...
    Freeing pipeline ...
It's not obvious to me that there's an audio stream problem, since aplay works on the raw audio stream (with the right format), and avconv can convert the raw audio stream (if I put this alone in a file using gstreamer) to ac3, which also plays nicely using VLC.

I'm using gstreamer 1.0.7 compiled from source based on the instructions at:

http://www.trans-omni.co.uk/pi/GStreame ... _gstreamer

I tend to think that there's some syntax or container problem... I'm totally new to gstreamer - I'm using it for the rpi gpu implementation. I might be able to convert the audio separately, but I'm not sure how to mux it... tried a couple of things which just didn't work. Conversion doesn't work with the above command on the pi or my amd64 desktop.

I'll probably try the precompiled bins for gstreamer as well... the original plan was to compile so I could increase the bit rate in the video conversion (which I understand is having some problems in the current versions)...

Advice welcome...

Thanks in advance,

Mike
mikearm:
I was following your post and want to stream live tv from hdhomerun dual tuner to roku by first saving to 1.ts file and then doing the approach you have used. (I have the 99$ Roku which I think is the latest).
would you be able to kindly provide some fundamental steps (I suppose with the gstreamer portion)
<I am not in need of vdr or xbmc at the moment. just want a simple thing>
I have rasp 512MB model B.
would I be able to do:
hdhomerun tuner-->save continuously to 1.ts ---> do what you have done with gstreamer (transcode etc.)-->roku.
will the roku player also be able to pause/skip back/skip fwd etc..
I appreciate your time and assistance,
regards,
jawa

Return to “Graphics, sound and multimedia”