[Cin] Set stream sample aspect ratio in ffmpeg.C

Andrew Randrianasulu randrianasulu at gmail.com
Sun Jan 7 13:07:11 CET 2024


вс, 7 янв. 2024 г., 14:48 Terje J. Hanssen <terjejhanssen at gmail.com>:

>
> Den 06.01.2024 20:42, skrev Phyllis Smith:
>
> Applied the 3 patches and still a problem playing DVD on LG device which
> previously worked.  Not to be difficult, but if we break DVD/Bluray disc
> creation, it will probably never work again and I use it frequently.
>
> CinGG is never going to be perfect but it has been working this way for a
> long time and it has been usable, even if the DAR is not always right.
> There must be another way to reset that if needed.  But I will keep testing.
>
> I think right now we have issues with ffmpeg internals (libavformat) not
>> quite happy with stream (container) level SAR being set ... it breaks our
>> custom dvd/bluray encoding, as discovered by Phyllis.
>>
>> I am looking into this and audio bug but so far no solution for
>> either,sorry.
>>
>>>
>>>
>>>
> Yes, even that DVD and Blu-ray video discs are lesser usual than
> previously, I agree we have to keep this features working in CinGG.
> I guess it is the autoplay function that may not work, and that a wrong
> aspect ratio video disc format possibly can be seen as data discs(?)
>
> Phyllis, have  you tried if possibly VLC's Media> Open Disc can playback
> the DVD or BD video format?
>
> As I said, also at the icon level in Gnome File manager, it it possible to
> see that the CinGG rendered webm files are visually squeezed horizontally,
> compared with the correct format muxed with FFmpeg 6.0:
> easy to see the difference between 4:3 sqeezed webm vs 16:9 wide from
> (HDV) wide format.
>
> In VLC these files are loaded squeezed as default, but it can be easily
> corrected with VLC's Videol > Aspect Ratio and select 4:3 for webm from SD
> DV sources and 16:9 for webm from HDV 1080i files.
>
>
> Not to repeat myself, but below is a condensed output from how Mediainfo
> and FFprobe detect the aspect ratios of my tested SD and HDV sources and
> webm files:
>
> Source SD DV:
> -------------
> mediainfo dv01_07.dv | grep Display
>     Display aspect ratio                     : 4:3
> ffprobe -hide_banner dv01_07.dv
>       Stream #0:0: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR 4:3],
> 25000 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
>
> FFmpeg 6.0 webm:
> mediainfo dv01_07_svt-av1_pr10.webm | grep Display
>     Display aspect ratio                     : 4:3
> ffprobe -hide_banner dv01_07_svt-av1_pr10.webm
>   Stream #0:0: Video: av1 (Main), yuv420p(tv), 720x576 [SAR 1:1 DAR 5:4],
> SAR 16:15 DAR 4:3, 25 fps, 25 tbr, 1k tbn, 1k tbc
>

yeah, DV tend to be non-square pixels (slightly). Not sure if we account
for this correctly or not on de/encoding.


> Cin-aom-38_svt webm:
> mediainfo dv01_07_av1_cingg.webm | grep Display
>     Display aspect ratio                     : 5:4
> ffprobe -hide_banner dv01_07_av1_cingg.webm
>   Stream #0:0: Video: av1 (Main), yuv420p(tv, bt470bg/unknown/unknown),
> 720x576 [SAR 1:1 DAR 5:4], 25 fps, 25 tbr, 1k tbn, 1k tbc
>

not sure what happened here, may be you manually changed aspect ratio?



>
> Source HDV:
> -----------
> mediainfo hdv07_05.m2t | grep Display
>     Display aspect ratio                     : 16:9
> ffprobe -hide_banner hdv07_05.m2t
>   Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
> yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25
> fps, 25 tbr, 90k tbn, 50 tbc
>
> FFmpeg webm:
> mediainfo hdv07_05_m2t_svt-av1+opus.webm | grep Display
>     Display aspect ratio                     : 16:9
> ffprobe -hide_banner hdv07_05_m2t_svt-av1+opus.webm
>   Stream #0:0: Video: av1 (Main), yuv420p(tv, bt709), 1440x1080 [SAR 1:1
> DAR 4:3], SAR 4:3 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc
>
> Cin-aom-38_svt webm:
> mediainfo hdv07_05_m2t_cingg_svt-av1+opus.webm | grep Display
> Display aspect ratio                     : 4:3
> ffprobe -hide_banner hdv07_05_m2t_cingg_svt-av1+opus.webm
>   Stream #0:0: Video: av1 (Main), yuv420p(pc, bt709/unknown/unknown),
> 1440x1080 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 1k tbn, 1k tbc
>
>
>
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20240107/9fd77d81/attachment.htm>


More information about the Cin mailing list