-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video decoder detects wrong pixel aspect ratio #507
Comments
I think this is an omxplayer issue, rather than firmware. Mediainfo says:
Not quite sure what it means by that, but I suspect that the two DARs is the reason for the discrepancy. I'll see if I can trace what information kodi is using, compared to the information omxplayer is using. |
Can you try omxplayer with new commit: popcornmix/omxplayer@89c4b16 |
I'm not sure if this is the right way. First of all, my application uses plain TS, so there's no matroska header to check. Second, the sample I provided was originally plain TS, converted to mkv by ffmpeg for a quick test with omxplayer - so the correct parameter must have been inside TS already. In my view, the MPEG2 decoder just reports wrong aspect ratio. |
Can you provide the ts file? |
Sure: www.reufer.ch/temp/aspect.zip |
This will probably need our codec expert (@deborah-c) to comment. Parsing seq->seq.aspect_ratio_information gives 3 which is a DAR of 16:9.
Using seq->vd3_seq.crop_width/seq->vd3_seq.crop_height does give the desired result (seq->vd3_seq.crop_width=720 seq->vd3_seq.crop_height=576). But seq->seq_display_ext.display_horizontal_size = 540 and seq>seq_display_ext.display_vertical_size = 576. The 540 value is suspicious from the stream. Possibly an encoder error, or something I don't understand. However it seems wrong to be using that here. We know the shape we want to the frame to be (16:9). We know how many pixels we will send to host (720x576). Host is going to scale the 720x576 pixels by PAR hoping to get 16:9 out. Using display_horizontal_size (which the host doesn't know about) to determine PAR seems wrong to me. |
Thanks for the detailed analysis. I just checked ffmpeg's parser and display extension is not used at all. Possibly ffmpeg is just too lazy to be fooled by an erroneous stream? |
If you want to test my proposed firmware change, try: |
Looks good - thanks a lot! I haven't seen any side effects so far, but I'll keep testing. |
…ck structures used See: raspberrypi/firmware#496 firmware: audioplus: Remove spurious semi-colon that breaks test mode firmware: vdec3: mpeg2: Don't use display_ext info for calculating PAR See: raspberrypi/firmware#507 firmware: Initial support for setting voltage based on ring osc
I have added this to official firmware and will keep an eye out for any bug reports... |
Okay to close this issue? |
Sure, I haven't seen any side effects. Thanks a lot! |
I'm afraid I found a stream where your solution does not work: The decoder reports pixel aspect ratio of 16/15, however it's a 16:9 video. I'd appreciate if you could have a look at it. Thanks a lot! |
…ck structures used See: raspberrypi#496 firmware: audioplus: Remove spurious semi-colon that breaks test mode firmware: vdec3: mpeg2: Don't use display_ext info for calculating PAR See: raspberrypi#507 firmware: Initial support for setting voltage based on ring osc
@reufer Is this still an issue? Was it a faulty stream? |
I haven't tested recently, but you'll find the stream some lines above. I don't think the stream is faulty, as far as I remember, ffmpeg reported correct dimensions. |
I can look at this (and the other decoder-related issues) after
Christmas, assuming Eben would still like me to. Please drop me an
email!
Deborah
…------ Original Message ------
From: "reufer" <[email protected]>
To: "raspberrypi/firmware" <[email protected]>
Cc: "deborah-c" <[email protected]>; "Mention"
<[email protected]>
Sent: 21/12/2017 15:37:01
Subject: Re: [raspberrypi/firmware] Video decoder detects wrong pixel
aspect ratio (#507)
I haven't tested recently, but you'll find the stream some lines above
<#507 (comment)>.
I don't think the stream is faulty, as far as I remember, ffmpeg
reported correct dimensions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#507 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHcVaIyhkfA0CR6uE_sTvUd_IizojVahks5tCnsdgaJpZM4GrXRP>.
|
I have some SD-MPEG2 streams with 16.9 aspect ratio. VLC plays them fine and ffmpeg reports correct dimensions:
However, omxplayer detects a curious pixel aspect ratio of 64/27 and thus shrinks the video vertically:
Do you have an explanation for this? I've uploaded a sample here: www.reufer.ch/temp/aspect.mkv
The text was updated successfully, but these errors were encountered: