Set stream sample aspect ratio in ffmpeg.C
Now it seems to display correct (16/9) DAR for sample encoded directly from hdv. (but for speed I tested vp8/webm, not av1/webm)
Thanks for putting this in its own thread otherwise I would have missed it. Will test tomorrow when I boot my standard laptop. On Sat, Dec 30, 2023 at 10:31 AM Andrew Randrianasulu < [email protected]> wrote:
Now it seems to display correct (16/9) DAR for sample encoded directly from hdv. (but for speed I tested vp8/webm, not av1/webm)
Bummer, although this does fix the 1 problem as discovered by Terje, it breaks Bluray and DVD creation. You can easily see this without having a bluray writer simply with these steps: 1) load video with audio which in my case was 1440x1080 (from a sony camera) 2) pulldown Settings/Format and switch to HDV 1080/25 3) pulldown File and select bd_render Error is: FFMPEG::encode_activate: write header failed /tmp/bd_20240104-164102/bd.m2ts err: Invalid argument In DVD creation, it does create the DVD without erring out, but the DVD will not even load on an LG DVD/Bluray device hooked up to the TV. It plays on the Samsung UHD but hangs on 1 part towards the end. The patch probably has other unknown ramifications that I have not found. Neither HV or CV have an existing "ffmpeg.C" file in the cinelerra subdirectory for comparison. On Sat, Dec 30, 2023 at 10:31 AM Andrew Randrianasulu < [email protected]> wrote:
Now it seems to display correct (16/9) DAR for sample encoded directly from hdv. (but for speed I tested vp8/webm, not av1/webm)
пт, 5 янв. 2024 г., 02:53 Phyllis Smith <[email protected]>:
Bummer, although this does fix the 1 problem as discovered by Terje, it breaks Bluray and DVD creation. You can easily see this without having a bluray writer simply with these steps: 1) load video with audio which in my case was 1440x1080 (from a sony camera) 2) pulldown Settings/Format and switch to HDV 1080/25 3) pulldown File and select bd_render
Error is: FFMPEG::encode_activate: write header failed /tmp/bd_20240104-164102/bd.m2ts err: Invalid argument
In DVD creation, it does create the DVD without erring out, but the DVD will not even load on an LG DVD/Bluray device hooked up to the TV. It plays on the Samsung UHD but hangs on 1 part towards the end.
So, I guess it should not be applied for at least m2ts and mpeg2 containers ..... I'll try to limit it only to mov/mp4/mkv/webm .
The patch probably has other unknown ramifications that I have not found. Neither HV or CV have an existing "ffmpeg.C" file in the cinelerra subdirectory for comparison.
On Sat, Dec 30, 2023 at 10:31 AM Andrew Randrianasulu < [email protected]> wrote:
Now it seems to display correct (16/9) DAR for sample encoded directly from hdv. (but for speed I tested vp8/webm, not av1/webm)
пт, 5 янв. 2024 г., 02:59 Andrew Randrianasulu <[email protected]>:
пт, 5 янв. 2024 г., 02:53 Phyllis Smith <[email protected]>:
Bummer, although this does fix the 1 problem as discovered by Terje, it breaks Bluray and DVD creation. You can easily see this without having a bluray writer simply with these steps: 1) load video with audio which in my case was 1440x1080 (from a sony camera) 2) pulldown Settings/Format and switch to HDV 1080/25 3) pulldown File and select bd_render
Error is: FFMPEG::encode_activate: write header failed /tmp/bd_20240104-164102/bd.m2ts err: Invalid argument
To be honest it errs out for me even without my patch? FFMPEG::encode_activate: write header failed /data/data/com.termux/files/home/tmp/bd_20240105-035457/bd.m2ts err: Math result not representable for 1440*1080 hdv sample without setting format first (it sets itself on media autoload) and using default bd render params (1440*1080, 25i)
In DVD creation, it does create the DVD without erring out, but the DVD will not even load on an LG DVD/Bluray device hooked up to the TV. It plays on the Samsung UHD but hangs on 1 part towards the end.
So, I guess it should not be applied for at least m2ts and mpeg2 containers ..... I'll try to limit it only to mov/mp4/mkv/webm .
The patch probably has other unknown ramifications that I have not found. Neither HV or CV have an existing "ffmpeg.C" file in the cinelerra subdirectory for comparison.
On Sat, Dec 30, 2023 at 10:31 AM Andrew Randrianasulu < [email protected]> wrote:
Now it seems to display correct (16/9) DAR for sample encoded directly from hdv. (but for speed I tested vp8/webm, not av1/webm)
On Fri, Jan 5, 2024 at 3:59 AM Andrew Randrianasulu <[email protected]> wrote:
пт, 5 янв. 2024 г., 02:59 Andrew Randrianasulu <[email protected]>:
пт, 5 янв. 2024 г., 02:53 Phyllis Smith <[email protected]>:
Bummer, although this does fix the 1 problem as discovered by Terje, it breaks Bluray and DVD creation. You can easily see this without having a bluray writer simply with these steps: 1) load video with audio which in my case was 1440x1080 (from a sony camera) 2) pulldown Settings/Format and switch to HDV 1080/25 3) pulldown File and select bd_render
Error is: FFMPEG::encode_activate: write header failed /tmp/bd_20240104-164102/bd.m2ts err: Invalid argument
To be honest it errs out for me even without my patch?
FFMPEG::encode_activate: write header failed /data/data/com.termux/files/home/tmp/bd_20240105-035457/bd.m2ts err: Math result not representable
for 1440*1080 hdv sample without setting format first (it sets itself on media autoload) and using default bd render params (1440*1080, 25i)
ah, it was due to using system (unpatched) ffmpeg! Try this series instead, it guards setting stream sample aspect ratio only to muxers supporting it (I grep in libavformat for sample_sapect) I tested avi, qt, y4m, matroska
In DVD creation, it does create the DVD without erring out, but the DVD will not even load on an LG DVD/Bluray device hooked up to the TV. It plays on the Samsung UHD but hangs on 1 part towards the end.
So, I guess it should not be applied for at least m2ts and mpeg2 containers ..... I'll try to limit it only to mov/mp4/mkv/webm .
The patch probably has other unknown ramifications that I have not found. Neither HV or CV have an existing "ffmpeg.C" file in the cinelerra subdirectory for comparison.
On Sat, Dec 30, 2023 at 10:31 AM Andrew Randrianasulu <[email protected]> wrote:
Now it seems to display correct (16/9) DAR for sample encoded directly from hdv. (but for speed I tested vp8/webm, not av1/webm)
Den 05.01.2024 02:58, skrev Andrew Randrianasulu:
On Fri, Jan 5, 2024 at 3:59 AM Andrew Randrianasulu <[email protected]> wrote:
пт, 5 янв. 2024 г., 02:59 Andrew Randrianasulu <[email protected]>:
пт, 5 янв. 2024 г., 02:53 Phyllis Smith <[email protected]>:
Bummer, although this does fix the 1 problem as discovered by Terje, it breaks Bluray and DVD creation. You can easily see this without having a bluray writer simply with these steps: 1) load video with audio which in my case was 1440x1080 (from a sony camera) 2) pulldown Settings/Format and switch to HDV 1080/25 3) pulldown File and select bd_render
Error is: FFMPEG::encode_activate: write header failed /tmp/bd_20240104-164102/bd.m2ts err: Invalid argument
To be honest it errs out for me even without my patch?
FFMPEG::encode_activate: write header failed /data/data/com.termux/files/home/tmp/bd_20240105-035457/bd.m2ts err: Math result not representable
for 1440*1080 hdv sample without setting format first (it sets itself on media autoload) and using default bd render params (1440*1080, 25i)
ah, it was due to using system (unpatched) ffmpeg!
Try this series instead, it guards setting stream sample aspect ratio only to muxers supporting it (I grep in libavformat for sample_sapect)
I tested avi, qt, y4m, matroska
In DVD creation, it does create the DVD without erring out, but the DVD will not even load on an LG DVD/Bluray device hooked up to the TV. It plays on the Samsung UHD but hangs on 1 part towards the end.
So, I guess it should not be applied for at least m2ts and mpeg2 containers ..... I'll try to limit it only to mov/mp4/mkv/webm .
The patch probably has other unknown ramifications that I have not found. Neither HV or CV have an existing "ffmpeg.C" file in the cinelerra subdirectory for comparison.
On Sat, Dec 30, 2023 at 10:31 AM Andrew Randrianasulu <[email protected]> wrote:
Now it seems to display correct (16/9) DAR for sample encoded directly from hdv. (but for speed I tested vp8/webm, not av1/webm)
I have not tested it and don't know how this works. But shouldn't it in principle keep or preserve the HDV 1080i "anamorphic flag" so players detect to stretch it horizontally to DAR 16:9? This also due to the fact that the HDV videopart should be possible to copy directly to BD without rendering (or similar if downscaling to a DV(D) anamorphic widescreen format).
Den 05.01.2024 16:19, skrev Terje J. Hanssen:
Den 05.01.2024 02:58, skrev Andrew Randrianasulu:
On Fri, Jan 5, 2024 at 3:59 AM Andrew Randrianasulu <[email protected]> wrote:
пт, 5 янв. 2024 г., 02:59 Andrew Randrianasulu <[email protected]>:
пт, 5 янв. 2024 г., 02:53 Phyllis Smith <[email protected]>:
Bummer, although this does fix the 1 problem as discovered by Terje, it breaks Bluray and DVD creation. You can easily see this without having a bluray writer simply with these steps: 1) load video with audio which in my case was 1440x1080 (from a sony camera) 2) pulldown Settings/Format and switch to HDV 1080/25 3) pulldown File and select bd_render
Error is: FFMPEG::encode_activate: write header failed /tmp/bd_20240104-164102/bd.m2ts err: Invalid argument
To be honest it errs out for me even without my patch?
FFMPEG::encode_activate: write header failed /data/data/com.termux/files/home/tmp/bd_20240105-035457/bd.m2ts err: Math result not representable
for 1440*1080 hdv sample without setting format first (it sets itself on media autoload) and using default bd render params (1440*1080, 25i)
ah, it was due to using system (unpatched) ffmpeg!
Try this series instead, it guards setting stream sample aspect ratio only to muxers supporting it (I grep in libavformat for sample_sapect)
I tested avi, qt, y4m, matroska
In DVD creation, it does create the DVD without erring out, but the DVD will not even load on an LG DVD/Bluray device hooked up to the TV. It plays on the Samsung UHD but hangs on 1 part towards the end.
So, I guess it should not be applied for at least m2ts and mpeg2 containers ..... I'll try to limit it only to mov/mp4/mkv/webm .
The patch probably has other unknown ramifications that I have not found. Neither HV or CV have an existing "ffmpeg.C" file in the cinelerra subdirectory for comparison.
On Sat, Dec 30, 2023 at 10:31 AM Andrew Randrianasulu <[email protected]> wrote:
Now it seems to display correct (16/9) DAR for sample encoded directly from hdv. (but for speed I tested vp8/webm, not av1/webm)
I have not tested it and don't know how this works. But shouldn't it in principle keep or preserve the HDV 1080i "anamorphic flag" so players detect to stretch it horizontally to DAR 16:9? This also due to the fact that the HDV videopart should be possible to copy directly to BD without rendering (or similar if downscaling to a DV(D) anamorphic widescreen format).
This technical primer is one of the better I've seen about "Aspect Ratio and Digital Video". And I noted especially the last section "Best practices when working with anamorphic video" http://www.miraizon.com/support/info_aspectratio.html
сб, 6 янв. 2024 г., 03:24 Terje J. Hanssen <[email protected]>:
Den 05.01.2024 16:19, skrev Terje J. Hanssen:
Den 05.01.2024 02:58, skrev Andrew Randrianasulu:
On Fri, Jan 5, 2024 at 3:59 AM Andrew Randrianasulu <[email protected]> wrote:
пт, 5 янв. 2024 г., 02:59 Andrew Randrianasulu <[email protected]>:
пт, 5 янв. 2024 г., 02:53 Phyllis Smith <[email protected]>:
Bummer, although this does fix the 1 problem as discovered by Terje, it breaks Bluray and DVD creation. You can easily see this without having a bluray writer simply with these steps: 1) load video with audio which in my case was 1440x1080 (from a sony camera) 2) pulldown Settings/Format and switch to HDV 1080/25 3) pulldown File and select bd_render
Error is: FFMPEG::encode_activate: write header failed /tmp/bd_20240104-164102/bd.m2ts err: Invalid argument
To be honest it errs out for me even without my patch?
FFMPEG::encode_activate: write header failed /data/data/com.termux/files/home/tmp/bd_20240105-035457/bd.m2ts err: Math result not representable
for 1440*1080 hdv sample without setting format first (it sets itself on media autoload) and using default bd render params (1440*1080, 25i)
ah, it was due to using system (unpatched) ffmpeg!
Try this series instead, it guards setting stream sample aspect ratio only to muxers supporting it (I grep in libavformat for sample_sapect)
I tested avi, qt, y4m, matroska
In DVD creation, it does create the DVD without erring out, but the DVD will not even load on an LG DVD/Bluray device hooked up to the TV. It plays on the Samsung UHD but hangs on 1 part towards the end.
So, I guess it should not be applied for at least m2ts and mpeg2 containers ..... I'll try to limit it only to mov/mp4/mkv/webm .
The patch probably has other unknown ramifications that I have not found. Neither HV or CV have an existing "ffmpeg.C" file in the cinelerra subdirectory for comparison.
On Sat, Dec 30, 2023 at 10:31 AM Andrew Randrianasulu <[email protected]> wrote: > Now it seems to display correct (16/9) DAR for sample encoded > directly from hdv. (but for speed I tested vp8/webm, not av1/webm) > >
I have not tested it and don't know how this works. But shouldn't it in principle keep or preserve the HDV 1080i "anamorphic flag" so players detect to stretch it horizontally to DAR 16:9? This also due to the fact that the HDV videopart should be possible to copy directly to BD without rendering (or similar if downscaling to a DV(D) anamorphic widescreen format).
This technical primer is one of the better I've seen about "Aspect Ratio and Digital Video". And I noted especially the last section "Best practices when working with anamorphic video" http://www.miraizon.com/support/info_aspectratio.html
yeah, thanks. 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.
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.
I got duped! I think the 3 patches are really working BUT I have been rewriting on rewritable media and it looks like previously writing a bad set causes problems if you then write a good one on the same DVD media. Let me start all over again tomorrow morning when I have a fresh brain. Sorry, I never suspected the media. On Sat, Jan 6, 2024 at 12:42 PM Phyllis Smith <[email protected]> wrote:
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.
вс, 7 янв. 2024 г., 03:37 Phyllis Smith <[email protected]>:
I got duped! I think the 3 patches are really working BUT I have been rewriting on rewritable media and it looks like previously writing a bad set causes problems if you then write a good one on the same DVD media. Let me start all over again tomorrow morning when I have a fresh brain.
Sorry, I never suspected the media.
well, it probably depend on power/speed of burning and quality of laser/firmware in player ... I hope someday there will be open hw dvd simulator, so it will be more obvious what different components do. Just for lulz you probably can try rpcs3 (playstation 3 emulator) and see if it can do anything with dvd video iso files. In theory even ps2 was able to play vid dvd, but not sure if ps2 emulator advanced enough for this non-game task (cd formats were many, with different sector sizes,subchannel info, etc. dvd was 'simpler' but not dead simple ...)
On Sat, Jan 6, 2024 at 12:42 PM Phyllis Smith <[email protected]> wrote:
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.
The set of 3 patches appear to be working correctly - at least I verified: 0001-Set-also-sample-aspect-ratio-for-encoded-ffmpeg-stre.patch 0002-Guard-ffmpeg.C-stream-sample-aspect-ratio-only-for-f.patch I have not checked: 0003-fix-guard-for-stream-sample-aspect-ratio-for-more-fm.patch but I will still do so testing too but am sure that Terje is much better qualified to do so. Yesterday, I had to start out with new rewritable discs as I was never able to "blank" the current messed up media to get valid results. Well, I can not blame the media too much as I am sure that I wrote over them hundreds of time in the last 8 or so years !!! I got duped! I think the 3 patches are really working BUT I have been
rewriting on rewritable media and it looks like previously writing a bad set causes problems if you then write a good one on the same DVD media. Let me start all over again tomorrow morning when I have a fresh brain.
Sorry, I never suspected the media.
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 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 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
вс, 7 янв. 2024 г., 14:48 Terje J. Hanssen <[email protected]>:
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
Den 07.01.2024 13:07, skrev Andrew Randrianasulu:
вс, 7 янв. 2024 г., 14:48 Terje J. Hanssen <[email protected]>:
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?
Repeated and controlled Cin-aom-38_svt webm rendering test of PAL SD-DV source: ------------------------------------------------------------------------------- According to Cinelerra-GG Quick Start Guide, section 4 – Choose Output Format You can skip this step if you want the format of your output to be the same as your input. Loaded dv01_07.dv Settings > Format | Preset: PAL 576i DV(D) Settings > Preference > Appearance | YUV color space: BT601 PAL The compositor image was seemingly correct ~DAR 4:3 Rendered 2832 frames in 27.481 secs: 103.053 fps ! mediainfo dv01_07_cingg_svt-av1+opus.webm | grep Display Display aspect ratio : 5:4 ffprobe -hide_banner dv01_07_cingg_svt-av1+opus.webm Stream #0:0: Video: av1 (Main), yuv420p(pc, bt470bg/unknown/unknown), 720x576, SAR 1:1 DAR 5:4, 25 fps, 25 tbr, 1k tbn Loaded dv01_07_cingg_svt-av1+opus.webm in VLC, the default DAR was seemingly ~square (squeezed). Changed it manually to 4:3 via menu.
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
Checked the result of these 3 patches into GIT just now. I did delete the line "printf("ofmt name %s \n", format_name);" as it seemed to be for debugging only and we don't want to add any unnecessary information on the startup window so important stuff does not get buried.
Try this series instead, it guards setting stream sample aspect ratio only to muxers supporting it
participants (3)
-
Andrew Randrianasulu -
Phyllis Smith -
Terje J. Hanssen