maintain original video aspect ratio..?

hello,

i’m a new roku developer and i have a simple question.

many of our videos are still in 4:3 format. but we have the roku connected to a 16:9 tv. when we attempt to play one of our videos using the “simplevideoplayer” sample program, it is stretched pretty badly. is there any way we can tell roku to play the video and maintain the original aspect ratio of the video itself? we are streaming the H.264-encoded video via the HLS protocol.

thank you!
steven

It should be maintaining aspect ratio. Is the TV’s ‘wide’ mode set appropriately?

“RokuPatrick” wrote:
It should be maintaining aspect ratio. Is the TV’s ‘wide’ mode set appropriately?

Yes. It is. In fact, I cycled through the various display settings from FULL to WIDE to ZOOM, etc. I have it usually set on FULL. I have it connected via HDMI.

Is there any way in the SDK to explicitly specify the aspect ratio of the video?

Thanks
Steven

“astudios” wrote:

“RokuPatrick” wrote:
It should be maintaining aspect ratio. Is the TV’s ‘wide’ mode set appropriately?

Yes. It is. In fact, I cycled through the various display settings from FULL to WIDE to ZOOM, etc. I have it usually set on FULL. I have it connected via HDMI.

Is there any way in the SDK to explicitly specify the aspect ratio of the video?

Thanks
Steven

No, you can’t explicitly set the aspect ratio. Is the Roku set to HD or at least 16x9 output? If you want to send me a link to some sample content that demonstrates the problem, we’re happy to take a look.

Patrick

“RokuPatrick” wrote:

“astudios” wrote:

“RokuPatrick” wrote:
It should be maintaining aspect ratio. Is the TV’s ‘wide’ mode set appropriately?

Yes. It is. In fact, I cycled through the various display settings from FULL to WIDE to ZOOM, etc. I have it usually set on FULL. I have it connected via HDMI.

Is there any way in the SDK to explicitly specify the aspect ratio of the video?

Thanks
Steven

No, you can’t explicitly set the aspect ratio. Is the Roku set to HD or at least 16x9 output? If you want to send me a link to some sample content that demonstrates the problem, we’re happy to take a look.

Patrick

Yes. The ROKU is setup for HD (16x9). Here’s an example of what I’m trying to stream through ROKU:

http://media10.sa-media.com:1935/myapp/ … ylist.m3u8

I am playing it with the “HLS” stream type (Apple’s HTTP Live Streaming) and it is coming off of a Wowza Server. If you view it on a WIDESCREEN (HDTV), you’ll see how it stretches across the entire screen. It is a 4:3 video so there should be black bars on the sides. I have the latest firmware update on the ROKU too.

Thanks for looking into this for me. I’m kind of stuck.

Steven

Just confirmed that it’s playing back wide. Looking into it.

Patrick

were you able to find any solution to the aspect ratio issue? i’d really love to solve this. my video size is 400x300 which should be a standard 4:3 aspect ratio. but when i play the video (via wowza HLS), it stretches it to fill my entire 16:9 screen. i have the roku in HD mode.

any help would be appreciated.

thank you,
steven

How was this video encoded? We normally read the resolution information encoded in the sequence headers in the transport stream. This works on most video we encounter, but I tested your stream and concur that it seems to be 4:3 content playing at 16:9 on our box.

Do you have any more info you can share about how you encoded it?

Thanks,

Kevin

sure thing.

it was encoded with FFMPEG with H.264 video codec and AAC audio codec. 30fps, 500kbps video, 48kbps audio, with H.264 baseline presets. but i also tried it with an MP4 encoded with microsoft’s expression encoder 4 pro and it also did not get the aspect ratio right.

btw, i just tried to access the same MP4 file directly on our web server (via ROKU) but NOT going through the Wowza HLS streaming and the 4:3 aspect ratio works! bottom line is that the ROKU implementation of the HLS does not appear to be handling the aspect ratio correctly..?

hey, while i have you here, one more thing… when we try to stream via wowza HLS to the ROKU box, it stops (every time) at around the 17min mark. we’ve tried it with a bunch of other videos – same result. but when we point the ROKU directly to the MP4 file on the webserver (do not use HLS), it works just fine. perhaps another issue with the HLS implementation on the ROKU?

thanks for your help!
steven

“RokuKevin” wrote:
How was this video encoded? We normally read the resolution information encoded in the sequence headers in the transport stream. This works on most video we encounter, but I tested your stream and concur that it seems to be 4:3 content playing at 16:9 on our box.

Do you have any more info you can share about how you encoded it?

Thanks,

Kevin

one more thing.. i just tried streaming a LIVE video stream (using adobe’s live flash encoder) to our wowza server and viewing it on the ROKU device via HLS streaming and it works – but again, it does not maintain the 4:3 aspect ratio. so, it’s definitely not anything to do with the ffmpeg encoder we are using for the on-demand (archived) videos.

