Skip to content

Instantly share code, notes, and snippets.

@abubelinha
Forked from andreasbotsikas/Vob2Mp4.bat
Created March 6, 2024 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abubelinha/db944bc9e4696853b9916511b1e867df to your computer and use it in GitHub Desktop.
Save abubelinha/db944bc9e4696853b9916511b1e867df to your computer and use it in GitHub Desktop.
Convert DVD to mp4 using ffmpeg
REM Download ffmpeg from https://www.ffmpeg.org/download.html.
REM Place ffmpeg.exe in the folder with the vob files
REM Merge all vob files into one
REM VTS_01_0.VOB is usually the menu which you may not want
if exist VTS_01_7.VOB (
copy /b VTS_01_1.VOB+VTS_01_2.VOB+VTS_01_3.VOB+VTS_01_4.VOB+VTS_01_5.VOB+VTS_01_6.VOB+VTS_01_7.VOB ConCat.vob
) else if exist VTS_01_6.VOB (
copy /b VTS_01_1.VOB+VTS_01_2.VOB+VTS_01_3.VOB+VTS_01_4.VOB+VTS_01_5.VOB+VTS_01_6.VOB ConCat.vob
) else if exist VTS_01_5.VOB (
copy /b VTS_01_1.VOB+VTS_01_2.VOB+VTS_01_3.VOB+VTS_01_4.VOB+VTS_01_5.VOB ConCat.vob
) else if exist VTS_01_4.VOB (
copy /b VTS_01_1.VOB+VTS_01_2.VOB+VTS_01_3.VOB+VTS_01_4.VOB ConCat.vob
) else if exist VTS_01_3.VOB (
copy /b VTS_01_1.VOB+VTS_01_2.VOB+VTS_01_3.VOB ConCat.vob
) else if exist VTS_01_2.VOB (
copy /b VTS_01_1.VOB+VTS_01_2.VOB ConCat.vob
) else (
copy /b VTS_01_1.VOB ConCat.vob
)
REM Store the name of the folder
for %%I in (.) do set CurrDirName=%%~nxI
REM Convert that single vob into mp4
ffmpeg -loglevel warning -i "ConCat.vob" -codec:a copy -codec:v libx264 "%CurrDirName%.mp4"
REM I run into an issue with one DVD where audio was encoded with pcm_dvd
REM which is not supported by x264
REM Stream #0:2[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536 kb/s
REM To fix that, I encoded audio as well (instead of copy done above)
REM ffmpeg -i "ConCat.vob" -codec:a ac3 -codec:v libx264 "ConCat.mp4"
REM Wait for input to exit batch
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment