Skip to content
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

Change of aspect ratio during playback is not detected #117

Open
sphr2k opened this issue Jan 20, 2017 · 15 comments
Open

Change of aspect ratio during playback is not detected #117

sphr2k opened this issue Jan 20, 2017 · 15 comments
Labels

Comments

@sphr2k
Copy link

sphr2k commented Jan 20, 2017

(minor issue for the sake of completeness - might also be a limitation of ExoPlayer)

Change of aspect ration during playback is not detected, i.e. when watching a 16:9 programme and a subsequent broadcast is in 4:3, the picture will get stretched and the AR indicator on the info bar still says "16:9". I guess it's the same the other way around (4:3 -> 16:9). Switching channels or stopping and restarting playback will fix this, so in general, aspect ratio detection is working fine.

@kiall
Copy link
Owner

kiall commented Jan 20, 2017

I'd hazard a guess ExoPlayer is telling us about this, and we're just not acting on it.

The problem is, I have no clue where it might be doing that!

Does this happen often on any of your channels? I don't think I've ever seen it on FreeSat or Saorview channels in Ireland. Any chance you would be able to grab some logs as it happens?

@kiall kiall added the bug label Jan 20, 2017
@sphr2k
Copy link
Author

sphr2k commented Jan 20, 2017

Might take a bit because 4:3 broadcasts are not very common these days, but I'll try to catch one. I just set up adb for my Shield TV. Will I get the relevant information by running "adb logcat" while using Live Channels?

@kiall
Copy link
Owner

kiall commented Jan 20, 2017

Yea, adb logcat will spew out logs from all the things running on the system.

If you running it from a Mac or Linux machine, use adb logcat | grep tvheadend to filter out everything but this app. Once you see it happen, copy and paste the output to a text file

kiall added a commit that referenced this issue Jan 20, 2017
@kiall
Copy link
Owner

kiall commented Jan 20, 2017

^ change might just log this info clearly, but I suspect it's not applicable for this particular case.

@kiall
Copy link
Owner

kiall commented Mar 10, 2017

If anyone can capture this as it happens, that would be much appreciated! https://github.com/kiall/android-tvheadend/wiki/Muxdump

@lsiudut
Copy link

lsiudut commented Apr 29, 2017

Got one.
aspect-change.zip

@kiall
Copy link
Owner

kiall commented Apr 30, 2017

@lsiudut excellent! I don't even want to know how many attempts it took to get that :)

@lsiudut
Copy link

lsiudut commented Apr 30, 2017

@kiall none, I just left stream dump and cut relevant part later :) . Happy to help.

@sphr2k
Copy link
Author

sphr2k commented Apr 30, 2017

@lsiudut Thanks a lot for providing the sample - I meant to follow-up on this but hadn't gotten around to it yet.

@kiall
Copy link
Owner

kiall commented Apr 30, 2017

@lsiudut how big is the original file before curring? and if it's too big to send, could you cut a larger sample? Say 30 seconds before and 30 seconds after the switch?

@lsiudut
Copy link

lsiudut commented Apr 30, 2017

@kiall sure, here it is https://www.dropbox.com/s/i5ikhgasf3s0s25/aspect-change.ts.gz?dl=0 . Original file is huge, obviously.

Btw you could forge file like this by yourself. It's enough to concatenate two files with same resolution and different aspect ratio. Information about it is help in context metadata, in ffmpeg world it is:

frame->sample_aspect_ratio.num
frame->sample_aspect_ratio.den

@kiall
Copy link
Owner

kiall commented Apr 30, 2017

Thanks! Past experience tells me forging files tends to mean I'm not actually testing the thing I wanted to ;)

So - Interesting, what's chaning here is the display aspect ratio, rather than the resolution (which you hinted at earlier but it didn't click with me until I saw it)..

First video frame info:

[FRAME]
media_type=video
stream_index=0
key_frame=1
pkt_pts=198922
pkt_pts_time=2.210244
pkt_dts=200722
pkt_dts_time=2.230244
best_effort_timestamp=198922
best_effort_timestamp_time=2.210244
pkt_duration=1800
pkt_duration_time=0.020000
pkt_pos=19740
pkt_size=29874
width=720
height=576
pix_fmt=yuv420p
sample_aspect_ratio=16:11
pict_type=P
coded_picture_number=0
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
[/FRAME]

Last video frame info:

[FRAME]
media_type=video
stream_index=0
key_frame=0
pkt_pts=5541322
pkt_pts_time=61.570244
pkt_dts=N/A
pkt_dts_time=N/A
best_effort_timestamp=5541322
best_effort_timestamp_time=61.570244
pkt_duration=1800
pkt_duration_time=0.020000
pkt_pos=21956520
pkt_size=22325
width=720
height=576
pix_fmt=yuv420p
sample_aspect_ratio=12:11
pict_type=P
coded_picture_number=1481
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
[/FRAME]

@lsiudut
Copy link

lsiudut commented Apr 30, 2017

Yep. Resolution of stream can not change. Afaik most common approach is to send stream in 4:3 format and change aspect to reflect 16:9. It scales well and drop in quality is almost not noticable.

@kiall
Copy link
Owner

kiall commented Apr 30, 2017

So - This looks like something that needs to be implemented or fixed within ExoPlayer. It's not currently detecting the change in aspect ratio, in contract to how it detects changes to audio channel layout changes (e.g. from 5.1 -> 2.0 and back again during ad breaks).

For my own reference later, I pushed a change to ExoPlayer to display the PAR
when the debug view is enabled.. I can see 5.1 -> 2.0 switches are detected, but not PAR changes.. google/ExoPlayer#2756.

I'll gather what info I can and file an issue with ExoPlayer to see if they have any suggestions etcs.

@girlpunk
Copy link
Contributor

I'm not entirely sure, but I think I saw the same thing using VLC to play a tvh stream the other day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants