Log in

View Full Version : Fastest and best quality codec


CrazyPortuguese
10th June 2003, 15:02
Wich codec and settings do you recomend me to use with virtual dub to get the lowest compression time with out loosing quality in this case size isnt important but quality and time are.
My idea is to add permanent subtitles to a avi (divx and xvid) file using vobsub and virtualdub to end with a avi file (doesnt matter the codec) to recompress that to a svcd using dvd2svcd.
That's why size isnt important (well at least till 5GB).

ultimatebilly
10th June 2003, 15:07
To answer your question:
The codec you're looking for would probably be Huffyuv, because it is compressing lossles...
But you can frameserve the video from Virtualdub to DVD2SVCD, or you can modify the DVD2SVCD-script for avisynth, to add permanent subtitles to the SVCD...
You even have the option in DVD2SVCD, just check "permanent" in the subtitle-tab...
You will find more information on adding permanent subs via avisynth in the subtitle section, I think the plugin you need is textsub, but I'm not sure about that, because I never used it...
But check out the option in DVD2SVCD......

well at least till 5GB
Considering this: Forget Huffyuv :)

PS.: You should avoid every unnecessary compression if there is any chance that it is possible! The quality will suffer very much, even if you use a codec like XVID with high-quality-settings...

CrazyPortuguese
10th June 2003, 15:32
First of all THANKS I really apreciate your help with this.

Well the reason I'm using this is because i'm having problems with dvd2svcd permanent subtitles the audio and subtitles are out of sync and I couldnt solve it.
And the idea to use avysynth seems a little complicated to me unless you could advice me with a good guide or a easy way, I dont have a clue how to use textsub (vobsub) with avisynth and dvd2svcd.

Right now I'm using textsub (that comes with vob sub) exacly to insert permanent subtitles using virtual dub, I've already tryed to recompress using Divx 5.5 codec with maximum quality but for some reason the video file size is lower tham the original and now have used xvid at maximum the quality seems ok but I was wondering if there was any faster codec with better quality.

ultimatebilly
10th June 2003, 16:06
There seems to be a bug in the textsub-version for avisynth...

http://forum.doom9.org/showthread.php?s=&threadid=45820&highlight=textsub+sync

You can use Virtualdubs, and then frameserve the subbed video to DVD2SVCD, but it will be slow as hell...
Read doom9s guide on Virtualdub-procedures to see how frameserving works:

http://www.doom9.org/virtualdub_procedures.htm

I don't think you will find something better than XVID...

CrazyPortuguese
10th June 2003, 17:10
Thanks once again
Yeah I think I will stick to using xvid with virtual dub.
Do you recommend any particular settings to optimize speed and quality ? Right now I'm using 1pass quality and I dont understand anything in the advanced settings.

Update: I've tryed using frameserver with virtual dub (installed handler) and run the registry file and then selected start frame server but for some reason dvd2svcd seems no to like it at least when I open the avi I defined has output from framserver dvd2svcd stoped there and the Go buton isnt active neither the time of the avi. I think dvd2svcd isnt compatible with this.

ultimatebilly
10th June 2003, 17:33
I have an idea!
You read that part about the assumefps-parameter in the thread I linked to, right?
This tells your encoding-application that the avs has 25fps, even if it has 23.976...
But this may screw up the mpeg2-header, so I wouldn't use it, but it should sync your subs...
Why don't you try the following?
You start the encoding in DVD2SVCD like you would normally do, and check the permanent subs option...
Then you abort the encoding process at the point CCE or TMPEG starts to encode...
Now you locate the avisynth-script which was used...
Have a look in the log to see where it is, but you will find it...
Now you copy the whole script to an empty notepad-file, name it whatever.avs, and add the parameter "assumefps=25" to the mpeg2source-command.
Now you reopen the original script, delete the whole thing about mpeg2source, and insert "avisource("c:\whateverthepathmaybe\whatever.avs", assumefps=23.976)" to it...
Now use the resume-function of DVD2SVCD to resume the encoding process where it was interrupted...
Maybe this is all bullshit, but maybe it works, I don't know...
So maybe use 1-pass CBR for testing purposes and interrupt it again after some minutes to check if it is in sync now or not...
And don't forget to report...

