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. |
1st April 2009, 09:14 | #1 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
ChangeFps with ffmpeg/mencoder
Is there a way to convert the output of mencoder/ffmpeg to a specific framerate while keeping the playback length?
(like Avisynth -> changefps does, through duplicating or dropping frames) Sometimes I have 60i/50p/30p/... material that I want to convert to 25fps or 15fps (or the othermay around convert 15fps material to 25fps material) and I'm looking for a way to do this via mencoder/ffmpeg. Using mencoder I hoped: (from 25p to 50p) Code:
-fps 25 -speed 0.5 -ofps 50 Code:
-fps 50 -speed 2 -ofps 25 Is doing this possible with ffmpeg/mencoder, if so how? Cu Selur Last edited by Selur; 1st April 2009 at 10:08. |
1st April 2009, 09:50 | #2 | Link |
Registered User
Join Date: Jun 2008
Posts: 42
|
the filter chain you have as example might work if you exchange 25 and 50 values.
In general this is not an easy conversion. In most cases video will be jumpy, choppy, ... and you most definately will lose audio sync. What is possible (even if it is not so easy also) is to get a 23.976 fps movie out of a NTSC 29.96 fps dvd. Or produce a 25fps PAL movie out of a 23.976 fps Movie (while shortening the runtime of course). And even this might or might not work. |
1st April 2009, 10:01 | #3 | Link | |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
mixed up, tried to convert 25p to 50p material using the line above
But frame count does not change at all. Quote:
|
|
1st April 2009, 10:22 | #4 | Link |
Registered User
Join Date: Mar 2005
Location: Finland
Posts: 2,641
|
Have you tried without -speed? I don't have any problems with only using -ofps <target_fps> and nothing else. Frames are dropped or duplicated when necessary and A/V sync is kept.
If that doesn't work, post your full command-line. |
1st April 2009, 10:51 | #5 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
here what I used:
trying to convert 25p->50p: Code:
mencoder -lavdopts threads=4 "PATH TO INPUT" -ovc raw -nosound -vf scale,format=i420 -fps 25 -speed 0.5 -of rawvideo -o - | x264 --crf 18 --partitions none --me dia --merange 4 --mvrange 64 --subme 0 --no-chroma-me --aq-mode 0 --threads auto --no-cabac --no-deblock --no-psnr --no-ssim --progress --fps 50 --output "PATH TO OUPUT" - 640x352 50p->25p works with: -vf framestep=2 Code:
mencoder -lavdopts threads=4 "PATH TO INPUT" -ovc raw -nosound -vf framestep=2,scale,format=i420 -fps 50 -of rawvideo -o - | x264 --crf 18 --partitions none --me dia --merange 4 --mvrange 64 --subme 0 --no-chroma-me --aq-mode 0 --threads auto --no-cabac --no-deblock --no-psnr --no-ssim --progress --fps 25 --output "PATH TO OUTPUT" - 640x352 so seems like scaling the framerate down seems to work, but how to upscale the framerate. Cu Selur Last edited by Selur; 1st April 2009 at 11:36. |
1st April 2009, 13:36 | #7 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
Nice! Thanks! Framerate looks fine now, but it seems to break the colorspace.
used: Code:
mencoder -lavdopts threads=4 "test.avi" -ovc raw -nosound -vf scale,format=i420,harddup -ofps 50 -of rawvideo -o - | x264 --crf 18 --partitions none --me dia --merange 4 --mvrange 64 --subme 0 --no-chroma-me --aq-mode 0 --threads auto --no-cabac --no-deblock --no-psnr --no-ssim --progress --fps 50 --output "test.mp4" - 640x352 Cu Selur |
1st April 2009, 13:58 | #8 | Link |
Registered User
Join Date: Mar 2005
Location: Finland
Posts: 2,641
|
Looks like the output gets corrupted by messages that MEncoder writes to standard output. Use -really-quiet.
Actually I'm not sure why that corruption doesn't happen normally for you when using that command-line. I had to add -really-quiet to be able to encode a test video even when not changing the framerate. |
1st April 2009, 14:04 | #9 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
LOL, seems like it works, funny think is normally I always use '-really-quiet' just didn't add it to get some infos what could go wrong.
Thanks a lot for the help. Cu Selur Last edited by Selur; 1st April 2009 at 15:08. |
|
|