Video output callbacks and sample aspect ratio

This forum is about all development around libVLC.
sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Video output callbacks and sample aspect ratio

Postby sherington » 09 Mar 2019 08:50

I've been doing some work with video output callbacks, and everything was fine until I started playing DVDs (well, DVD ISO actually).

The video appeared squashed horizontally which I eventually realised was due to the sample aspect ratio for the DVDs being something other than 1:1 - prior to this every video I played was mp4 or flv or something, and it always looked right so I never considered the SAR.

If I know the SAR I can render the video properly, indeed I have this working hackishly and my DVD ISOs now render with proper scaling.

However... my problem is how to reliably know the correct SAR when I am rendering?

As far as I know the only place the SAR is available is, eventually but not immediately, via libvlc_media_tracks_get. And this is fine, I can deal with that.

But the above is just the background, finally onto my question...

In principle I suppose there could be multiple video tracks. So I'm thinking I should use libvlc_video_get_track to get the current video track identifier, and then use that identifier to get the corresponding video track structure from libvlc_media_tracks_get.

The problem with that idea is there does not seem to be a hard link between that current video track identifier and the id field in the structures returned by libvlc_media_tracks_get. Indeed, in the case of DVD the libvlc_video_get_track returns 224, but 224 is nowhere to be found in the track data returned by libvlc_media_tracks_get.

I can't just assume and get always get the first video track and use the SAR from that, since other media may well multiple video tracks presumably with different SAR.

So how am I supposed to reliably, for all media types, find the correct SAR to use to render the video, for the currently selected video track, using these callbacks?

Rémi Denis-Courmont
Developer
Developer
Posts: 15229
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Video output callbacks and sample aspect ratio

Postby Rémi Denis-Courmont » 09 Mar 2019 20:44

Lack of mapping between ES and render is a known issue.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: alexsher and 12 guests