PS.: Another idea: You could try to just add "assumefps=23.976" to your script, without even creating the whatever.avs...
Maybe this is a workaround for the textsub-bug?

And I think you have the possibility to edit your avisynth-script from DVD2SVCD, so you can even try all this without finding the avs...

ultimatebilly
10th June 2003, 17:42
In quality mode the advanced settings in XVID doesn't matter that much I think, just set the search precision to the highest value possible, you can activate QPEL to preserve a little extra detail...
And deactivate b-frames...
You can also increase the maximum allowed bitrate, but it should be high enough...
Also use MPEG-quantization, or hvs-best...
The rest of the parameters shouldn't affect quality mode, because most of them deal with curve-treatment (and you have no curve).
You have to open the .vdr-file in DVD2SVCD, set it to avi input...
This way it may work...
Oh, and you have to add the .vdr-extension manually, Virtualdub doesn't do this automatically IIRC...

CrazyPortuguese
10th June 2003, 18:06
Gonna try now inserting the line assumefps=23.976 in avisynth file there was a line saying AssumeFPS(25,1,True) I removed that one.
Lets see if it solves :)

About the framserving I saved the output not with a .vdr extension but with a .avi extension because if it was a .vdr dvd2svcd wouldnt even open it.
The problem is that I think that dvd2svcd tryes to check the video information (time and etc) so it is like the avi is corrupt.

CrazyPortuguese
10th June 2003, 18:53
Dint work :( now I get the audio out of sync too I think I will have to recompress in virtual dub first.
Gonna try with Huffuy I think the predicted size is about 22GB so thaa't not that bad since right now I still have about 80GB of free space, but later it could be a problem.

ultimatebilly
11th June 2003, 10:05
Your DVD contains NTSC-content, doesn't it?
Otherwise the framerate already is 25 fps...
But I don't understand why it isn't in sync then...
You are right about the vdr in DVD2SVCD, can't get it to work too...
But you can open it in tmpeg directly, maybe even in CCE, to encode it...
Sorry, I have no more ideas at the moment...

Well, one...
Maybe try removing the "assumefps-parameter" from the DVD2SVCD-script at all, it seems to give weird timing information in Virtualdub at least...
But I don't really suppose it to change anything, after all textsub is working in Virtualdub...
If you go the Huffyuv-way, make sure your HDs use NTFS as a file system...

ppera2
11th June 2003, 12:14
So looks AVISynth script for SVCD with subs:

LoadPlugin("F:\WinUtils\AVISynth\MPEG2DEC.DLL")
mpeg2source("E:\JP3_1.d2v")
BilinearResize(480,448)
AddBorders(0,64,0,64)
LoadPlugin("C:\Program Files\AviSynth2\plugins\textsub.vdf")
TextSub("G:\Jurassicpark3_SR.ssa")

It is quite simple... I recommend to you that first check it in Virtual Dub for sync.
Reason can be even that your sub is for different framerate than video what you have. I dont recommend AssumeFPS, but you change framerate of sub with Subresync or SubAdjust.

Also, making intermediate AVI file will not solve async.
It is waste of time and quality.

CrazyPortuguese
12th June 2003, 15:27
ultimatebilly the source is not a dvd but a avi file (divx) in NTSC, about the huffyuv I already got it working the problem is because of the huge size of the file the HDD (2xWD 80GBSE RAID0) have to do extra work and the compression speed in dvd2svcd decreases to half.
About you idea gonna give it a try :)

pper2 the subtitles work perfectly in bestplayer and when I compress the file using virtual dub I also dont have any problems with sync, the problem is with dvd2svcd for now the only solution I found was to recompress the movie in vdub using textsub to already insert permanent subtitles in the avi and then recompress it in dvd2svcd the problem is the quality and time that I loose in this process for some reason even if I use the divx 5.05 pro codec with 6000kbps bitrate I end with a 700MB file with noticible lost in quality.

ppera2
12th June 2003, 16:07
I never used DVD2SVCD, but made it by 'walk'. Don't think that source type is relevant.
You can 'feed' with AVS script CCE or TMPGenc, just need to make audio separatelly (TooLame), because this 2 prog. have issues with audio. Need Win XP for that (in 98, Me it will not work probably).