conversion of 4:3 back to 16:9

Started by golinux, May 25, 2021, 03:37:32 AM

Previous topic - Next topic

golinux

I am still using the GTK version of Avidemux 2.5.6 on Devuan GNU Linux but my question is more generic so hoping I might find more help here rather than the Linux forum. Please move if necessary.

Quite a few years ago I converted quite a few 16:9 vids from a DVD to 4:3 aspect ratio because I had an older 4:3 TV.  Then I finally got a 16:9 capable TV but the edited videos are still surrounded by black on all sides.  Is there a way to get rid of the black frame and restore the video to true 16:9. I no longer have the original DVDs and in any case, can't imagine re-editing all of them.

I tried changing the aspect ratio in auto DVD and also in the mpeg-2 configuration but nothing seems to "stick" in the preview pane.

I have not done much editing in several years so may be missing something obvious.  Hope you can help and TIA.

golinux




butterw

If the Aspect Ratio of your video is 4/3 (check the resolution of your encoded files) it is normal for it to display with black bars on a 16/9 display.
The only way for to display it full-screen, would be to stretch it horizontally which leads to a a distorted AR (your TV should be able to do this, but it will likely look ugly).

eumagga0x2a

Quote from: golinux on May 25, 2021, 03:37:32 AMI am still using the GTK version of Avidemux 2.5.6

As you probably understand, this is an unsupported legacy application. Only the last release (currently 2.7.8 ) and the latest git master is supported, the last release means that in case of any problems the first thing you will be asked to do will be to try it with a build off the git master.

Quote from: golinux on May 25, 2021, 03:37:32 AMQuite a few years ago I converted quite a few 16:9 vids from a DVD to 4:3 aspect ratio

It would be necessary to know which transformations you applied to the source to advise you, i.e. what sort of source DVD it was (PAL or NTSC, interlaced or progressive), what is the current resolution and whether the picture was cropped at left and right to reduce the height of black bars.

It is also necessary to know whether the final output should be again a 16:9 DVD-compliant MPEG-2 PS (program stream) or something else.

The basic approach to transform it back to DVD would be to crop black bars, scale the remainder to 720x576 for PAL (i.e. 25 fps) or to 720x480 for NTSC (i.e. 30000/1001 fps) and to re-encode to MPEG-2 with the aspect ratio set to "wide".

If the source was interlaced and it wasn't deinterlaced as the first step during the conversion to 4:3 with black bars, the video is irrevocably ruined.

golinux

#3
Thanks for your response. I'll try to provide the missing info.

Quote from: eumagga0x2a on May 25, 2021, 07:41:19 AM
Quote from: golinux on May 25, 2021, 03:37:32 AMI am still using the GTK version of Avidemux 2.5.6
As you probably understand, this is an unsupported legacy application. Only the last release (currently 2.7.8 ) and the latest git master is supported, the last release means that in case of any problems the first thing you will be asked to do will be to try it with a build off the git master.
I played a bit with the qt version when it was released years ago. It was buggy, fugly, not frame based and filters were missing. Don't know that I want to go there again.

