View Full Version : Using DVD2SVCD for DVD output with AC3 audio
Nick
4th November 2005, 17:49
This seems to be an area of interest for a few users at the moment.
I've been developing a couple of files which may be helpful to these ends.
As I am no developer I am not really interested in adding more features, only debugging etc. So please feel free to post questions, problems and/or modifications to the scripts.
Get them here:
http://nickspage.pwp.blueyonder.co.uk/AC3EncSetup.exe - batch files
http://nickspage.pwp.blueyonder.co.uk/AC3ExeSetup.exe - executables
Both work similarly well but on faster systems the executables seem to work quicker, on slower ones, especially those short on RAM, the batch files seem to be quicker. Try for yourself and use whichever you prefer.
Usage:
AC3Enc*.bat/exe parses the BeSweet commandline generated by DVD2SVCD. If the output mode selected in DVD2SVCD Audio tab is Stereo, this batch file runs BeSweet but using Aften instead of 2lame so that the output is AC3 2.0 instead of MP2 at the chosen bitrate. If NTSC2PAL is being used, BeSweet actually runs twice - once to resample to 48k (as some AVI's and MPEG sources have 44100Hz audio) and again for framerate conversion, since doing the two simultaneously causes major headaches.
If, however, output mode in the audio tab is set to MPEG5.1, the chosen bitrate does not appear in the BeSweet commandline. In this case, a textfile containing the pertinent parts of the BeSweet commandline is generated.
Then when DVD2SVCD runs the MPEG5.1 encoder (now set to MPEG51(*).bat/exe) this file obtains the commandline from the text file, which it then deletes, and obtains the bitrate from the commandline for the MPEG5.1 encoder. It now runs BeSweet to encode a 5.1 stream at the chosen bitrate.
So, simply put, what do we use this for?
OK. If you set the Output in DVD2SVCD to stereo, it works just the same as DVD2SVCD always did, but with AC3 output instead of MP2. Since MP2 audio alone makes a non-compliant disc in NTSC territory, you should now make fully compliant DVD's.
As for MPEG5.1 mode, this is used for 2 things - if you are doing DVD2DVD and want to downsize the audio stream(s) to make extra room for the video, you could say, make the output disc have for example your native language at 384kbps and a second language at 256kbps but keep the 5.1 soundtracks. Also, from DVD or AVI, it should now be possible to do NTSC2PAL and keep 5.1 audio :)
Limitations:
Don't use for SVCD! AC3 audio is not compatible. If doing an SVCD conversion, remember to replace the paths in the audio tab back to the original configuration.
If the input file is stereo, don't select 5.1 output. It is not possible to create a 5.1 output stream from stereo input.
This only works 100% with DVD Author or the BatchMux plugin - NOT Scenarist! In order for muxing to take place, the output file has to be called Encoded_Audio_*.mp2 - mplex.exe recognises that the file is AC3 despite the MP2 extension and continues normally. Scenarist muxes the AC3 correctly but the authors a disc which believes it has MP2 audio. This could cause playback issues on some players.
There is a quirk in the way DVD2SVCD is written that means using AC3Enc* and MPEG51(*) on sources without AC3 audio results in failure of fixed chapters. Manolito and I (but mainly him let's face it!) have developed a means of overcoming this by hijacking the process at the DVD Author stage. The files to do this are now included.
Have fun :)
Nick
UPDATE 18 March 07 - The new build uses Aften instead of BeSweet's AC3Enc.dll to do the AC3 encoding. With AC3Enc.dll, the main problem was that sources with broad dynamic range tended to encode very quietly. Whilst older versions of Aften solved this, they tended to sound harsh and produce distortion on musical sources. However, I am very impressed with the latest build of Aften and have decided, with the author's permission, to use it.
If you are less impressed, the older version of the plugin that uses AC3Enc.dll is available here:
http://nickspage.pwp.blueyonder.co.uk/AC3Enc6+AC3_DVDAuthor.zip
UPDATE 17 May 07 - New build with installer, compiled files and many improvements and fixed issues.
UPDATE 20 Feb 08 - New build. Changelog in thread.
UPDATE 20 Apr 10 - Couple of fixes. Changelog in thread
ChickenMan
5th November 2005, 05:16
Fantaastic Nick, just whats been needed for D2S for quite some time. Thanks.
manolito
5th November 2005, 14:28
Yes, works perfectly here (I'm in PAL country). Just two questions:
Are you saying that a DVD with just an MP2 audio track is not DVD compliant in NTSC, but it is compliant in PAL?
And you mentioned the somewhat limited quality of free AC3 encoders. When my audio source is a high quality WAV file, would the quality of an AC3 encode be worse compared to an MP2 encode at the same bitrate (using the current version of BeSweet with ac3enc.dll or or lame_enc.dll)?
Anyway, thanks a lot for the great work, I think it's ready for a place in the "Plugins" sticky
Cheers
manolito
Nick
5th November 2005, 15:06
Are you saying that a DVD with just an MP2 audio track is not DVD compliant in NTSC, but it is compliant in PAL?
Certainly that was the case in the original DVD specs.
PAL
Audio:
48000 Hz
32 - 1536 kbps
Up to 8 audio tracks containing Dolby Digital, DTS, PCM(uncompressed
audio), MPEG-1 Layer2. One audio track must have MPEG-1, DD or PCM Audio.
NTSC
Audio:
48000 Hz
32 - 1536 kbps
Up to 8 audio tracks containing Dolby Digital, DTS, PCM(uncompressed
audio). One audio track must have DD or PCM Audio.
ie MPEG1 audio formats were not supported as the sole stream on an NTSC DVD. Rare as they are, some players simply won't play a disc with NTSC video and mp2 audio!
Would the quality of an AC3 encode be worse compared to an MP2 encode at the same bitrate (using the current version of BeSweet with ac3enc.dll or or lame_enc.dll)?
Variable. Some sources encode very well indeed with ac3enc.dll whereas others don't. It seems to be files with broader dynamic range which encode poorly. Using BeSweet, AC3 2.0 seems to do better in some cases than MP2 but marginally worse in most. For a PAL source to PAL DVD conversion, I would probably stick to mp2. But don't take my word for it, try it for yourself and see.
Anyway, thanks a lot for the great work, I think it's ready for a place in the "Plugins" sticky
No problem :)
I think I'll give it a few days to see if any problems are reported before I add it to the sticky.
Thanks for the feedback.
Nick
raquete
5th November 2005, 16:09
very cool Nick.
reading in BeSweer faq
10 Known issues in v1.5 :
16 - ac3enc.dll creates (almost) useless ac3 streams. don't use it to encode things you care for. it's there only for test purposes.
i saw that BeSweet v1.5 and inside D2S is using ac3enc.dll (11Kb) from 2/4/2004 and HeadAC3he v0.24-a13 use ac3enc.dll (26,5Kb) from 15/12/2004.
i did only for test with the same source to encode AC3-2Ch 192 bitrate in BeSweet and HeadAC3he.
HeadAC3he sounds better.
if the reason of this better result is the new dll inside HeadAC3he,we can change the ac3enc.dll inside D2S/BeSweet folder to encode ac3 2.0 or 5.1?
thank you.
Nick
5th November 2005, 18:48
Simply swapping the DLL over from HeadAC3che folder to BeSweet folder will unfortunately not work.
I would like to stick to BeSweet if possible for a number of reasons. Firstly I cannot see a way to do framerate adjustment in HeadAC3he. Also, I think it would be harder to automate creation of an ini file for HeadAC3che from a commandline for BeSweet than simply modify that commandline. Thirdly, long standing issues between the authoes of DVD2SVCD and HeadAC3he mean there will never be official support for things like the SweetHead plugin made years ago for this very task.
However, quality is, of course hugely important and if anyone has any suggestions on why BeSweet's output should be inferior to HeadAC3he's and what can be done about this, I should naturally be very interested.
raquete
5th November 2005, 19:19
you're right Nick,
swapping dlls don't work,see the log:
BeSweet v1.5b31 by DSPguru.
--------------------------
Using azid.dll v1.9 (b922) by Midas (midas@egon.gyaloglo.hu).
Error 73: Unable to get ac3enc.dll interfaces
Quiting...
[00:00:00:000] Conversion Completed !
Logging ends : 11/05/05 , 14:25:55.
i understand all reasons and don't knew that "long standing issues",so sorry. :o
as quality is very important and if you don't mind,take a look here (http://forum.doom9.org/showthread.php?p=732800#post732800). i was not waiting your guide and i did it few hours before you.
i see now only two advantages: you can choose what track to re-encode as AC3-2Ch and the other without re-encode,just like BeSweet extract.maybe you can change something to do the same here!
it's not for comparisons,only about audio quality because your guide have lots of advantages.
:thanks: (so much)
ChickenMan
9th November 2005, 16:35
When using the ac3enc4.bat file and doing avi (divx 5.0 with mp3 VBR audio) to dvd, I get no chapter points being set in the final DVDAuthor dvd files. If the avi contains AC# audio initially and set to Do Not Convert Audio, then Chapter points are set. If I use BeSweet (with MP2 audio) then chapter points are set as normal. It appears only with your bat file that for some reason Chapter points are not being set. I know of 1 other person having the exact same proble. Any ideas why ?
Nick
9th November 2005, 22:18
In a word, no. When I find time I'll try and reproduce this and see if there is anything I can do about it.
Matthew
10th November 2005, 00:17
If you are going down the path of AC3 support then perhaps you might like to add support for Soft Encode...command-line can be a bit wobbly though so I've decided to control it via a project file/registry/GUI :)
jsoto
4th January 2006, 16:11
It took me less than a minute to find this thread, because I knew there was this plugin, but I think the thread should be listed in pluggins sticky
jsoto
Nick
4th January 2006, 20:36
It's on the cards jsoto. I wanted to perfect it first.
There is one issue I still have, but have not had time to debug, what with Christmas and all. Maybe this will give me the kick up the backside I need.
Basically, it is written so that if "Use source audio" is checked, it passes the commandline unchanged to BeSweet. This doesn't happen. So if you choose this option, you have to reset the path in the Audio tab to the original BeSweet.exe - OK, so nothing too major but I got overrun with work and kinda forgot about it.
I'll try and do it this weekend. Otherwise if anyone else can a the glaring error in the script, please notify me here.
Cheers for the feedback guys
Nick
PS still haven't sorted Chickenman's issue above - I can reproduce it, but I'm not sure there's anything can be done about it :confused:
Nick
5th January 2006, 20:54
OK. The chapters thing is still a problem. The batch files don't do anything that could affect chapters so I'm stumped here.
The other thing was easy to fix. The error was suitably glaring so I've fixed it and updated the link.
manolito
29th January 2006, 21:42
One of my main problems with AC3Enc.dll is the extremely low volume of the resulting AC3 file. It depends on the volume of the source WAV file, and the "-ota( -g max)" command does not seem to help. It seems that the output volume decreases exponentially with a lower source volume. Just today I had a source WAV file with a -6dB level, and the resulting AC3 file was barely audible. The only way I found to get a decent level for the AC3 file is to normalize the source file to 0dB prior to conversion.
Of course this is easy to do using your favorite wave editor, but we want everything to be automatic, right? I found a very nice Wave Normalizer software which also happens to be free (GPL), and it can be easily integrated into AC3Encx.bat.
Get the software at https://neon1.net/prog/normalizer.html
Copy Normalize.exe to your BeSweet folder. My quick and dirty hack just consists of one line inserted right at the beginning of the batch file:
Normalize.exe %3
This is not elegant, but it works. If your source is not a WAV file, Normalize.exe just quits. After normalizing the "-ota" command does not make too much sense any more, but it also does not do any damage.
Cheers
manolito
Nick
30th January 2006, 00:01
The original version of my batch plugin used ffmpeg.exe to do the AC3 encoding and Normalize.exe to fix the gain.
However, I found the results almost identical to BeSweet with AC3Enc.dll and normalisation via ota.dll
So I ditched ffmpeg and normalize and used BeSweet instead.
Of course it could just be that my own testing material didn't show up this problem so if you could get a few seconds of demonstrative audio to me, I'll see if I can do a more elegant fix.
Cheers
Nick
jsoto
30th January 2006, 00:22
Yes, -ota ( g max ) also works for me..... BTW, I had in the past problems with the volume related with a bad drivers installation in my PC and I was wrongly thinking the problem was in ac3enc.dll.
Another BTW: The chapters problem.
Seems the only way to fix it is also hacking the authoring phase...
DVD2SVCD code analyzes the mpg file to get the audio total length. It "knows" which kind of audio (mp2 or ac3) has to look for, but using the batch file, the code thinks it is mpeg, when actually it is ac3. So the total length reported is zero seconds--> no chapters.
From AVI2DVD logs:
ac3 (Use original audio checked): The code looks for ac3 sound and find it.....
--------------------------------------------------------
- 30/01/2006 0:00:42
- Free on drive D: 3321.92 mb
- Determining length of audio
--------------------------------------------------------
Analyzing: D:\PRU_AC3\MPlex_Muxed_File00.mpg
64.168 seconds D:\PRU_AC3\MPlex_Muxed_File00.mpg
Analyzing finished.
mp2 (Using Besweet): The code looks for mp2 sound and find it...
--------------------------------------------------------
- 29/01/2006 23:49:53
- Free on drive D: 3397.78 mb
- Determining length of audio
--------------------------------------------------------
Analyzing: D:\PRU_OUT\MPlex_Muxed_File00.mpg
46.584 seconds D:\PRU_OUT\MPlex_Muxed_File00.mpg
Analyzing finished.
mp2 (Using Batch file): The code looks for mp2 sound and find ac3...
--------------------------------------------------------
- 29/01/2006 23:54:14
- Free on drive D: 3379.17 mb
- Determining length of audio
--------------------------------------------------------
Analyzing: D:\PRU_OUT\MPlex_Muxed_File00.mpg
0.000 seconds D:\PRU_OUT\MPlex_Muxed_File00.mpg
Analyzing finished.
jsoto
manolito
30th January 2006, 23:16
Of course it could just be that my own testing material didn't show up this problem so if you could get a few seconds of demonstrative audio to me, I'll see if I can do a more elegant fix.
I just uploaded couple of demo conversions to my web space. Get it under
http://scifi.pages.at/manolito/AC3_Test/AC3_Test.zip
Cheers
manolito
manolito
3rd February 2006, 15:29
DVD2SVCD code analyzes the mpg file to get the audio total length. It "knows" which kind of audio (mp2 or ac3) has to look for, but using the batch file, the code thinks it is mpeg, when actually it is ac3. So the total length reported is zero seconds--> no chapters.
Yes, this is true, but only if "Fixed Chapters every xx seconds" was selected. If your source is a DVD and "Use DVD chapters" is chosen, D2S determines the length of the audio correctly, even when the MP2 file is really an AC3 file.
Funny, but this actually makes it much easier to hack the authoring process, because we only have to deal with fixed chapters. I just hacked together a quick and dirty workaround which so far seems to work very well on my machine. Here is what I did:
First you need to create a template XML file for DVDAuthor which contains the command for fixed chapters. Those should cover movie lengths of maybe 4 hours or more. DVDAuthor does not complain if the actual movie is much shorter. My template.xml file looks like this:
<dvdauthor dest="I:\Movies\DVD-Files\">
<vmgm />
<titleset>
<titles>
<video format="pal" />
<audio lang="--" />
<pgc>
<vob file="I:\Movies\MPlex_Muxed_File00.mpg" chapters="00:00:00,00:06:00,00:12:00,00:18:00,00:24:00,00:30:00,00:36:00,00:42:00,00:48:00,00:54:00,01:00:00,01:06:00,01:12:00,01:18:00,01:24:00,01:30:00,01:36:00,01:42:00,01:48:00,01:54:00,02:00:00,02:06:00,02:12:00,02:18:00,02:24:00,02:30:00,02:36:00,02:42:00,02:48:00,02:54:00,03:00:00,03:06:00,03:12:00,03:18:00,03:24:00,03:30:00,03:36:00,03:42:00,03:48:00,03:54:00" />
<post> call vmgm menu; </post>
</pgc>
</titles>
</titleset>
</dvdauthor>
You see that I have fixed chapters of 6 minutes which is all I ever do. Save this file with the name "template.xml" and put it into your DVDAuthor folder.
The next thing we need is a batch file which D2S must call instead of DVDAuthor.exe I have called it "AC3_DVDAuthor.bat. Here is the file:
%SYSTEMROOT%\system32\find /C "chapters=""00:00:00"" />" %2
if not errorlevel 1 goto fixed:
goto doit
:fixed
copy "template.xml" %2
:doit
"dvdauthor.exe" %1 %2
Also save this file in the DVDAuthor folder. Then open D2S and under the DVD Image tab point the DVDAuthor entry field to this batch file.
All it does is analyze the DVDAuthor.xml file and determine if just one chapter at 00:00:00 was created. If yes then the template.xml file is copied over the DVDAuthor.xml file which gives us fixed chapters. Else the normal authoring will take place. Not too elegant, but there is room for improvement.
Please test and report bugs...
Cheers
manolito
//Edit: Simplified and renamed the batch file
ChickenMan
24th February 2006, 13:47
I've found a small bug/typo in AC3enc5.bat file. AC3enc5.bat never converts 44.1khz through to 48khz for me and I found an extra space in the line:
SET shibatch=-shibatch ( --rate 48000)
The space between the ch and ( should be remove, so line becomes:
SET shibatch=-shibatch( --rate 48000)
This now works fine for me :)
manolito
5th August 2006, 16:31
This is a slightly improved workaround for the AC3Enc chapter bug which occurs when fixed chapters are specified. Dowload at:
http://scifi.pages.at/manolito/AC3_DVDAuthor/AC3_DVDAuthor.zip
This version now works in batch mode, because it uses the DVDAuthor.xml file created by DVD2SVCD. It just replaces the chapter entries with the content of a "Chapters.ini" template file. A couple of template files for fixed chapters with a length of 4min, 6min and 10min are included.
Thanks to ChickenMan for testing!
Cheers
manolito
ChickenMan
6th August 2006, 13:18
Fantastic, thanks Manalito, it works great for me :) Now an avi containing mp2, mp3, wav or ac3 audio can be converted and authored complete with chapters and AC3 audio in the one step and even in Batch mode.
Nick
9th August 2006, 20:43
@Manolito: Can you use this script at all?
SET c=%2
SET c=%c:"=%
SET c=%c:dvdauthor.xml=%
TYPE "%c%\DVD.INI" |find "Length of Chapters" /i > temp.txt
FOR /f "tokens=1,2 delims==" %%a IN (temp.txt) DO SET ChapterLength=%%b
IF EXIST temp.txt DEL temp.txt
SET /a length=%chapterlength%
SET /a hrs1=0
SET /a hrs2=0
SET /a min1=0
SET /a min2=0
SET /a sec1=0
SET /a sec2=0
ECHO 00:00:00>chapters.ini
:gen
SET /a sec2=%sec2%+1
SET /a length=%length%-1
IF "%sec2%" == "10" SET /a sec1=%sec1%+1
IF "%sec2%" == "10" SET /a sec2=0
IF "%sec1%" == "6" SET /a min2=%min2%+1
IF "%sec1%" == "6" SET /a sec1=0
IF "%min2%" == "10" SET /a min1=%min1%+1
IF "%min2%" == "10" SET /a min2=0
IF "%min1%" == "6" SET /a hrs2=%hrs2%+1
IF "%min1%" == "6" SET /a min1=0
IF "%hrs2%" == "3" EXIT
IF "%length%" == "0" SET /p chapters=<chapters.ini
IF "%length%" == "0" ECHO %chapters%,%hrs1%%hrs2%:%min1%%min2%:%sec1%%sec2%>chapters.ini
IF "%length%" == "0" SET /a length=%chapterlength%
GOTO gen
If run from the DVDAuthor commandline, it determines the path of the output folder, extracts the chapter length as set in DVD2SVCD from the DVD.ini file and creates a custom chapters.ini file for your DVDAuthor.bat file.
Is there a way to/do you wish to incorporate this script into your batch file to fully automate the process?
Cheers
Nick
manolito
10th August 2006, 13:04
Nick, this is incredible. In my wildest dreams I could not imagine that anyone could do the secs to hh:mm:ss conversion with a simple batch file!
Of course I will integrate this into AC3_DVDAuthor.bat. I do have some time this afternoon, so I will report back later today / tonight.
Cheers
manolito
manolito
10th August 2006, 22:20
Alright, here we go:
%SYSTEMROOT%\system32\FIND /C "chapters=""00:00:00"" />" %2
IF NOT ERRORLEVEL 1 goto create
goto doit
:create
SET c=%~dp2
%SYSTEMROOT%\system32\FIND "Length of Chapters" /i "%c%DVD.INI" > temp.txt
FOR /f "tokens=1,2 delims==" %%a IN (temp.txt) DO SET ChapterLength=%%b
IF EXIST temp.txt DEL temp.txt
SET /a x=%ChapterLength% / 60
SET /a y=%x% * 60
SET /a z=%ChapterLength% - %y%
SET ChapterLength=%x%
IF %z% GEQ 30 SET /a ChapterLength=%x% + 1
If %ChapterLength% == 0 SET ChapterLength=1
SET /a length=%chapterlength%
SET /a hrs1=0
SET /a hrs2=0
SET /a min1=0
SET /a min2=0
SET /a sec1=0
SET /a sec2=0
SET chapters=00:00:00
:gen
SET /a min2=%min2%+1
SET /a length=%length%-1
IF "%min2%" == "10" SET /a min1=%min1%+1
IF "%min2%" == "10" SET /a min2=0
IF "%min1%" == "6" SET /a hrs2=%hrs2%+1
IF "%min1%" == "6" SET /a min1=0
IF "%hrs2%" == "4" GOTO sar
IF "%length%" == "0" SET chapters=%chapters%,%hrs1%%hrs2%:%min1%%min2%:%sec1%%sec2%
IF "%length%" == "0" SET /a length=%chapterlength%
GOTO gen
:sar
sed.exe "s/00:00:00/%chapters%/" %2 >temp.xml
COPY temp.xml %2
IF EXIST temp.xml del temp.xml
:doit
dvdauthor.exe %1 %2
As you can see, I did a couple of modifications to your code, mainly optimizing for speed. Most importantly, I restricted chapter creation to full minutes. On my machine it was terribly slow to run the loop for every second. I also scrapped the use of an intermediate "Chapters.ini" file, everything is done in memory now. I increased the maximum length to 4 hours (it happened to me once that I had to do an ecode which was more than 3 hours long).
The "find" command only works on my machine if I specify the full path. I have no idea why, I do have "Windows\System32" in my path. And you really should tell me how you managed to get the chapter length with the "for" command using "tokens" and "delims". The German Windows help is totally obscure about these commands, I could never have done this!
In my tests everything worked fine, I even did a torture test with 1min chapters with a 6 hour length limit. Please test and let me know what you think about it...
Cheers
manolito
manolito
11th August 2006, 00:40
Update:
I think I found a more elegant and much faster algorithm to convert seconds to hh:mm:ss. It uses div and mod operations, so the gen loop only occurs for each chapter point. Unlike the previous version this new version can create chapters at any second again.
%SYSTEMROOT%\system32\FIND /C "chapters=""00:00:00"" />" %2
IF NOT ERRORLEVEL 1 goto create
goto doit
:create
SET c=%~dp2
%SYSTEMROOT%\system32\FIND "Length of Chapters" /i "%c%DVD.INI" > temp.txt
FOR /f "tokens=1,2 delims==" %%a IN (temp.txt) DO SET ChapterLength=%%b
IF EXIST temp.txt DEL temp.txt
SET /a length=%chapterlength%
SET chapters=00:00:00
:gen
SET /a hh=%length% / 3600
If %hh% LSS 10 SET hh=0%hh%
IF %hh% == 04 GOTO sar
SET /a x=%length% %% 3600
SET /a mm=%x% / 60
IF %mm% LSS 10 SET mm=0%mm%
SET /a ss=%x% %% 60
IF %ss% LSS 10 SET ss=0%ss%
SET chapters=%chapters%,%hh%:%mm%:%ss%
SET /a length=%length% + %chapterlength%
GOTO gen
:sar
sed.exe "s/00:00:00/%chapters%/" %2 >temp.xml
COPY temp.xml %2
IF EXIST temp.xml del temp.xml
:doit
dvdauthor.exe %1 %2
Cheers
manolito
manolito
11th August 2006, 14:35
Well, I believe this thing is ready for release now. Get it at:
http://scifi.pages.at/manolito/AC3_DVDAuthor/AC3_DVDAuthor.zip
I did some more testing, and I could not even break it with 30sec chapters for 4 hours. For "normal" chapter lengths speed is quite acceptable even on my slooooow Celeron 1.1GHz.
I had one more improvement in mind, but I gave up on it. It would be nice to extract the movie length from one of the INI files and create chapters only up to the actual movie length. When using QuEnc or CCE 2.67 this would work because the D2S project file has the length. But when using CCE 2.70 the value for length is always 0, and I have no idea what happens when using Procoder.
Speed improvement would be minimal, so I think the whole idea is not worth bothering.
@Nick
If you like the plugin, maybe you could include it in your AC3Enc archive. It is your baby after all, and you also did most of the work :D
Cheers
manolito
Nick
11th August 2006, 17:47
Done.
http://nickspage.pwp.blueyonder.co.uk/AC3Enc6+AC3_DVDAuthor.zip
Thanks for the extra work to slim down the scripts and get rid of my slow and cumbersome chapter routine. I notice you've also junked the chapters.ini file. I only retained this as my crude integration was to save the script I posted as a chap.bat, then put "chap.bat" at the start of your original batch file and "del chapters.ini" at the end. Clearly to integrate the two scripts into one does away with the need for it. However, I was short on time and brain power at the time.
And you really should tell me how you managed to get the chapter length with the "for" command using "tokens" and "delims"
Way OT, my friend so I'll do that by PM :)
Nick
18th March 2007, 14:24
OK. Not visited this for a while, but we have an update.
Some time ago I experimented with Aften to do the AC3 encoding but whilst it solved many problems with AC3Enc, it introduced some others.
However, manolito alerted me to progress on Aften and I am bowled over by the latest build. So we're now using it.
Link updated in the initial post for the new version of the plugin.
manolito
19th March 2007, 15:26
Thanks Nick!
I did a few more encodes using the latest Aften, and it looks like I am going to do all my (PAL) encodes with AC3 audio instead of MPEG audio from now on.
Cheers
manolito
Nick
19th March 2007, 19:26
Cool. It opens up a lot of handy possibilities - like NTSC2PAL with 5:1 audio but minimal quality loss.
Just one thing, re the DVDAuthor files. I am not routinely using Sir Didymus's Muxman plugin, although I have tested it. Do we have a way out of the chapter bug problem with this, to do AC3 audio and Muxman muxing with chapters?
manolito
19th March 2007, 22:04
Just one thing, re the DVDAuthor files. I am not routinely using Sir Didymus's Muxman plugin, although I have tested it. Do we have a way out of the chapter bug problem with this, to do AC3 audio and Muxman muxing with chapters?
Shame on you, it should be required by law for everyone using D2S to also use Muxman. :eek:
But seroiusly, the chapter issue caused by the AC3Enc plugin only applies to DVDAuthor. With the BatchMux plugin chapters were created correctly from the beginning. No problem at all.
The only exception is when using CCE 2.70 together with BatchMux. In this case BatchMux cannot create fixed chapters, because D2S cannot determine the movie length from the 2.70 ECL format.
But this issue is also solved. Have a look here:
http://forum.doom9.org/showthread.php?p=971974#post971974
This little batch file fixes the chapter issue for CCE 2.70 plus gives you automatic PAL to NTSC conversions from within D2S.
I have a question regarding NTSC to PAL conversions with D2S. So far I had never tested this until a couple of days ago while testing your AC3Enc plugin with Aften. I used an interlaced NTSC source, and the quality of the encode was simply unacceptable. The log files revealed what was going on: D2S handled the conversion by just slowing down everything by almost 20%, then the audio pitch was corrected back to the original pitch. My source was a Jazz concert show, and it looked and sounded terrible.
Do you know if D2S does the same for progressive (film) sources? I think those sources should be IVTC'd and sped up to 25 fps instead of using AssumeFPS to slow down everything.
Anyway, the PAL to NTSC direction is much more useful for me, and the method I implemented (DGPulldown) gives very nice results.
Cheers
manolito
Nick
20th March 2007, 00:41
Yeah. 29.97->25 fps conversions are terrible!
For film sources, select IVTC in the DGIndex tab and then it'll do it correctly.
For the record I tend to author manually as I never really liked MPlex. I set it to No Images in the authoring tab and direct to an empty batch file in the Multiplexer tab. I know Muxman works but I've gotten so used to the flexibility of manual authoring that I don't see a need to automate it.
Just personal preference and no snub on Sir Didymus's fine plugin :).
But it does explain why the whole chapter bug thing had to be pointed out to me...
jolson
26th March 2007, 19:34
Are these batch files mainly meant for use if you have MPEG audio in your source but want to output a DVD with AC3 audio? Or also if the source already is AC3? Is there a "chapter bug" to fix in both cases?
manolito
27th March 2007, 19:54
This "chapter bug" only occurs if you use Nick's AC3Enc.bat to get AC3 output plus you have selected "fixed chapters" plus you use Mplex / DVDAuthor for muxing and authoring.
If the source audio already is in AC3 format and you ticked "Keep original audio" in DVD2SVCD then there will be no chapter bug of course. But if your source audio is AC3 and you use AC3Enc.bat to convert the source AC3 audio to another AC3 audio file with a different bitrate, then you might get this issue.
A sure way to avoid the AC3Enc "chapter bug" is to use the BatchMux plugin by Sir Didymus for muxing and authoring. This is highly recommended, because Mplex has many issues which could lead to stuttering when playing the resulting DVD.
Cheers
manolito
lordkinbote
14th April 2007, 22:03
Hi guys,
I've never gotten this to work for me. I use D2SRoba and when it's running BeSweet on the audio the first time, D2SRoba just keeps going and starts up CCE. Goes right into the video encoding before BeSweet is finished and then after it finishes, the second BeSweet window opens listing Aften in it, saying:
---------------------------------------------
Aften: A/52 audio encoder
Version SVN
(c) 2006-2007 Justin Ruggles, Prakash Punnoor, et al.
input format: Signed 16-bit 48000 Hz 5.1 Channel
output format: 48000 Hz 3/2 + LFE
[00:00:00:096] transcoding...
--------------------------------------
and it just hangs there. D2S keeps going with encoding the video and it finishes with that Aften BeSweet window still hanging. I was trying to use the D2S_CCE2.70 plugin so that I could do PAL2NTSC conversion while keeping AC3 sound but the resulting MPlex_Muxed_File00.mpg only comes out to 12kb.
It would not surprise me if I didn't set up something correctly but I've read over and over the Readme files of all the plugins and don't see what I might've done wrong. Anyone have any clues?
manolito
15th April 2007, 17:19
Hi lordkinbote,
you just might have discovered an issue with the specific build of Aften.exe which is included in Nick's archive. I tried to reproduce your task, and a couple of times (not every time) Aften would not close itself. Replacing this build of Aften with the stable version 0.6 or with the latest build 484 took care of this problem on my computer.
You can download these builds here:
http://kurtnoise.free.fr/index.php?dir=Aften/
Please let us know if this works for you.
The other things you mention are "not bugs, but features". When you select 6ch AC3 output, Besweet has to be called twice, and the only way to make this work is to call Besweet with the "Start" prefix for the second run. This will result in having the audio encoder and the video encoder run simultaneously. Maybe not too elegant, but it works.
Getting a 12 kb "MPlex_Muxed_File00.mpg" is also normal if you use BatchMux. This is just a dummy file which DVD2SVCD needs to continue. Muxman does the muxing and authoring in one step, so you will not get a muxed MPEG file at all. All you get is the final "VIDEO_TS" folder.
Cheers
manolito
lordkinbote
15th April 2007, 17:25
Thanks, Manolito!
I'll give the new Aften a try right now.
But, the Muxman thing might be a problem because i like to author my mpegs myself. I like to put 4 mpegs from converted AVIs on one DVD with menus and such. Perhaps I can just use the finished audio files and finished video files in my authoring, but if they were muxed, I could see if there were any sync issues.
Do you have any suggestions for other ways to convert PAL AVI to NTSC with keeping the AC3 sound? I'd been converting with the method stated in the forums to use D2SRoba in SVCD mode which uses an altered version of the BeSweetLater.bat and a small created pal2ntsc.avs file. It only give stereo audio though which is why I was looking for another alternative. As you may be able to tell, the resulting MPEG for me does not need to be DVD compliant since although I use D2SRoba in SVCD mode, I put the max bitrate to 8000 so I can specify the CD size of the mpeg I want.
EDIT: Okay, the new version of Aften didn't work for me either. I guess for now I will just stick with my PAL to NTSC conversions having stereo sound.
jolson
15th April 2007, 18:42
Another thing:
I have used D2SRoBa/DVD2SVCD several times to convert standard AVI files with AC3 audio to DVD, and it works good.
If the source isn't a standard AVI, I have used GraphEdit/avs scripts and "AviSynth frameserved" to the MPEG2 encoder. But then it's a lot of manual work left, which DVD2SVCD does so well...
So - is there a way to use DVD2SVCD even if the source isn't an XviD/DivX AVI (but something that's playable in GraphEdit/DirectShowSource'able to Avisynth)? I can think of a couple of possibilities:
* Extract the AC3 audio and encode the m2v file, set up DVD2SVCD as if this was just done using DVD2SVCD and then do "Recover Pulldown".
* Fool DVD2SVCD into thinking it really gets an AVI file by frameserving through VFAPI.
I have however no experience with either of these methods, and from what I understand frameserving with AviSynth to DVD2SVCD doesn't work.
Any help/ideas?
Nick
15th April 2007, 20:01
I use the VFAPI method very succesfully.
It's slow as hell though.
Open a new thread if you can't get it to work - we're veering off topic here.
New build
-Updated to Aften 0.07 (wisodev's build)
-Updated bsn.dll (13/5/07 version) - fixes 2h4min length limit for 5.1 conversions.
-Added "-readtoeof 1" to the MPEG51 Atfen commandline to help with the long files issue
-Fixed the untidy 5.1 encoding where it ran concurrently with video encoding.
-Compiled the scripts to executables
-Added an installer which (hopefully) installs all the files to the correct places and updates dvd2svcd.ini to change the paths for BeSweet and MPEG51. executables.
-No longer produces the lengthy and useless MPEG51_log.txt file.
-AC3_DVDAuthor.bat becomes DVDAuthor.exe and the real DVDAuthor.exe is renamed DVDA.exe. The rationale for this is if you previously used DVDAuthor, it now uses the plugin, if you used AC3_DVDAuthor, the installer corrects the ini file to use the plugin, whereas if the DVDAuthor executable is set to anything else, it remains that way. Thus things such as the BatchMux plugin are unaffected by the installation of this plugin.
http://nickspage.pwp.blueyonder.co.uk/AC3EncSetup.exe
manolito
18th May 2007, 11:59
Great!
Just did a couple of tests with the new version, installation and encoding worked perfectly all the time. A big THANK YOU
Cheers
manolito
bionic
18th May 2007, 12:25
Testing as i post, so far so good, A big thank you from me too.
Simply excellent :)
ChickenMan
18th May 2007, 12:58
Same as Manolito and Bionic, working well here also :) Keep up the good work Nick :)
Just out of curiosity, what version of aften 0.07 is included, just the MMX version or SSE, SSE2 or SSE3 ?
manolito
18th May 2007, 13:57
Just out of curiosity, what version of aften 0.07 is included, just the MMX version or SSE, SSE2 or SSE3 ?
Neither one, it is the "PGO" version which is not even optimized for MMX (but is the most compatible version). Have a look here:
http://forum.doom9.org/showthread.php?p=998384#post998384
But of course you can download an optimized build from Wisodev which fits your CPU better :)
Cheers
manolito
Oops.
Slight oversight on my part.
The option to uninstall previous versions also deletes the AC3Enc.dll which was part of the BeSweet package, not the plugin.
I have fixed this issue and uploaded the file to my webspace overwriting the old file, so subsequent downloads will not be affected.
At any rate, the advent of Aften has rendered the old ac3enc.dll pretty much obsolete, but if you've downloaded the plugin installer already, ac3enc.dll is gone and you want it back download it here
http://dspguru.notrace.dk/BS_ac3enc.zip
bionic
20th May 2007, 20:12
Cool, thanks didnt even notice :)
More major oversight on my part.
Bundled the wrong version of MPEG51 executable. The long files issue therefore returned for 5.1 to 5.1 conversions.
Not sure how I managed that but thanks to Manolito for the spot.
Now corrected but will require redownload and reinstall.
Sorry for the inconvenience.
EDIT - Manolito also mentioned some virus scanners seem to flag the plugin executables as suspicious. Not sure why this would be as they are just the original batch scripts run through a compiler. If people find this causes problems I'll just return to batch files.
EDIT AGAIN - had further reports of virus scanner problems. Returned to batch files. The installer has been changed to undo any changes made by previous versions and delete the executables. As for DVDAuthor, this returns to its original name and the file AC3_DVDAuthor.bat is used instead. The installer now checks for presence of the Batchmux plugin, and in its absence changes the configuration to use the batch file.
http://nickspage.pwp.blueyonder.co.uk/AC3EncSetup.exe
bionic
20th May 2007, 22:55
Yeah kav, avg, bitdefender and others, attached is a screenshot of a virustotal scan of the new ac3 dvdauthor.exe
Im betting upx is the "culprit".
And thanks :)
Edit: I see you have already reverted to .bats. Considering the popularity of the antivrius engines reacting to upx i absolutely see the point, but wouldnt perhaps a note in the readme suffice, doesnt matter really.. i just kinda liked the exe versions :)
manolito
21st May 2007, 13:18
Just FYI:
Kurtnoise just came out with a new compile of Aften 0.07 rev 511. Works beautifully with this plugin...
Get it here: http://kurtnoise.free.fr/index.php?dir=Aften/&file=aften_rev511.zip
Cheers
manolito
ChickenMan
25th May 2007, 09:12
Its now revision 512 :) http://kurtnoise.free.fr/index.php?dir=Aften/
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.