VideoHelp Forum
+ Reply to Thread
Page 1 of 4
1 2 3 ... LastLast
Results 1 to 30 of 96
Thread
  1. Hello.

    So I've been burning a DVD for the band I filmed and in AVS during the video encoding ffmpeg uses an incorrect SAR value of 64:45 for DAR of 16:9, which is an incorrect value, as 64:45 = 1,42222..., the correct value for Sample Aspect Ratio widescreen PAL is 512:351= 1,458689...
    Is there an option to remedy that in AVS interface so that ffmpeg is corrected?
    Quote Quote  
  2. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Read this:


    https://en.wikipedia.org/wiki/Pixel_aspect_ratio


    There is no such thing as 'Sample Aspect Ratio' SAR stands for Storage Aspect Ratio which is almost always 720*576 for PAL DVD. So maybe you mean Pixel Aspect Ratio and the table quoted confirms that 64:45 is correct for 16:9 PAL.


    You can not do a simple division because dvd pixels are non-square.
    Quote Quote  
  3. Originally Posted by DB83 View Post
    There is no such thing as 'Sample Aspect Ratio' SAR stands for Storage Aspect Ratio which is almost always 720*576 for PAL DVD. So maybe you mean Pixel Aspect Ratio and the table quoted confirms that 64:45 is correct for 16:9 PAL.

    ffmpeg uses the term SAR - Sample Aspect Ratio for the Pixel Aspect Ratio, not Storage Aspect Ratio.

    The table on wikipedia is wrong, because it was made by morons who has no idea how SD video works and 64:45 is not correct.
    Would you like a long, or a short story why?

    Yes, the video on DVD is 720x576 ans yes pixels are not square, but their width/height ratio is not 64:45.
    Beside, your comment does not answer my question.

    This page has correct informations:
    https://bjohas.de/wiki/Tutorials/Video/Pixel_Aspect_Ratio

    The "NLE" values do not conform to the SD video stanadrds desctibed in REC.470 and 601, also proper NLEs use proper values, such as Vegas Pro, somehow it is able to use proper Pixel Aspect Ratio, unfortunately ffmpeg can't.

    Also, if you dig deep enough, the ITU-R documents use the term Sample, not Pixel.
    Last edited by SF01; 24th Aug 2020 at 09:48. Reason: Additional info, so as not to double post.
    Quote Quote  
  4. If you are encoding to mpeg2 you can use a video filter in a ffmpeg commandline:
    ffmpeg -i inputvideo -vf setsar=1:1 -aspect 16:9 -c:v mpeg2video -b:v 6000k -an output.mpg

    If you already have your mpg video, you can change the display aspect ratio (DAR) with DVD Patcher without recoding.

    Read also this discussion:
    https://forums.whirlpool.net.au/thread/1470507#r13
    Last edited by ProWo; 24th Aug 2020 at 10:27.
    Quote Quote  
  5. The project is done through AVS2DVD, because the ffmpeg encodes incorrect pixel aspect ratio I have to first render the project to a DV file and then put it into AVS.
    Is there an option in AVS to override ffmpeg settings or put additional command line parameters?
    The AVS goes straight into DVD folder structure, ISO, or DVD. To change parameters I would have to stop before the muxing is completed, so basically encode the fiels manually, mux manually and then burn the DVD.

    Is there an option to inclde cropping information to the DVD stream? So that the media players will properly stretch the image and then crop the blanking at the edges?
    Quote Quote  
  6. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    If you have an issue with avstodvd then raise the matter in the support thread in these forums.


    Unfortunately I am a moron so I, most of the time, believe what I read at wiki.


    So 720 / 45 * 64 = 1024 / 16 * 9 = 576
    Quote Quote  
  7. Originally Posted by DB83 View Post
    Unfortunately I am a moron so I, most of the time, believe what I read at wiki.


    So 720 / 45 * 64 = 1024 / 16 * 9 = 576
    The true moron does not recognize that he's a moron.

    The problem is it's not thw whole 720 pixels that store video information, or at least should according to REC.601. In Pal only the 702 pixels carry video signal, while in NTSC it's 704.

    So 702 / 351 * 512 = 1024, 1024 / 16 * 9 = 576
    Similar calculations regard 4:3 and NTSC.
    The link I privided goes more in depth than wikipedia, which in many places displays inaccurate informationaand sometimes even straight false.
    Quote Quote  
  8. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Well always looking to expand on my miniscule knowledge I did read the article you linked to - the one with the 'correct' information.


    Reminds me to visit the optician given the last line in the quoted table.


    Might also want to read the 'what is' link at top of page. The relevant line there is:


    "16:9 Anamorphic (only supported by 720x576)"
    Quote Quote  
  9. I don't have the DVD spec. But someone who did once posted here and said that the DVD spec refers to the MPEG 2 spec for aspect ratio information. Only two of the four MPEG 2 aspect ratios are valid for DVD: 4:3 and 16:9 (the other two are 2.25:1 DAR and 1:1 SAR). MPEG 2 video doesn't indicate the sampling aspect ratio directly, it indicates only the display aspect ratio. And it clearly states that the entire frame constitutes the DAR, not a 704x480 or 702x576 portion thereof. So the MPEG 2 spec indicates (indirectly) the SAR (sample aspect ratio) for a 720x576 16:9 frame is 64:45. That is at odds with the ITU spec for digitizing analog 16:9 SD video where the SAR is approximated as 16:11 (assumes a 704x576 frame), or 512:351 (assumes a 702x576 frame -- more accurate).

    So AVS2DVD and ffmpeg are using the correct SAR as specified by the MPEG 2 spec.

    In my experience, most DVDs made by digitizing analog tape sources just take the full 720x576 ITU frame and write it to the DVD, ignoring the difference between the ITU and MPEG 2 specs. If you have such a DVD you can fix it yourself by cropping, resizing, and/or forcing the SAR.
    Quote Quote  
  10. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    If you have such a DVD you can fix it yourself by cropping, resizing, and/or forcing the SAR.
    AVStoDVD provides access to the Avisynth script in case you want to do your own cropping/add borders,
    also the ability to modify the command line
    Image Attached Thumbnails Click image for larger version

