Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th November 2012, 14:06   #1  |  Link
superdiy
Registered User
 
Join Date: Nov 2012
Posts: 3
Converting 16:9 VOBs to 4:3 letterboxed (with bars) VOBs

Hi everybody,

I've been reading up and trying to figure out how to use Avisynth for the past few weeks, but just ended up in dead ends. None of the sample scripts I could find on the web does what I need it to do and the GUIs for Avisynth are all very old - I'm not sure if there is something better to use lately or if the old GUIs etc. will still work in later versions of Avisynth? I also see that Avisynth acts as a layer in-between the actual file and the “software media player”. I’m not sure if this is possible, but I would like to use it to change the actual file permanently by whatever means, if that is at all possible – I don’t want it to act as an intermediate layer between the file and the player.

Basically I need to convert music videos I've ripped from my music DVDs (via DVD Decrypter). The videos are ripped into VOBs (single tracks) and I would like to keep them in the VOB (mpeg) format, preferably with the audio unchanged (depending on the original DVD the audio is either one of the following: 2 CH PCM / 2 CH Dolby Digital / 6 CH Dolby Digital / 6 CH DTS). Most of the videos are in 4:3 AR, but especially lately the videos are in 16:9 AR although they are still 720x576 (PAL). These 16:9 (720X576) videos are the ones I need to change permanently.

Most software media players play them in the correct aspect ratio, but unfortunately I'm using them only in Virtual DJ and Virtual DJ ignores the AR setting inside the VOB and only looks at the dimensions of the VOB (720x576) and then stretches it to an incorrect AR. I would like to convert these videos to 4:3 AR letterboxed with black bars top and bottom, but keep the size at 720x576. I've successfully done this with some free video converter tools available on the web, but the quality is dropped extensively and some of the videos become very interlaced as well.

A lot of my Google searches led to Avisynth and the DOOM9 forum, but still I was unable to find a sample script to achieve what I required and I don't really know where to start (seeing all the options and OLD GUIs for Avisynth). Can someone perhaps point me to some scripting or post me some script example and usage instructions to achieve the required manipulation, but while still preserving the best possible quality. The videos vary in bitrates, but most of them are between 6000 and 9000 kbps for "data bitrate" - I would like to keep it that high and preserve the audio as-is if possible.

To summarize:
Need to convert VOBs with 16:9 AR and dimensions of 720x576 to VOBs with 4:3 AR letterboxed (including black bars at top and bottom) and dimensions of 720x576. Quality must be as close as possible to the quality of the source files and audio must preferably be kept the same as that of the original file.

If I rather need to use something else instead of Avisynth, I’m fine with that as well.

Any help much appreciated
superdiy is offline   Reply With Quote
Old 27th November 2012, 14:18   #2  |  Link
ajk
Registered User
 
Join Date: Jan 2006
Location: Finland
Posts: 134
Quote:
Originally Posted by superdiy View Post
I would like to use it to change the actual file permanently by whatever means, if that is at all possible – I don’t want it to act as an intermediate layer between the file and the player.
That is certainly possible. What Avisynth does is load a video and let you process it in almost any way; what you then do with the output (play, encode, etc) is up to you.

Quote:
I would like to keep them in the VOB (mpeg) format, preferably with the audio unchanged
You can't do that without re-encoding, since Avisynth will decode everything that goes into it and puts out an uncompressed AVI. So you'll also need software for encoding the output back to MPEG2.

Quote:
Need to convert VOBs with 16:9 AR and dimensions of 720x576 to VOBs with 4:3 AR letterboxed (including black bars at top and bottom) and dimensions of 720x576. Quality must be as close as possible to the quality of the source files and audio must preferably be kept the same as that of the original file.
Resizing and letterboxing the video is easy enough. Have a look at the MediaWiki to get you started, then look for the Resize() and AddBorders() commands.

You would then need to re-encode the output back to MPEG2 and combine it with the original audio for the final VOB.
ajk is offline   Reply With Quote
Old 27th November 2012, 17:00   #3  |  Link
TheSkiller
Registered User
 
Join Date: Dec 2007
Location: Germany
Posts: 632
Quote:
Originally Posted by superdiy View Post
but unfortunately I'm using them only in Virtual DJ and Virtual DJ ignores the AR setting inside the VOB and only looks at the dimensions of the VOB (720x576) and then stretches it to an incorrect AR.
You probably haven't noticed but this means any 720x576 VOB, including the 4:3 ones, are being displayed distorted in that application.
The error just isn't as big with 4:3 as it is with 16:9 VOBs. The reason is simply both formats have rectangular pixels (instead of square ones) and both need to be treated accordingly for display. It seems this does not happen and the application dumbly assumes square pixels and always displays the videos in a 5:4 window no matter what the VOB's aspect flag says.

So, it is your choice, but from my point of view this whole letterboxing and reencoding thing is a redundant thing to do.
Since this involves resizing in the vertical direction, you need to take care of interlacing...

