VideoHelp Forum
+ Reply to Thread
Results 1 to 12 of 12
Thread
  1. I have an issue that I need help with; I'm not all that knowledgeable about video conversion or ffmpeg. I want to rip a DVD movie, do some editing in Resolve, then re-encode it with 5.1 surround sound. When I rip the DVD with MakeMKV, then convert it to MOV to import into Resolve, I can separate the 6 audio tracks into 6 PCM streams, so that's no problem. The problem is with the framerate. MakeMKV rips the DVD with a 30fps frame rate, which persists through the conversion, editing and encoding in Resolve. However, it plays with a lot of stutter with my TV set to 60Hz; it plays the same way on several different devices. Meanwhile, if I convert the MKV with Handbrake and set the framerate to "Same as source," I get an MKV with a 24fps framerate, which plays silky-smooth with my TV set to 24 Hz. However, Handbrake isn't able to rip the MKV file with the audio streams I need. So I'm wondering if I can get the change in framerate with ffmpeg when I convert the MKV to MOV. I tried forcing a 24fps framerate with ffmpeg, but that didn't work; the framerate changed, but playback was disastrous. Obviously there's some other conversion happening with Handbrake, and I'd like to know how to duplicate it with ffmpeg. Here is the syntax I used to convert the MKV to MOV, minus that attempt to force 24fps: ffmpeg -i inputfile.mkv -c:v dnxhd -profile:v dnxhr_hq -c:a pcm_s16le -ar 48000 outputfile.mov. Thanks for any help.
    Quote Quote  
  2. Try adding "-vf fieldmatch,yadif=deint=interlaced,decimate" to your ffmpeg command line.
    Quote Quote  
  3. That did the trick. I'm curious about the two different frame rates. Also curious what the ffmpeg command did. Thanks for your help
    Quote Quote  
  4. I was going to write a big technical description but it's way too much work. In short, when film is broadcast every 4 film frames becomes 5 video frames (24 fps to 30 fps). See 3:2 pulldown:

    https://en.wikipedia.org/wiki/Three-two_pull_down

    The filter sequence I gave you restores the original 4 film frames from the 5 video frames. The first filter, fieldmatch, matches fields to eliminate interlaced frames. But that leaves you with 5 progressive frames instead of 4 -- one of the 5 is a duplicate of one of the film frames. The third filter, decimate, removes that duplicate frame, leaving only the four original film frames. The reason for yadif between them is to deinterlace any interlaced frames when the fieldmatch fails (that can happen when video is cut after being telecined, dropped frames while capturing, etc.). If your video is very cleanly telecined you can leave out the yadif: "-vf fieldmatch,decimate".
    Quote Quote  
  5. Thanks for the explanation, but I spoke to soon. I had just just quickly checked the video after adding your switches to the ffmpeg command line, and it looked good at 24fps, but when I went to edit it, it turns out that the video no longer matches the sound track. The video finishes 20 minutes (1:45 min film) before the soundtrack does, so I need to try something different.
    Quote Quote  
  6. That's an issue with your editor. The running time of the 24 fps video is the same as the 30i source. Make sure the editor recognizes the new source is 24 fps.
    Quote Quote  
  7. That's what I thought too, but then I checked the file in VLC, and the issue is present there as well. VLC reports that the framerate is 23.976 fps; the audio and video are in sync at the beginning, but the video starts running more and more out of sync with the audio as the film progresses. The video reaches the closing credits around 20 minutes before the full length of the movie, while the audio continues to play to the end. This is the command line I used: "ffmpeg -i inputfile.mkv -c:v dnxhd -profile:v dnxhr_hq -vf fieldmatch,yadif=deint=interlaced,decimate -c:a pcm_s16le -ar 48000 outputfile.mov." Do the switches need to be in a different order?
    Quote Quote  
  8. Try adding -r 24 (or 23.976, as appropriate) to the command line.
    Quote Quote  
  9. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by NTradd View Post
    That's what I thought too, but then I checked the file in VLC, and the issue is present there as well. VLC reports that the framerate is 23.976 fps; the audio and video are in sync at the beginning, but the video starts running more and more out of sync with the audio as the film progresses. The video reaches the closing credits around 20 minutes before the full length of the movie, while the audio continues to play to the end. This is the command line I used: "ffmpeg -i inputfile.mkv -c:v dnxhd -profile:v dnxhr_hq -vf fieldmatch,yadif=deint=interlaced,decimate -c:a pcm_s16le -ar 48000 outputfile.mov." Do the switches need to be in a different order?
    see this here - https://ffmpeg.org/ffmpeg.html
    Quote Quote  
  10. OK, so I played around with all different combinations of the options you gave me. Decimate seemed to be removing important frames, causing the video to be sped up, and yadif was screwing up the audio. So the command line that wound up working perfectly is: ffmpeg -i inputfile.mkv -vf fieldmatch -r 23.976 -c:v dnxhd -profile:v dnxhr_hq -c:a pcm_s16le -ar 48000 outputfile.mov. Thanks for your help.
    Quote Quote  
  11. If your video is really telecined film that command line is likely to leave you with both duplicate and missing frames.
    Quote Quote  
  12. So that sent me digging a bit more - the final -vf parameter that works is -vf dejudder,fps=30000/1001,fieldmatch,yadif=deint=interlaced,decimate. Thanks for your help
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!