Last active
August 2, 2024 13:56
-
-
Save andreasbotsikas/8bad3df5309dd0383f2e2c450b22481c to your computer and use it in GitHub Desktop.
Convert DVD to mp4 using ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Your script works perfectly. One small thing I would like it to do is copy the timestamps as well.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jmb-2022 I was converting old personal dvds, so I didn't have any subtitles. It seems that ffmpeg can export subtitles with something like:
Never tried it though. Feel free to reply with your solution.