Anyway, a simple "always works" letterboxing script would look like this:
Code:
#Letterboxing for PAL DVD
MPEG2Source("index file.d2v")
Bob()
Spline36Resize(Width,432)
AssumeTFF()
SeparateFields().SelectEvery(4,0,3).Weave()
AddBorders(0,72,0,72)
You need DGIndex.

Have you tried feeding an AVS script directly into your DJ application? That would make things easier, at least you probably don't need to reencode then.
Audio does not need to be reencoded, that's for sure.

Last edited by TheSkiller; 27th November 2012 at 17:06.
TheSkiller is offline   Reply With Quote
Old 28th November 2012, 07:44   #4  |  Link
superdiy
Registered User
 
Join Date: Nov 2012
Posts: 3
Quote:
Originally Posted by TheSkiller View Post
You probably haven't noticed but this means any 720x576 VOB, including the 4:3 ones, are being displayed distorted in that application.
The error just isn't as big with 4:3 as it is with 16:9 VOBs. The reason is simply both formats have rectangular pixels (instead of square ones) and both need to be treated accordingly for display. It seems this does not happen and the application dumbly assumes square pixels and always displays the videos in a 5:4 window no matter what the VOB's aspect flag says.
That is quite possible.

Quote:
Originally Posted by TheSkiller View Post
Have you tried feeding an AVS script directly into your DJ application? That would make things easier, at least you probably don't need to reencode then.
Audio does not need to be reencoded, that's for sure.
After reading the DGIndex "Quick Start Guide" and all of this, it looks like this is going to be quite a process to "fix" the 16:9 videos (approximately 800 videos) and the the 4:3 videos (approximately 5000 videos) still might not be in the correct AR. The better way would obviously be to try a script to "fool" the software, because in future the developers might fix their code and then a lot of my videos were re-encoded and a lot of time wasted unneccessary.

What does a script to "fool" the software look like? Will that script be able to auto-detect the AR and ensure that all the videos are played in the correct AR, irrespective if they are 4:3 or 16:9? Do you have to open this "script file" instead of the VOB then?

If I can get a script which would work as a layer inbetween the file and the software, I'll have to do some thourough testing, because as far as I know the file is pre-loaded into the software when you start playing it, but then you can apply all kinds of filters and effects to it while it is played forward or in reverse or "scratched" etc. etc. etc.

Last edited by superdiy; 28th November 2012 at 08:16.
superdiy is offline   Reply With Quote
Old 28th November 2012, 13:36   #5  |  Link
Mole
Registered User
 
Mole's Avatar
 
Join Date: Oct 2001
Location: Thailand
Posts: 259
Hm, rather than converting 5000 videos which would take considerable time just to prepare each script and also encode, I would probably be looking for alternative players to this Virtual DJ.
You may also check out how it actually loads the videos. It may be loading through Directshow, which in case you should be able to use ffdshow with custom settings instead.
Mole is offline   Reply With Quote
Old 28th November 2012, 15:08   #6  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
I believe the easiest and the most elegant way of doing this is to ask the developers of Virtual DJ to implement DAR in their software (join the choir ). This wish was apparently expressed earlier today in their official forum
Quote:
Can you please fix VDJ to display VOBs (MPEGs) in the correct aspect ratio according to the aspect ratio indicator found inside the files. Lately more and more of my new VOBs are 720x576 but with an aspect ratio of 16:9 - the older VOBs are 720x576 with AR of 4:3 - VDJ ignores the 16:9 aspect ratio set inside the file and displays all the VOBs as 4:3. I assume VDJ only looks at the W & H of the file and then displays it at that ratio. The "Keep Ratio (Crop)" / "Keep Ratio (Full)" setting does not fix this. If you use the "Keep Ratio" Full or Crop it works correctly for 4:3 VOBs, but not for 16:9 VOBs.

That would really be greatly appreciated!
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 29th November 2012, 03:47   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
What you want is unrealistic.
You cannot play at 1:1 sample(pixel) aspect ratio, confined to 720x576 frame aspect ratio and still maintain quality.
Suggest using a player that can use variable AR or get Virtual DJ to comply.
If you can decide what you want, I can provide the means to generate scripts for all 800
(or whatever) of your clips automatically but you need to decide what you want. (It may take a little time to make some mods).
EDIT: If you decide that you want the 1:1 pixel AR in 720x576, I can do that but quality WILL suffer.
EDIT: Dont know where I got 800 from, maybe some other thread, you dont seem to mention a number.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 29th November 2012 at 04:37.
StainlessS is offline   Reply With Quote
Old 29th November 2012, 07:28   #8  |  Link
superdiy
Registered User
 
Join Date: Nov 2012
Posts: 3
Quote:
Originally Posted by Ghitulescu View Post
I believe the easiest and the most elegant way of doing this is to ask the developers of Virtual DJ to implement DAR in their software (join the choir ). This wish was apparently expressed earlier today in their official forum
That is my post you quoted and refers to.... Hopefully it does not fall on deaf ears.

Last edited by superdiy; 29th November 2012 at 07:33.
superdiy is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:54.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.