so, again, the problem seems to be how ROKU handles (aspect ratios) for HLS video streams…?

steven

astudios,

From your description, it sounds to me that Wowza is not providing the resolution information encoded in the sequence headers in the transport stream… The output from FFMpeg and Windows Media Encoder both play at the proper resolution on the Roku because the Roku can read the resolution headers from its output. When putting those encodings through the Wowza server, the resolution information gets lost.

I recommend working with Wowza to resolve this. I’m sure we’d all welcome an update on your findings.

–Kevin

“RokuKevin” wrote:
astudios,

From your description, it sounds to me that Wowza is not providing the resolution information encoded in the sequence headers in the transport stream… The output from FFMpeg and Windows Media Encoder both play at the proper resolution on the Roku because the Roku can read the resolution headers from its output. When putting those encodings through the Wowza server, the resolution information gets lost.

I recommend working with Wowza to resolve this. I’m sure we’d all welcome an update on your findings.

–Kevin

kevin, thanks for the reply. i have copied your response in a WOWZA forum where hopefully their tech will be able to help shed some light on this issue. just so you know, it seems this issue was already brought up in the WOWZA forum by someone else and here’s how they responded:

“This [resolution] information is sent in the PPS and SPS NAL units of each key frame. We ensure that we inject SPS and PPS NAL units if they do not exist. If there is something more than this that needs to be done then I am not sure.”

so it appears that WOWZA is saying that they are indeed sending the necessary resolution information to you for HLS streaming.

would you care to help further this discussion?

thanks,
steven

with the release of the newest firmware update, the aspect ratio “stretching” problem seems to be solved! so, now 4:3 videos maintain their aspect ratios and are NOT stretched on a widescreen TV (before, they were most definitely stretched for both LIVE and VOD).

okay, but there seems to be a new problem that perhaps someone can shed some light on?

now, (with the newest firmware) any HLS-streamed video (VOD) does not play when you first click on it. i have to fast-forward a few minutes into it in order to get it to go. this did not happen with the previous firmware. in fact, i have two roku boxes here attached to my TV. one with the new firmware, one without. the one without can start playing the HLS video right away (although stretched), the new firmware box, does not play the HLS video – but seems stuck on the loading screen for many minutes. i can fast-forward a few minutes into it and then it plays OK (maintaining aspect ratio).

does anyone care to see this for yourself?

load up our “sermonaudio” channel, go to the VIDEOS section, then click on any video to play and you’ll see what i mean.

thanks for any help,
steven

p.s. we are using WOWZA (latest version) on the back-end to HLS stream the videos. videos are all H.264+AAC and work just fine on iphones via HLS. thanks.

“astudios” wrote:
now, (with the newest firmware) any HLS-streamed video (VOD) does not play when you first click on it. i have to fast-forward a few minutes into it in order to get it to go. this did not happen with the previous firmware. in fact, i have two roku boxes here attached to my TV. one with the new firmware, one without. the one without can start playing the HLS video right away (although stretched), the new firmware box, does not play the HLS video – but seems stuck on the loading screen for many minutes. i can fast-forward a few minutes into it and then it plays OK (maintaining aspect ratio).

I’d just like to comment that I am seeing similar behavior in one of my channels. The loading screen gets stuck at around 75% percent. FF does not seem to work for me (possibly b/c the file is transcoding). If I hit “UP” or “HOME” when on the loading screen it causes a reboot (do you see this too?).

For reasons I prefer not to get into here I don’t expect Roku to support my channel, but I can confirm that something has changed with the way HLS is handled.

We’re looking into the reported HLS issues in 2.8.

yeah i just noticed issues too and i was just using a nasa stream as a test…

“RokuPatrick” wrote:
We’re looking into the reported HLS issues in 2.8.
As I said in the general forum, I have yet to find a video that will play under 2.8, so I don’t think it’s just HLS. I can’t say I’ve tried many since most of them crash the box, but I can send you plenty of samples of videos that used to play.

I’m having a bad day… :disappointed_face:

-JT

SOLVED!

we changed the “minBandwidth” value in our ROKU app to 64 (used to be 20) and it worked! HLS video streaming works beautifully now! aspect ratio is maintained to boot!

steven

“astudios” wrote:
SOLVED!

we changed the “minBandwidth” value in our ROKU app to 64 (used to be 20) and it worked! HLS video streaming works beautifully now! aspect ratio is maintained to boot!

steven
just as a followup.. the above works for VOD (video-on-demand) but failed for any LIVE HLS stream. so, we inserted code to use minBandwidth=20 for all LIVE streams and minBandwidth=64 for all VOD videos. not pretty, but it works.

steven