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.

 

Go Back   Doom9's Forum > General > Linux, Mac OS X, & Co

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 22nd March 2018, 20:16   #1  |  Link
ravs
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)
These are the audio tracks, and I want to only keep audio0 and audio1:
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 did add the info after the Hz entry, that was not part of the info by mpv)

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
That seemed to have worked, butů there is no audio. Unlike the ffmpeg documentation which says, unless you use the -map options, one video and one audio track is used, the video with the largest resolution, and the audio with the most tracks, and if there are more audio tracks, the one with the lowest index. Which should be in my case: audio 0, aka ENG.

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
Why is there no audio when using -codec copy ? Using -codec copy and -acodec copy has the same result: no audio, the resulting mpg only has video.

What do I do wrong trying to use -map to include the 1st and 2nd audio track (aka audio0 and audio1) ?
ravs is offline   Reply With Quote
 

Tags
ffmpeg dvd multi-language

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.