Name:	a2d.jpg
Views:	92
Size:	139.7 KB
ID:	54634  

    Quote Quote  
  11. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    One other thing about avstodvd. If you input dvd-compliant video then you can set a flag in the program not to re-encode it. So while 702*576 might be PAL-compliant it is not dvd-compliant. Only 704*576 is. And regardless of that if you input DV you are not inputting compliant video so the program must re-encode. And since 702|704 * 576 are not valid for 16:9 dvd the program inevitably will add borders to the frame to come back to the 720*576 you might have started with (you can check that by reading the avisynth script that avstodvd creates internally.


    But what do I know ?
    Quote Quote  
  12. Originally Posted by jagabo View Post
    I don't have the DVD spec. But someone who did once posted here and said that the DVD spec refers to the MPEG 2 spec for aspect ratio information. Only two of the four MPEG 2 aspect ratios are valid for DVD: 4:3 and 16:9 (the other two are 2.25:1 DAR and 1:1 SAR). MPEG 2 video doesn't indicate the sampling aspect ratio directly, it indicates only the display aspect ratio. And it clearly states that the entire frame constitutes the DAR, not a 704x480 or 702x576 portion thereof. So the MPEG 2 spec indicates (indirectly) the SAR (sample aspect ratio) for a 720x576 16:9 frame is 64:45. That is at odds with the ITU spec for digitizing analog 16:9 SD video where the SAR is approximated as 16:11 (assumes a 704x576 frame), or 512:351 (assumes a 702x576 frame -- more accurate).

    So AVS2DVD and ffmpeg are using the correct SAR as specified by the MPEG 2 spec.

    In my experience, most DVDs made by digitizing analog tape sources just take the full 720x576 ITU frame and write it to the DVD, ignoring the difference between the ITU and MPEG 2 specs. If you have such a DVD you can fix it yourself by cropping, resizing, and/or forcing the SAR.
    Yes and no, because upon playback via analog video connectors the 720 pixels are transmitted correctly according to ITU as 53,333 µs line, so only when the Pixel Aspect ratio is correct and the active image is contained in 702 pixels those will constitute the 52 µs as specified in ITU documents.

    The problem is with playback on PC though, as prgrams will treat the 720 pixels as full active image without cropping the digital equivalent of analog blanking.

    The full 720x576 frame made from analog recordings is correct because it has ITU-compliant format of 128:117 Sample Aspect Ratio, because the devices sample (or at least should) the 53,333 µs with 13,5MHz sampling rate resulting in 720 samples, out of those only 702 (52*13,5) contain active image.

    The problem appears when I put a video with different resolution than 720x576, then it needs to be resized and is resized with incorrect (according to ITU) SAR, for example to make a DVD from 1920x1080 video it will be converted to 64:45 SAR, to avoid that I first render it to DV as Vegas supports proper pixel aspect ratios, so it results in added black bars to the sides, when doing the same in avs via ffmpeg it does not happen.

    Therefore for proper playback on PC the encoded SAR should be different than the one resulting from ffmpeg. I have read somewhere, but can't find it, that additional cropping information can be encoded in DVD so it is read during playback on PC so that it cropps the edges and then expands the remaining portion to the desired aspect ratio, but since I can't find it anymore I don't know if I remember it correctly.

    So the solution would be to run the command line and force proper SAR into ffmpeg.
    Quote Quote  
  13. Originally Posted by SF01 View Post
    I have read somewhere, but can't find it, that additional cropping information can be encoded in DVD so it is read during playback on PC so that it cropps the edges and then expands the remaining portion to the desired aspect ratio, but since I can't find it anymore I don't know if I remember it correctly.

    Additional AR information in a MPEG2 stream can be included as sequence_display_extension.

    But not all hardware or software players interpret this information correctly or consistently; and not all software encoders can apply it (ffmpeg cannot). You can patch it afterwards on an elementary stream with restream
    Quote Quote  
  14. Originally Posted by poisondeathray View Post
    Originally Posted by SF01 View Post
    I have read somewhere, but can't find it, that additional cropping information can be encoded in DVD so it is read during playback on PC so that it cropps the edges and then expands the remaining portion to the desired aspect ratio, but since I can't find it anymore I don't know if I remember it correctly.

    Additional AR information in a MPEG2 stream can be included as sequence_display_extension.

    But not all hardware or software players interpret this information correctly or consistently; and not all software encoders can apply it (ffmpeg cannot). You can patch it afterwards on an elementary stream with restream
    I will experiment with that.

    How should I specify the correct SAR in the command parameters sequence in the AVS? "setsar=128:117", or 512:351, or instead of : I should use /, with - before the pamameter, or not, in which place?
    Quote Quote  
  15. Originally Posted by SF01 View Post
    Originally Posted by jagabo View Post
    I don't have the DVD spec. But someone who did once posted here and said that the DVD spec refers to the MPEG 2 spec for aspect ratio information. Only two of the four MPEG 2 aspect ratios are valid for DVD: 4:3 and 16:9 (the other two are 2.25:1 DAR and 1:1 SAR). MPEG 2 video doesn't indicate the sampling aspect ratio directly, it indicates only the display aspect ratio. And it clearly states that the entire frame constitutes the DAR, not a 704x480 or 702x576 portion thereof. So the MPEG 2 spec indicates (indirectly) the SAR (sample aspect ratio) for a 720x576 16:9 frame is 64:45. That is at odds with the ITU spec for digitizing analog 16:9 SD video where the SAR is approximated as 16:11 (assumes a 704x576 frame), or 512:351 (assumes a 702x576 frame -- more accurate).

    So AVS2DVD and ffmpeg are using the correct SAR as specified by the MPEG 2 spec.

    In my experience, most DVDs made by digitizing analog tape sources just take the full 720x576 ITU frame and write it to the DVD, ignoring the difference between the ITU and MPEG 2 specs. If you have such a DVD you can fix it yourself by cropping, resizing, and/or forcing the SAR.
    Yes and no, because upon playback via analog video connectors the 720 pixels are transmitted correctly according to ITU as 53,333 µs line, so only when the Pixel Aspect ratio is correct and the active image is contained in 702 pixels those will constitute the 52 µs as specified in ITU documents.
    Yes. On the other hand, every upscaling DVD/BD player I've tested upscales the full 720x576/480 frame up to 16:9 on the HDMI output.

    And all the DVD's I've see made directly from film (ie, no from analog tape) use the full 720x576/480 frame as the 4:3 or 16:9 DAR.
    Quote Quote  
  16. Originally Posted by jagabo View Post
    Originally Posted by SF01 View Post
    Originally Posted by jagabo View Post
    I don't have the DVD spec. But someone who did once posted here and said that the DVD spec refers to the MPEG 2 spec for aspect ratio information. Only two of the four MPEG 2 aspect ratios are valid for DVD: 4:3 and 16:9 (the other two are 2.25:1 DAR and 1:1 SAR). MPEG 2 video doesn't indicate the sampling aspect ratio directly, it indicates only the display aspect ratio. And it clearly states that the entire frame constitutes the DAR, not a 704x480 or 702x576 portion thereof. So the MPEG 2 spec indicates (indirectly) the SAR (sample aspect ratio) for a 720x576 16:9 frame is 64:45. That is at odds with the ITU spec for digitizing analog 16:9 SD video where the SAR is approximated as 16:11 (assumes a 704x576 frame), or 512:351 (assumes a 702x576 frame -- more accurate).

    So AVS2DVD and ffmpeg are using the correct SAR as specified by the MPEG 2 spec.

    In my experience, most DVDs made by digitizing analog tape sources just take the full 720x576 ITU frame and write it to the DVD, ignoring the difference between the ITU and MPEG 2 specs. If you have such a DVD you can fix it yourself by cropping, resizing, and/or forcing the SAR.
    Yes and no, because upon playback via analog video connectors the 720 pixels are transmitted correctly according to ITU as 53,333 µs line, so only when the Pixel Aspect ratio is correct and the active image is contained in 702 pixels those will constitute the 52 µs as specified in ITU documents.
    Yes. On the other hand, every upscaling DVD/BD player I've tested upscales the full 720x576/480 frame up to 16:9 on the HDMI output.
    This is a very interesting and at the same time terryfying observation. I wonder if the cropping information could be applied and properly interpreted there.
    Quote Quote  
  17. Originally Posted by jagabo View Post
    Yes. On the other hand, every upscaling DVD/BD player I've tested upscales the full 720x576/480 frame up to 16:9 on the HDMI output.

    And all the DVD's I've see made directly from film (ie, no from analog tape) use the full 720x576/480 frame as the 4:3 or 16:9 DAR.
    My experience is the same as jagabo's

    And 100% correct for every single NTSC Hollywood DVD's - they all use 32:27 instead of 40:33 for 16:9





    Originally Posted by SF01 View Post

    The problem appears when I put a video with different resolution than 720x576, then it needs to be resized and is resized with incorrect (according to ITU) SAR, for example to make a DVD from 1920x1080 video it will be converted to 64:45 SAR, to avoid that I first render it to DV as Vegas supports proper pixel aspect ratios, so it results in added black bars to the sides, when doing the same in avs via ffmpeg it does not happen.

    Therefore for proper playback on PC the encoded SAR should be different than the one resulting from ffmpeg.
    Did you mean direct PC playback on a normal monitor ? Or connected externally to a secondary device or display?

    That is not correct for PC - A 1920x1080 source should use 64:45 for 720x576 full frame size . A 1920x1080 source has a perfect 16:9 DAR.

    16/9 = 720/576 * 64/45

    A PC player should display it as 1024 width 576 height exactly 1024/576 = 16/9 .
    Quote Quote  
  18. Originally Posted by poisondeathray View Post
    Originally Posted by jagabo View Post
    Yes. On the other hand, every upscaling DVD/BD player I've tested upscales the full 720x576/480 frame up to 16:9 on the HDMI output.

    And all the DVD's I've see made directly from film (ie, no from analog tape) use the full 720x576/480 frame as the 4:3 or 16:9 DAR.
    My experience is the same as jagabo's

    And 100% correct for every single NTSC Hollywood DVD's - they all use 32:27 instead of 40:33 for 16:9





    Originally Posted by SF01 View Post

    The problem appears when I put a video with different resolution than 720x576, then it needs to be resized and is resized with incorrect (according to ITU) SAR, for example to make a DVD from 1920x1080 video it will be converted to 64:45 SAR, to avoid that I first render it to DV as Vegas supports proper pixel aspect ratios, so it results in added black bars to the sides, when doing the same in avs via ffmpeg it does not happen.

    Therefore for proper playback on PC the encoded SAR should be different than the one resulting from ffmpeg.
    Did you mean direct PC playback on a normal monitor ? Or connected externally to a secondary device or display?

    That is not correct for PC. A 1920x1080 source should use 64:45 for 720x576 full frame size . A 1920x1080 source has a perfect 16:9 DAR.

    16/9 = 720/576 * 64/45

    A PC player would display it as 1024 width 576 height exactly 1024/576 = 16/9
    1. From what I've read this change occured around 2006.

    2. 1920x1080 should still use 512:351 for 720x576 to be ITU-compliand and this is what I am trying to achieve, though I can't make it happen in the AVS with command line edit. The cropping information allegedly could be used to crop the blanking and then the PC player would display the cropped image with proper aspect ratio as 1024x576.

    The guy here:
    https://superuser.com/questions/1214635/error-while-merging-two-mp4-video-files-with-ffmpeg
    has a file with proper SAR and DAR for ITU compliand SD video, how he got it I don't know.
    Quote Quote  
  19. Originally Posted by SF01 View Post

    1. From what I've read this change occured around 2006.

    2. 1920x1080 should still use 512:351 for 720x576 to be ITU-compliand and this is what I am trying to achieve, though I can't make it happen in the AVS with command line edit. The cropping information allegedly could be used to crop the blanking and then the PC player would display the cropped image with proper aspect ratio as 1024x576.

    The guy here:
    https://superuser.com/questions/1214635/error-while-merging-two-mp4-video-files-with-ffmpeg
    has a file with proper SAR and DAR for ITU compliand SD video, how he got it I don't know.

    A PC does not use ITU or MPEG4 spec aspect ratios. They use AR "generic". ie. They use simple math

    Or are you referring to a specific player or application ?

    What change? Math hasn't changed in >2000 years

    So a 1920x1080 source, would use 720x576 and 64:45
    Quote Quote  
  20. Originally Posted by poisondeathray View Post
    Originally Posted by SF01 View Post

    1. From what I've read this change occured around 2006.

    2. 1920x1080 should still use 512:351 for 720x576 to be ITU-compliand and this is what I am trying to achieve, though I can't make it happen in the AVS with command line edit. The cropping information allegedly could be used to crop the blanking and then the PC player would display the cropped image with proper aspect ratio as 1024x576.

    The guy here:
    https://superuser.com/questions/1214635/error-while-merging-two-mp4-video-files-with-ffmpeg
    has a file with proper SAR and DAR for ITU compliand SD video, how he got it I don't know.

    A PC does not use ITU or MPEG4 spec aspect ratios. They use AR "generic". ie. They use simple math

    Or are you referring to a specific player or application ?

    What change? Math hasn't changed in >2000 years

    So a 1920x1080 source, would use 720x576 and 64:45
    They should, at least via the cropping in all applications.

    The change of SAR encoding on Hollywood DVDs, when they switched from ITU-compliant to the non-compliant values:
    http://forum.doom9.org/archive/index.php/t-158604.html

    To be ITU-compliand 1920x1080 converted to 720x576 should still maintain SAR of 512:351, which is what I require, but can't achieve.

    There is an interesting archive of ffmpeg dev chat:
    https://ffmpeg-devel.ffmpeg.narkive.com/9D1UB5Qi/patch-nvenc-compensate-for-hardware-t...-content#post2, the most interesting bit is:

    Code:
    In other words, it should happen immediately when FFmpeg reads contents that
    is "probably" BT601:
    
    Input stream #0:0: Video: mpeg2video (Main), yuv420p(tv),
    720x576 [SAR 64:45 DAR 16:9]
    
    should be fixed into:
    
    Input stream #0:0: Video: mpeg2video (Main), yuv420p(tv),
    720x576 [SAR 512:351 DAR 640:351]
    
    That way, the laws of geometry and arithmetic are respected, the size of the
    pixels is correct, and it will work will all encoders, not just nvenc.
    Last edited by SF01; 24th Aug 2020 at 14:36.
    Quote Quote  
  21. Originally Posted by SF01 View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by SF01 View Post

    1. From what I've read this change occured around 2006.

    2. 1920x1080 should still use 512:351 for 720x576 to be ITU-compliand and this is what I am trying to achieve, though I can't make it happen in the AVS with command line edit. The cropping information allegedly could be used to crop the blanking and then the PC player would display the cropped image with proper aspect ratio as 1024x576.

    The guy here:
    https://superuser.com/questions/1214635/error-while-merging-two-mp4-video-files-with-ffmpeg
    has a file with proper SAR and DAR for ITU compliand SD video, how he got it I don't know.

    A PC does not use ITU or MPEG4 spec aspect ratios. They use AR "generic". ie. They use simple math

    Or are you referring to a specific player or application ?

    What change? Math hasn't changed in >2000 years

    So a 1920x1080 source, would use 720x576 and 64:45
    They should, at least via the cropping in all applications.

    The change of SAR encoding on Hollywood DVDs, when they switched from ITU-compliant to the non-compliant values:
    http://forum.doom9.org/archive/index.php/t-158604.html

    To be ITU-compliand 1920x1080 converted to 720x576 should still maintain SAR of 512:351, which is what I require, but can't achieve.

    There is an interesting archive of ffmpeg dev chat:
    https://ffmpeg-devel.ffmpeg.narkive.com/9D1UB5Qi/patch-nvenc-compensate-for-hardware-t...-content#post2, the most interesting bit is:

    Code:
    In other words, it should happen immediately when FFmpeg reads contents that
    is "probably" BT601:
    
    Input stream #0:0: Video: mpeg2video (Main), yuv420p(tv),
    720x576 [SAR 64:45 DAR 16:9]
    
    should be fixed into:
    
    Input stream #0:0: Video: mpeg2video (Main), yuv420p(tv),
    720x576 [SAR 512:351 DAR 640:351]
    
    That way, the laws of geometry and arithmetic are respected, the size of the
    pixels is correct, and it will work will all encoders, not just nvenc.


    You're misunderstanding what is being said in that thread.

    A 1920x1080 source uses the full active image area . Don't confuse that with an analog SD PAL source, or some other analog source.

    MPEG2 for DVD only supports 16:9 and 4:3 . Setting the SAR to some other value is not supported . This is not like AVC stream, where almost all players universally accept it . If it were AVC, you could use almost any SAR value and it would work to resize the display. That's not the same thing as crop. The entire frame is resized. AVC supports a crop flag as well, but that is different than SAR . Crop is not the same thing as SAR

    But if it were AVC in MP4 or MKV, you would still use 720x576 and 64:45 for a 1920x1080 source . The geometry is perfect. You can test it yourself. This will display as 1024x576. Perfect. You can test with a perfect circle graphic overlayed in 1920x1080 frame . It works.


    For an MPEG2 stream, sequence_display_extension specifies the active image area that is scaled to 16:9 or 4:3. Functionally it would be like a crop and resize. But not all players (hardware and software) support this. Very few do. I already mentioned ffmpeg cannot do this. restream can patch it, but almost no player will respect it.
    Quote Quote  
  22. Originally Posted by poisondeathray View Post

    You're misunderstanding what is being said in that thread.

    I probably am misunderstanding something, I'm not best at english anyway.

    Originally Posted by poisondeathray View Post

    A 1920x1080 source uses the full active image area . Don't confuse that with an analog SD PAL source, or some other analog source.
    1920x1080 uses full frame yes, but when converting it to SD PAL of 720x576 the SAR should be 512:351, not 64:45 so that it's ITU-compliant.

    Originally Posted by poisondeathray View Post

    MPEG2 for DVD only supports 16:9 and 4:3 . Setting the SAR to some other value is not supported . This is not like AVC stream, where almost all players universally accept it . If it were AVC, you could use almost any SAR value and it would work to resize the display. That's not the same thing as crop. The entire frame is resized. AVC supports a crop flag as well, but that is different than SAR . Crop is not the same thing as SAR
    So the cropping information will occur after the 720x576 frame is expanded to the set aspect ratio of 4:3, or 16:9? It won't work in the manner of first cropping 720 to 702 and then the player will stretch the cropped to 702x576 frame to the set aspect ratio, will it?

    Originally Posted by poisondeathray View Post

    But if it were AVC in MP4 or MKV, you would still use 720x576 and 64:45 for a 1920x1080 source . The geometry is perfect. You can test it yourself. This will display as 1024x576. Perfect.
    But it's completely against REC.601, the mat is there and 720x576 with SAR of 64:45 stretched to 26:9 aspect ratio will produce geometrically correct image (chech the link in post #3), but it is not ITU-compliant and shouldn't be used in applications that must be ITU compliant, otherwise it will produce distorted image.

    Originally Posted by poisondeathray View Post
    For an MPEG2 stream, sequence_display_extension specifies the active image area that is scaled to 16:9 or 4:3. But not all players (hardware and software) support this. Very few do. I already mentioned ffmpeg cannot do this. restream can patch it, but almost no player will respect it.
    So it can be done, therefore the specified active image are ahouls be 702x576 for PAL material which should be stretched to 16:9, or 4:3, well then the software ans hardware should support it. So the solution would be to keep the DAR as is in AVS2DVD ffmpeg, but fix it in restream. I have now started running ffmpeg via AVS2DVD with aspect changed from 4:3 (I am currently transffering VHS to DVD) to 128:117 in the command line SAR and DAR values are displayed as 128:117 and 160:117 respectivaly, which is correct for ITU compliant SD video, I will see if I get an error after it's converted.

    Originally Posted by poisondeathray View Post
    almost no player will respect it.
    It will at least be properly displayed in like all players through analog output, that's the whole idea of REC.601, so that amongst others DV video would be displayed properly on analog equipment, you know the little thing called backwards compaibility. It's really lazy for manufacturers not to make sure their digital TVs, players and software can't follow...
    Quote Quote  
  23. Originally Posted by SF01 View Post
    Originally Posted by poisondeathray View Post

    A 1920x1080 source uses the full active image area . Don't confuse that with an analog SD PAL source, or some other analog source.
    1920x1080 uses full frame yes, but when converting it to SD PAL of 720x576 the SAR should be 512:351, not 64:45 so that it's ITU-compliant.
    Not for a PC player. That's what was being discussed above.


    Originally Posted by poisondeathray View Post

    MPEG2 for DVD only supports 16:9 and 4:3 . Setting the SAR to some other value is not supported . This is not like AVC stream, where almost all players universally accept it . If it were AVC, you could use almost any SAR value and it would work to resize the display. That's not the same thing as crop. The entire frame is resized. AVC supports a crop flag as well, but that is different than SAR . Crop is not the same thing as SAR
    So the cropping information will occur after the 720x576 frame is expanded to the set aspect ratio of 4:3, or 16:9? It won't work in the manner of first cropping 720 to 702 and then the player will stretch the cropped to 702x576 frame to the set aspect ratio, will it?
    AVC crop VUI data behaviour inconsistent with AVC decoders. Only common values are supported. For example 1920x1080 is actually encoded as 1920x1088 with a crop frame flag (the 8pixels are cropped) . I think crop is applied before player scaling, but you can test it.
    https://ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmetadata

    But AVC cannot be used for DVD, so it's irrelevant for this discussion anyways


    Originally Posted by poisondeathray View Post

    But if it were AVC in MP4 or MKV, you would still use 720x576 and 64:45 for a 1920x1080 source . The geometry is perfect. You can test it yourself. This will display as 1024x576. Perfect.
    But it's completely against REC.601, the mat is there and 720x576 with SAR of 64:45 stretched to 26:9 aspect ratio will produce geometrically correct image (chech the link in post #3), but it is not ITU-compliant and shouldn't be used in applications that must be ITU compliant, otherwise it will produce distorted image.
    We were talking about PC player. "for proper playback on a PC...." That is what a PC player does. The image is correct in a PC player.


    Originally Posted by poisondeathray View Post
    For an MPEG2 stream, sequence_display_extension specifies the active image area that is scaled to 16:9 or 4:3. But not all players (hardware and software) support this. Very few do. I already mentioned ffmpeg cannot do this. restream can patch it, but almost no player will respect it.
    So it can be done, therefore the specified active image are ahouls be 702x576 for PAL material which should be stretched to 16:9, or 4:3, well then the software ans hardware should support it. So the solution would be to keep the DAR as is in AVS2DVD ffmpeg, but fix it in restream. I have now started running ffmpeg via AVS2DVD with aspect changed from 4:3 (I am currently transffering VHS to DVD) to 128:117 in the command line SAR and DAR values are displayed as 128:117 and 160:117 respectivaly, which is correct for ITU compliant SD video, I will see if I get an error after it's converted.
    In theory it can be done. You can check with gspot to see the values. Most players will ignore it because it's not mandatory part of the MPEG2 decoder spec - It's optional.


    Originally Posted by poisondeathray View Post
    almost no player will respect it.
    It will at least be properly displayed in like all players through analog output, that's the whole idea of REC.601, so that amongst others DV video would be displayed properly on analog equipment, you know the little thing called backwards compaibility. It's really lazy for manufacturers not to make sure their digital TVs, players and software can't follow...
    In theory. It does not display correctly on a PC player, which was what we were discussing
    Quote Quote  
  24. Originally Posted by poisondeathray View Post
    Originally Posted by SF01 View Post
    Originally Posted by poisondeathray View Post

    A 1920x1080 source uses the full active image area . Don't confuse that with an analog SD PAL source, or some other analog source.
    1920x1080 uses full frame yes, but when converting it to SD PAL of 720x576 the SAR should be 512:351, not 64:45 so that it's ITU-compliant.
    Not for a PC player. That's what was being discussed above.
    Originally Posted by poisondeathray View Post
    Originally Posted by SF01 View Post
    Originally Posted by poisondeathray View Post
    almost no player will respect it.
    It will at least be properly displayed in like all players through analog output, that's the whole idea of REC.601, so that amongst others DV video would be displayed properly on analog equipment, you know the little thing called backwards compaibility. It's really lazy for manufacturers not to make sure their digital TVs, players and software can't follow...
    In theory. It does not display correctly on a PC player, which was what we were discussing

    That's the flaw in the PC software, that they can't properly interpret SD video, which is why I am interested in the cropping.


    OK, so what should I set in Restream to set the flags that the video needs to be cropped to 702 pixels to be displayed properly in digital equipment that has no idea what REC.601 is?
    Quote Quote  
  25. Originally Posted by SF01 View Post
    OK, so what should I set in Restream to set the flags that the video needs to be cropped to 702 pixels to be displayed properly in digital equipment that has no idea what REC.601 is?
    Again, it does not work in most software players. The values are ignored. Try it out, and verify with gspot. Try different media players, maybe you will find one that respect it
    Quote Quote  
  26. gspot shows the incorrect par of 16:15 for the 4:3 DV file straight out of ffmpeg, even though in the command line window it showed proper SAR and DAR.
    What and where should I set/change so that it will include cropping information?
    Quote Quote  
  27. Originally Posted by SF01 View Post
    gspot shows the incorrect par of 16:15 for the 4:3 DV file straight out of ffmpeg, even though in the command line window it showed proper SAR and DAR.
    What and where should I set/change so that it will include cropping information?
    You can't do with ffmpeg for mpeg2

    restream can set the sequence_display_extension, but most players ignore it so it's pretty much useless

    The answer is don't use MPEG2 or DVD then you can set SAR to whatever you want
    Quote Quote  
  28. The DVD is a requirement.
    And yes, I was inquiring about what to set in restream.
    Quote Quote  
  29. Originally Posted by SF01 View Post
    The DVD is a requirement.
    And yes, I was inquiring about what to set in restream.
    Enter the horizontal display size - that's the portion that is supposed to be displayed on screen. eg. 702. It generally does not work correctly (most players ignore). It's part of the mpeg2 spec, but it's an optional component for decoders

    Why not resize and pillarbox to make the content AR match whatever you want when using 64:45. At least this will work correctly for DVD.
    Quote Quote  
  30. So I should check the "Correct Sequence Estension length" and in Sequence display extension select "change" and replace the 540 with 702 and check "with color".

    Because I am making an ITU-compliant DVD, while it will play correctly on all DVD players through analog, I am trying to find a way to make it at least possible to play on digtal quipment that is capable of extracting and using the cropping information.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!