View Full Version : Convert DV files to ????
Ghitulescu
23rd July 2009, 12:43
Ahhh still got the original PAL DV - and for now I've transcoded to MPEG-2 @ 15Mbps CBR / I-Frames only with TMPGenc.....
You finally got the solution.
2Bdecided
23rd July 2009, 17:47
If you want to encode MPEG-2, there are plenty of other tools that will avoid TMPGenc's limitations.What's drag-and-drop-able or batch-able from DV AVI to MPEG-2? No intermediate stages or mouse clicks.
(Free would be good).
Cheers,
David.
smok3
23rd July 2009, 21:19
you would write a batch file that would:
1.
a. make temporary avisynth for dv avi files
b. determine if the dv is either 4:3 or 16:9 (mediainfo)
c. send all that to the hcenc with some correct encoding parameters (i think you can stuff everthing to the command line with later versions of hcenc, so no ini files needed)
d. convert audio and mux with video
or
2.
a. use mencoder to do the job
or
3. (payware)
a. use something like procoder
2Bdecided
23rd July 2009, 21:40
AFAICT 2 isn't much easier than 1!
...and my .BAT scripting skills certainly aren't good enough for 1.
Cheers,
David.
smok3
23rd July 2009, 21:53
i can give it a try tommorow maybe, what kind of audio is prefered? pcm?
2Bdecided
24th July 2009, 07:01
mp2 for me, but YMMV OP.
Ghitulescu
24th July 2009, 08:34
For an amateur made footage, there is no sensible difference between MP2 and LPCM. If you plan to rework the footage later, use LPCM, if not use MP2 (or AC3 if you're American ;)).
smok3
24th July 2009, 12:09
HCencDVauto.bat
:: convert interlaced DV avi to interlaced mpeg2/mp2 dvd compatible stream
:: config
:: hcenc path
set hcenc=t:\utility\HC022\HCenc_022.exe
:: dependencies
:: avisynth and soundout plugin in the autoloading plugins folder
:: mediainfo.exe (on system path)
:: virtualdub.exe (on system path)
:: hcenc, set path in config
:: mplex.exe (on system path)
echo off
:: 01 get aspect ratio
:: get aspect ratio, 4:3 = 1.778, 16:9 = 1.333
:: and convert that to some sensible string for hcenc (4:3 or 16:9)
mediainfo --Inform=Video;%%DisplayAspectRatio/String%% %1 > temp.txt
set /P DAR=<temp.txt
del temp.txt
echo %DAR%
if %DAR% ==4/3 (
set DAR2=4:3
)
if %DAR% ==16/9 (
set DAR2=16:9
)
echo %DAR2%
:: 02 make temporary avs script for feeding to hcenc
echo aviSource("%~f1") > %~n1_HC.avs
echo ConvertToYV12 >> %~n1_HC.avs
:: 02b make temporary avs script for audio encoding
echo aviSource("%~f1") > %~n1_audio.avs
echo SoundOut(output="mp2", showprogress=true, overwritefile="Yes", wait=2, filename="%~f1.mp2", autoclose = true, mode=2, cbrrate=384)>> %~n1_audio.avs
:: 02c convert audio to mp2 (abuse virtualdub to touch the avs)
virtualdub %~n1_audio.avs /x /min
:: 03 encode video with hcenc
%hcenc% -i %~n1_HC.avs -o %~n1_HC.m2v -aspectratio %DAR2% -profile normal -dvsource -maxbitrate 8000 -cq_maxbitrate 5.000
:: 04 muxing with mplex
mplex -f 8 -o "%~n1.mpg" "%~f1.mp2" "%~n1_HC.m2v"
:: 05 deleting tmp files
@Echo on
echo.
del "%~f1.mp2"
:: only delete unmuxed video file if the muxed file exist
if exist "%~n1.mpg" (
del "%~n1_HC.m2v"
)
del "%~n1_HC.avs"
del "%~n1_audio.avs"
:: end
known issues:
.soundout plugin will cry if it can't find an audio file (needs unnecessary user intervention), this could be solved by finding better soundout defaults or maybe checking the file ifsound=true before that...
.stereo 48kHz input is expected
.mediainfo DAR detection may fail (not tested that much & the code is pretty dumb)
.only tested with PAL DV footage
HCencDVauto_tcm.bat
for /f "delims=++" %%i in (%1) DO HCencDVauto.bat %%i
usage:
a. drop all dependencies somewhere on the system path
b. config the hcenc path
c. test from cli,
HCencDVauto file.avi
d. make sure HCencDVauto.bat is also somewhere on the system path
e. attach HCencDVauto_tcm.bat to total commander, like so (edit start menu or make a button):
Command: T:\path\HCencDVauto_tcm.bat
Parameters: %L
you can now select avi files in any pane and click the button/menu entry you just did to start the process (this will only work on multiple files, can't browse over dirs)
illustration;
http://somestuff.org/HCencDVauto.bat.png
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.