Posts: 57
Joined: Thu Nov 08, 2012 9:05 pm

H.264 based TV stream

Thu Nov 08, 2012 9:45 pm

I'm having some problems with omxplayer. I've upgraded to latest firmware boot files and that did fix that nasty chopping glitch that interlaced streams had, but I still can't play some files correctly.

I have connected RPi to my LCD PC monitor via HDMI and I'm using 1920x1080 resolution without any problems so far. I can play TS files that I've grabbed on another PC with MediaPortal, though I'm using the jack audio output as my monitor doesn't have speakers and I want to use my stereo set anyway.

* There's the "usual" popping noise when omxplayer starts - will that ever be fixed? I'm not even asking about any dates, just if this is a fixable issue or not. I'm not quite sure how this works on RPi but the schematics says something about PWM channels so if that's the case then the audio will always pop as the channels are enabled/disabled and the voltage rises/drops. One way would be to always have audio enabled (PWM running) so that it would pop just once at boot. If that's going to affect power draw than maybe a boot option for those of us who would rather trade a few mA for better audio on analog connector? Just a wild guess mind you.

* 1080i HD material in H.264 plays fine now, for me anyway. In fact it's so good that I'm considering turning RPi into full TV setup (if only for fun), has anyone tried USB DVB-T receivers? I'd rather learn from someone elese's mistakes :)

* I have some SD material that is a bit "different". It's encoded as 576i 50Hz 4:3 but meant to be shown as wide-screen. This is how it works:

Video: MPEG4 Video (H264) 720x576 (20:11) 25fps

dwInterlaceFlags: 0x00000000
dwCopyProtectFlags: 0x00000000
dwPictAspectRatioX: 20
dwPictAspectRatioY: 11
dwControlFlags: 0x00000000
dwReserved2: 0x00000000

biSize: 40
biWidth: 720
biHeight: 576
biPlanes: 1
biBitCount: 24
biCompression: AVC1
biSizeImage: 0
biXPelsPerMeter: 0
biYPelsPerMeter: 0
biClrUsed: 0
biClrImportant: 0

So as you see, it's 720x576 but needs to be rescaled using 20:11 ratio. Media Player Classic on Windows does it right but for some reason omxplayer will refuse to show anything, only audio is running. When I use "-r" switch it will show the video but way too wide, it fits the entire 1920 range while the heigth is probably still at 567i. Not sure what causes this but just in case, the correct way to rescale such video is to calculate (576*20)/11 = 1047, and use that as the new width. It's way less than 1920 so I'm not sure why this fails.

* Once I use "-r" and quit the omxplayer my console is gone. I can still SSH to the RPI and this is what fbset -s shows:

mode "1920x1080"
geometry 1920 1080 1920 1080 16
timings 0 0 0 0 0 0 0
rgba 5/11,6/5,5/0,0/16

Timings are gone, screen is black. Is there any way of recovering from that? The only one I have found is to use fbset to force a different mode but /etc/fb.modes does not list any entries for 1920x180 :( So, I used "640x480-60". At least this gives me some screen output...

Curiously, with this setting I can now run omxplayer without -r and it will play the SD-but-wide video and scale it properly. A bit of WTF moment :) I can run some tests if this helps.

* One last thing, I think I saw a post mentioning this problem already but there was no response: sometimes omxplayer will just overlay the video onto the console but will not hide the text. So when playing a video that can't be rescaled to fit the full screen (16:9 in my case) there will be black bars on top/bottom (cinema movies) or left/right (4:3 material). If there was a text there, shell prompt, mc windows, etc, it will still show. And that completly ruins the whole experience. Please fix :)

Return to “Troubleshooting”