Quote from: golinux on May 25, 2021, 03:37:32 AMQuite a few years ago I converted quite a few 16:9 vids from a DVD to 4:3 aspect ratio
Quote from: eumagga0x2a on May 25, 2021, 07:41:19 AMIt would be necessary to know which transformations you applied to the source to advise you, i.e. what sort of source DVD it was (PAL or NTSC, interlaced or progressive), what is the current resolution and whether the picture was cropped at left and right to reduce the height of black bars.
Original discs were NTSC
Progressive
Filters affecting size:
MPlayer Resize  720x360 -> 720x480
Borders 720 x 480 -> 720 x 360 (I can't remember how I arrived at that combo of settings.)
Note that both the audio and video were heavily edited. It was not just a straight conversion. Once all the segments were processed, I created isos with DVD Styler. I have about 50 of them with 4-6 processed mpgs on each of them.

Quote from: eumagga0x2a on May 25, 2021, 07:41:19 AMIt is also necessary to know whether the final output should be again a 16:9 DVD-compliant MPEG-2 PS (program stream) or something else.
Yes, back to a 16:9 DVD-compliant MPEG-2 PS.

Quote from: eumagga0x2a on May 25, 2021, 07:41:19 AMThe basic approach to transform it back to DVD would be to crop black bars, scale the remainder to 720x576 for PAL (i.e. 25 fps) or to 720x480 for NTSC (i.e. 30000/1001 fps) and to re-encode to MPEG-2 with the aspect ratio set to "wide".
The above filters already seem to do that but with black borders.

Quote from: eumagga0x2a on May 25, 2021, 07:41:19 AMIf the source was interlaced and it wasn't deinterlaced as the first step during the conversion to 4:3 with black bars, the video is irrevocably ruined.
I suspect this is the case because that procedure does not sound familiar. Here is the configuration from a project's C source. Perhaps that will have some useful information:

//** Video Codec conf **
app.video.codecPlugin("DBAECD8B-CF29-4846-AF57-B596427FE7D3", "mpeg2video", "2PASSBITRATE=6000", "<?xml version='1.0'?><Mpeg2Config><Mpeg2Options><minBitrate>0</minBitrate><maxBitrate>8000</maxBitrate><xvidRateControl>true</xvidRateControl><bufferSize>224</bufferSize><widescreen>false</widescreen><interlaced>none</interlaced><gopSize>12</gopSize></Mpeg2Options></Mpeg2Config>");

szlldm

Quote from: golinux on May 26, 2021, 02:56:20 AM
Quote
QuoteI am still using the GTK version of Avidemux 2.5.6
As you probably understand, this is an unsupported legacy application. Only the last release (currently 2.7.8 ) and the latest git master is supported, the last release means that in case of any problems the first thing you will be asked to do will be to try it with a build off the git master.
I played a bit with the qt version when it was released years ago. It was buggy, fugly, not frame based and filters were missing. Don't know that I want to go there again.

You should try the latest release, or the latest nightly build (it has more filters than ever before  ;) ). Those 2.5.6 is a 10 years old release.
The current state is virtually bugfree on average use case (ofc. there are always edge cases, and rare codec-container combos)

eumagga0x2a

Quote from: golinux on May 26, 2021, 02:56:20 AMIt was [...] not frame based

Well, frame based approach doesn't work in the world of modern codecs starting with H.264, therefore current versions are not frame based, of course.

Quote from: golinux on May 26, 2021, 02:56:20 AMOriginal discs were NTSC
Progressive

Good.

Quote from: golinux on May 26, 2021, 02:56:20 AMFilters affecting size:
MPlayer Resize  720x360 -> 720x480
Borders 720 x 480 -> 720 x 360 (I can't remember how I arrived at that combo of settings.)

This must be the other way round as a valid NTSC DVD resolution can be either 720x480 (i.e. with overscan) or 704x480 only: 720x480 --> 720x360 (the height in square pixels for 16:9 derived from 720 is equal 405, which results in the output height of 360 when multiplied with the NTSC 4:3 DVD pixel aspect ratio of 8:9) and adding black bars 60 px thick. To create a DVD compatible source, you need to reverse the order, i.e. to crop the picture to 720x360 and then to scale it to 720x480. The result needs to be re-encoded to MPEG-2 with aspect ratio set to "Wide".

I disregard the problem of quality loss from upscaling a low resolution picture and from the MPEG-2 <--> Xvid roundtrip, it will be substantial.

golinux

@eumagga0x2 - Thanks for a roadmap to restore to 16x9. Won't hurt to play with it a bit. :) Will let you know how it goes.

golinux

Well . . . that was actually quite easy to do and worked better than expected. The edit only took a few minutes but creating the new mpg took quite a long time with the cpu churning away. The quality reminded me of OTA analog days. I'll see how it looks on the TV monitor tomorrow but since these videos are not for sitting and watching but for mirroring full body movements, quality is nice but not a deal breaker. Another consideration . . . I don't know that I have it in me to re-edit my entire library but now I know it's possible.

Thanks so much for your help.