Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Nov 2010
Posts: 15
|
Convert multi language DVD using ffmpeg
I try to convert a multi language DVD movie into an mkv or ogv video, with the first 2 audio tracks using ffmpeg.
I copied the VOBs of a DVD to the harddrive (using MS-W and ripit4me and DVDDecrypter since I cannot get it to work on Linux alone, I tried installing libdvdcss-1.4.0-x86_64 but the VOBs are still not readable, not even for the "file" command. See also here: http://forum.doom9.org/showthread.php?=t=1753332 ) This is the info I get via playing the merged VOB files of the main video (I merged the main VOBs into one single VOB file using "cat Whatever*.VOB > P_V0.VOB" and played it via mpv to get the below info) Code:
Playing: P_V0.VOB (+) Video --vid=1 (mpeg2video 720x576 25.000fps) Subs --sid=1 (dvd_subtitle) Subs --sid=2 (dvd_subtitle) VO: [opengl] 720x576 => 1024x576 yuv420p (+) Video --vid=1 (mpeg2video 720x576 25.000fps) Audio --aid=1 (ac3 6ch 48000Hz) Audio --aid=2 (ac3 6ch 48000Hz) Audio --aid=3 (ac3 6ch 48000Hz) Audio --aid=4 (ac3 2ch 48000Hz) Subs --sid=1 (dvd_subtitle) Subs --sid=2 (dvd_subtitle) Subs --sid=3 (dvd_subtitle) (+) Video --vid=1 (mpeg2video 720x576 25.000fps) Audio --aid=1 (ac3 6ch 48000Hz) Audio --aid=2 (ac3 6ch 48000Hz) Audio --aid=3 (ac3 6ch 48000Hz) Audio --aid=4 (ac3 2ch 48000Hz) Subs --sid=1 (dvd_subtitle) Subs --sid=2 (dvd_subtitle) Subs --sid=3 (dvd_subtitle) Subs --sid=4 (dvd_subtitle) Subs --sid=5 (dvd_subtitle) Subs --sid=6 (dvd_subtitle) V: 00:00:04 / 00:00:00 (0%) Cache: 14s+73MB Invalid video timestamp: 4.920000 -> -0.033367 V: 00:00:03 / 00:00:00 (0%) Cache: 11s+73MB Track switched: (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (ac3 6ch 48000Hz) Audio --aid=2 (ac3 6ch 48000Hz) Audio --aid=3 (ac3 6ch 48000Hz) Audio --aid=4 (ac3 2ch 48000Hz) Subs --sid=1 (dvd_subtitle) Subs --sid=2 (dvd_subtitle) Subs --sid=3 (dvd_subtitle) Subs --sid=4 (dvd_subtitle) Subs --sid=5 (dvd_subtitle) Subs --sid=6 (dvd_subtitle) Code:
Audio --aid=1 (ac3 6ch 48000Hz) ENG <- KEEP! map:0 Audio --aid=2 (ac3 6ch 48000Hz) DEU <- KEEP! map:1 Audio --aid=3 (ac3 6ch 48000Hz) jap Audio --aid=4 (ac3 2ch 48000Hz) jap-Audio-Commentary I try to first cut off some stuff at the beginning ( "-ss 1:15.500" ), and create a 30 seconds test sample to see if ffmpeg gets it all right, especially in adding the two audio tracks. I first want a stream copy with includes the main video (video0) and the first two audio tracks (audio0 = ENG and audio1 = DEU). But I seem not to be able to get it right, I read the ffmpeg documentation ( http://ffmpeg.org//ffmpeg.html ), and also some posts about mapping on superuser.com and video.stackexchange.com, but so far to no prevail. Code:
ffmpeg -y -v error -ss 1:15.500 -i P_V0.VOB -map 0:0 -map 0:1 -c:a ac3 -codec copy -acodec copy -t 30 P_V1_30s.mpg [mpeg @ 0x2540de0] Invalid media type data for output stream #0 Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument $ ffmpeg -y -v error -ss 1:15.500 -i P_V0.VOB -map 0 -codec copy -acodec copy -t 30 P_V1_30s.mpg [mpeg @ 0x1a71b20] Invalid media type data for output stream #0 Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument $ ffmpeg -y -v error -ss 1:15.500 -i P_V0.VOB -map 0:0 -map 0:1 -codec copy -t 30 P_V1_30s.mpg [mpeg @ 0xe5fae0] Invalid media type data for output stream #0 Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Code:
time ffmpeg -y -v error -ss 1:15.500 -i P_V0.VOB -codec copy -t 30 P_V1_30s.mpg real 0m3.239s user 0m0.915s sys 0m0.815s But for some reason (unknown to me reason, that is), the resulting test 30 seconds file has only video and lacks any audio: Code:
$ mpv P_V1_30s.mpg Playing: P_V1_30s.mpg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) VO: [opengl] 720x576 => 1024x576 yuv420p V: 00:00:06 / 00:00:30 (20%) Cache: 10s+11MB What do I do wrong trying to use -map to include the 1st and 2nd audio track (aka audio0 and audio1) ? |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Jan 2018
Posts: 6
|
Your stream specifiers are way off. It's best to specify stream specifiers with the type, as otherwise you end up with something unexpected.
The easiest way to map all audio streams, for example is to include Code:
-map 0:a Code:
ffmpeg -i P_V0.VOB -map 0:v:0 -map 0:a -codec copy foo.mkv |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Nov 2010
Posts: 15
|
@all
(I know I reply to an old post, but it is my thread and I want to share the info with others who might lurk.) What works in the above example would be e.g. Code:
ffmpeg -i P_V0.VOB -map 0:v:0 -map 0:a:0 -map 0:a:1 -codec copy foo.mkv Since I need a larger -probesize and -analyzeduration or else I would get an error I had to use this: Code:
ffmpeg -v error -y -probesize 100000000 -analyzeduration 100000000 -i P_V0.VO -q:v 10 -map 0:v -map 0:a:0 -map 0:a:1 -vf yadif,scale=w=iw/1.2:h=ih/1.2 P_V0.mkv Code:
ffmpeg -v error -y -probesize 100000000 -analyzeduration 100000000 -i P_V0.VO -q:v 10 -map 0:v -map 0:a:0 -map 0:a:1 -vf yadif,scale=w=iw/1.2:h=ih/1.2 -t 240 P_V0.mkv I used " -v error " to only include severe errors after I eliminated all basic mistakes first. A test run of only a few minutes is usually recommended since the main decode takes a long time, and then realizing something went wrong would be annoying, since you had to repeat it all. But a test decode takes only a few minutes. Still ffmpeg reported some errors: Code:
[mpeg2video @ 0xf3ff40] ac-tex damaged at 43 0 [mpeg2video @ 0xf3ff40] Warning MVs not available [mpeg2video @ 0xf3ff40] ac-tex damaged at 24 32 [mpeg2video @ 0xf3ff40] Warning MVs not available [ac3 @ 0xdd8c80] expacc 125 is out-of-range [ac3 @ 0xdd8c80] error decoding the audio block Error while decoding stream #0:2: Error number -16976906 occurred [ac3 @ 0xae7940] exponent -2 is out-of-range [ac3 @ 0xae7940] error decoding the audio block Error while decoding stream #0:3: Error number -16976906 occurred [ac3 @ 0xaaad00] exponent -1 is out-of-range [ac3 @ 0xaaad00] error decoding the audio block Error while decoding stream #0:4: Error number -16976906 occurred [ac3 @ 0xdd8c80] exponent 25 is out-of-range [ac3 @ 0xdd8c80] error decoding the audio block Error while decoding stream #0:2: Error number -16976906 occurred [ac3 @ 0xae7940] exponent 26 is out-of-range [ac3 @ 0xae7940] error decoding the audio block Error while decoding stream #0:3: Error number -16976906 occurred [ac3 @ 0xaaad00] incomplete frame Is e.g. Code:
[mpeg2video @ 0xf3ff40] ac-tex damaged at 43 0 Or at 0:00:43.0 meaning 43 seconds frame 0? But the later cannot be, since when I did the test run of 240 seconds there was no error mentioned. Or is @ 0xf3ff40 the reference to the position where the error occurred? If so, how does 0xf3ff40 translate into the human readable form of HH:MM:SS.f (f stands for frame) ? Last edited by ravs; 26th March 2020 at 23:44. |
![]() |
![]() |
![]() |
Tags |
ffmpeg dvd multi-language |
Thread Tools | Search this Thread |
Display Modes | |
|
|