Hello,
I'm having a hard time finding a solution to my problem.I've been searching online for about a month,with no success.Opening a thread here is my last resource,I don't know what else to do... Let me explain to you what is this all about:
I want to remux audio from a dvd with video from a blu ray into a mkv file.
Regarding the blu ray: I've got a h264 file(23,976 fps) ripped from the blu ray using ffmpeg.
Regarding the DVD: I've used DVDFab to decrypt and copy the entire dvd structure to my hard disk.I then used ffmpeg to extract the audio untouched with...
ffmpeg -i "concat:VTS_01_1.VOB|VTS_01_2.VOB..." -map 0:2 -c copy Audio.ac3
The muxing process:
I tried both ffmpeg and mkvmerge for muxing audio and video.I've had to adjust the timecodes parameter in mkvmerge in the video track to 25 fps (the audio track comes from a PAL DVD).
The result in both cases is an audio shrinked by 1 second (approximately).It's not a constant delay,as the audio goes in sync at the beginning... I've been using mkvmerge for quite a while and I've never had a problem when doing these type of things.I've tried everything... I used DVDFab and second ripping tool,I used mkvmerge and ffmpeg for the muxing process thinking that it could be a mkvmerge issue but I always get the same result.The strange thing is that this has happened to me with a couple of dvd's already and the result is always the same: audio track shrinked by 1 second...
What's even more strange... I tried to do:
ffmpeg -i "concat:VTS_01_1.VOB|VTS_01_2.VOB..." -c copy File.vob
... to see if the problem came from the joining process and it doesn't.The resulting vob file plays fine,the audio is in sync during the whole movie.I don't know what else to do... I can't spot the source of the problem.
I also tried to stretch the audio by 1 second but while it goes in sync with the video at the end,it now loses sync in another spot of the movie.This leads me to think that it could something regarding the timecodes... but the strange thing is that this is not the first DVD I'm having problems with.
Can anybody help me with this?Thank you.
+ Reply to Thread
Results 1 to 16 of 16
-
Last edited by nicksla; 2nd Dec 2014 at 10:55.
-
I'm under Mac... I've used ffmpeg,dvdfab ,winx dvd ripper,avidemux... to extract the audio track.Same result in all cases.I've also try to do it directly loading the first vob file in mkvmerge but I get the same result.
As a second note: I ripped the dvd to mkv using ffmpeg to see if anything changes...
ffmpeg -i "concat:VTS_01_1.VOB|VTS_01_2.VOB..." -map 0:1 -map 0:2 -c:v libx264 -c:a copy -crf 22 -preset medium -threads 4 Film.mkv
And I ended up with a mkv file with an audio perfectly in sync throughout the whole movie.What the hell is going on here?Last edited by nicksla; 2nd Dec 2014 at 11:40.
-
Thank you Baldrick... I posted the question there because all the tools I used are available in windows too and I think this is more of a general problem rather than a os kind of thing.
-
I don't. If you were on a Windows machine you'd have better tools available. Like PGCDemux.
And why speed up the video to begin with? Why not slow the audio to film speed? And how do you know the audio was a second shorter after demuxing? Only because it doesn't mux in synch? Are you sure both the 23.976fps and 25 fps versions of the film have the exact same number of frames? If they don't, then the out-of-synch problem could (also) be caused by the framecount mismatch.
And you're sure your video source isn't 24fps, rather than 23.976fps? -
To add to what manono is saying, they could be different edits (e.g. director's cut), or one might have a longer studio logo at the beginning etc....
Check the durations of the demuxed BD audio, and the demuxed DVD audio. You can use mediainfo or better - an audio editor e.g. audacity to look at the waveforms to see where they don't match -
I always tend to speed up video instead of touching up audio.In this case,I tried to change tempo of audio using Audacity just to see if it does make any different but same result...
"And how do you know the audio was a second shorter after demuxing? Only because it doesn't mux in synch?"Because at the beginning of the movie,video and audio are perfectly in sync and from 1:16:00 to the end,audio is 1 second ahead of video.The number of frames are not the same because of the logo at the beginning.I had to apply a delay in mkvmerge just to make sure both audio and video started in sync... if the fps are the same,audio should play fine and in sync throughout the whole movie and this is not the case.
"And you're sure your video source isn't 24fps, rather than 23.976fps?"That doesn't make any difference because I use the timecodes parameter in mkvmerge forcing the video to play at 25fps...
PD. Same edits in this case,no director's cut or anything... -
Why anyone would put up with PAL speedup when they don't have to is beyond me. But then I'm in NTSC (film) land.
Because at the beginning of the movie,video and audio are perfectly in sync and from 1:16:00 to the end,audio is 1 second ahead of video.
It's not a constant delay,as the audio goes in sync at the beginning...
Add a second's worth of silence at that point to the audio to put it back into synch. Cut the audio at that place, add silence to the end of the first part or the beginning of the second part, and join the two pieces back together. I have no idea if that can be done on a Mac.Last edited by manono; 2nd Dec 2014 at 15:58.
-
Did you compare the waveforms / durations ? Speed one up (e.g. the BD audio), then line up the beginning of the two audio tracks after the logo (start of the real movie). If what you say is correct, they should match up. If they don't match, it's not a muxing problem
If you think it's a mkv timecode issue (I doubt it is, because this procedure had worked for you before on other movies) , then you can patch the elementary stream to 25 FPS, instead of using mkvmerge to speed it up . One way to do this is using this modified ffmpeg build
http://forum.doom9.org/showthread.php?t=152419 -
-
-
If I understand you correctly, you're saying you did try demuxing the DVD VOBs followed by remuxing, with everything winding up in synch. I can't test for myself as I'm not on a Mac and I will never use ffmpeg. But I'm not sure I believe that, or maybe ffmpeg retains information somehow, that other demuxers don't, since it's remuxing immediately after.
The way I see it, the audio is roughly one second shorter than the video and the missing audio is at the place where it jumps out of synch. There are three possibilities, I think. The first is that the VOB ID containing the part where the asynch occurs has audio ending a second before the video. This is possible, I believe, as I've seen it before. The second is that at the break another VOB ID begins with audio beginning a second after the video (not likely, I don't think). And the third and most likely is that there's a cell, referenced or unreferenced, lasting a second with video but no audio. If unreferenced something like a PC's FixVTS would remove the unreferenced cell and no more audio asynch after extracting the audio and muxing with the other video. Also, a good decrypter should remove an unreferenced cell but I don't know what you used or how good it is. The original VOBs contain information telling it to jump past that cell, Demuxing and remuxing removes that information. But, even if the cell is referenced (the DVD plays it), each cell begins with its own delay information, so the fact that there's a cell with no audio doesn't affect the playback of the following cells.
When demuxed the two sections of real audio 'slide' up against each other, removing the section with no audio (it's not 'silent audio' but no audio at all), thus creating the out of synch audio. I've seen this before and had to deal with it. I usually cut the audio, add the needed silence, and then join the two pieces back together again. DelayCut adds the silence without any reencoding and the two AC3 pieces are rejoined when authoring with Muxman. If reencoding the video anyway, one can cut out the necessary amount of video (it's just black or some text screen anyway).
If it winds up being an timecode problem or something else, then I'll happily admit my error and I'll have learned something. -
@nicksla
I'm not a Mac fan.
But:
I think your Video File is corrupted. No because the Audio-file is missing 1sec. after muxing (Witch is normal on around 10% of all instances and this %'s increase if you pass first the video-file through Vid-Coder, etc.) ...but because it go into un-sync.
Upload one more time the original Videofile into your computer and try it again.
Good Luck.Last edited by DJ_ValBec; 4th Dec 2014 at 15:31.