VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. I tried to use the setpts filter in ffmpeg to change the speed of a video from 24 fps to 25 fps. But the output video doesn't have 25 fps, it has 24 fps.

    The commands I tried:
    Code:
    ffmpeg -i infile.m2ts -filter:v "setpts=1.041666666666667*PTS" -codec:v libx264 -an outfile.mkv
    Code:
    ffmpeg -i infile.m2ts -filter:v "setpts=N/(25*TB)" -codec:v libx264 -an outfile.mkv
    infile.m2ts has 24 fps, outfile.mkv has 24 fps, but it should have 25 fps, and I don't know why it doesn't have 25 fps.
    Last edited by codemaster; 15th Dec 2023 at 19:29.
    Quote Quote  
  2. Banned
    Join Date
    Nov 2023
    Location
    Europe
    Search Comp PM
    Originally Posted by codemaster View Post
    I tried to use the setpts filter in ffmpeg to change the speed of a video from 24 fps to 25 fps. But the output video doesn't have 25 fps, it has 24 fps.

    The commands I tried:
    Code:
    ffmpeg -i infile.m2ts -filter:v "setpts=1.041666666666667*PTS" -codec:v libx264 -an outfile.mkv
    Code:
    ffmpeg -i infile.m2ts -filter:v "setpts=N/(25*TB)" -codec:v libx264 -an outfile.mkv
    infile.m2ts has 24 fps, outfile.mkv has 24 fps, but it should have 25 fps, and I don't know why it doesn't have 25 fps.
    If you want to change the fps from 24 to 25 (frames per second) i think you would use "-r 25.00" to give the video 25 fps! i guess different ffmpeg guis use various commands for it tough!
    Last edited by Swedaniel; 15th Dec 2023 at 21:11.
    Quote Quote  
  3. But I want to change fps and duration, without duplicating or dropping frames. And "-r 25.00" and "fps=25" don't do that.

    I use this AviSynth+ script:
    Code:
    LWLibavVideoSource("infile.m2ts")
    AssumeFPS(25, 1, true)
    infile.m2ts has 24 fps, output file has 25 fps, and the number of frames doesn't change. And I wanted to do the same thing with ffmpeg. And I found that the setpts filter in ffmpeg does what AssumeFPS does in AviSynth+. But when I use setpts like in post #1, output file has 24 fps, and I don't know why it doesn't have 25 fps.
    Last edited by codemaster; 15th Dec 2023 at 21:22.
    Quote Quote  
  4. Banned
    Join Date
    Nov 2023
    Location
    Europe
    Search Comp PM
    Originally Posted by codemaster View Post
    But I want to change fps and duration, without duplicating or dropping frames. And "-r 25.00" and "fps=25" don't do that.

    I use this AviSynth script:
    Code:
    LWLibavVideoSource("00003.m2ts")
    AssumeFPS(25, 1, true)
    And I was looking to do the same thing with ffmpeg. And I found that the setpts filter does what AssumeFPS does.
    Oh ok, i see! i wasnt sure if you had mixed thing up what fps is! so basicly you want to change the display duration of each frame from the video so it goes faster or slower! maybe just need to fine tune the values so it will display each frame for an specific amount of time, to the lower, which will eventually display 25 frames in one second instead of 24!

    Edit: I can imagine it beeing an setting require percise numbers added to display the exact number of 25 frames in one second, maybe just need to fine tune it some!
    Last edited by Swedaniel; 15th Dec 2023 at 21:25.
    Quote Quote  
  5. I want to speed up video and audio. Because source is live concert on bluray at 24 fps. But it was recorded at 25 fps, and was slowed down to 24 fps to make bluray. And I know how to do it in AviSynth+, but I don't know how to do it in ffmpeg. And I wanted to do this with ffmpeg.
    Quote Quote  
  6. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    I think you just have to add the -r as Swedaniel mentioned:
    Code:
    ffmpeg -i infile.m2ts -r 25 -filter:v "setpts=N/(25*TB)" -codec:v libx264 -an outfile.mkv
    Quote Quote  
  7. Banned
    Join Date
    Nov 2023
    Location
    Europe
    Search Comp PM
    Originally Posted by codemaster View Post
    I want to speed up video and audio. Because source is live concert on bluray at 24 fps. But it was recorded at 25 fps, and was slowed down to 24 fps to make bluray. And I know how to do it in AviSynth+, but I don't know how to do it in ffmpeg. And I wanted to do this with ffmpeg.
    Yeah ok i think i know what you mean! ie. Once the video is fixed now the audio is out of sync and all of this and one must become some sort of mathematical expert with the endurance of an olympic swimmer to pull the whole thing off!

    Edit: Have you checked into this Avanti program? it have support for ffmpeg+avisynth and it do have ALOT of functions and features.. amongst them are frame rate conversion, script editor, rewrite pts, sync audio, audio sync manager, audio channel mapper and the list can go on for an long time! allso the Video and Audio have command line options that can be added separately! It is free to use and can be downloaded from here on VideoHelp! I tested it, it is functioning real good with FFMpeg Essentials v.6.0!
    Last edited by Swedaniel; 15th Dec 2023 at 23:12.
    Quote Quote  
  8. Problem was I assumed setpts changes fps. It doesn't. I have to change both pts and fps. I tried:
    Code:
    ffmpeg -i infile.m2ts ^
    -filter:v "setpts=N/(25*TB), fps=25, setsar=1/1" ^
    -codec:v libx264 -preset slower -tune film ^
    -x264-params crf=23:min-keyint=25:keyint=250:colormatrix=bt709 ^
    -an ^
    outfile.mkv
    And now infile.m2ts has 24 fps, and outfile.mkv has 25 fps.
    Last edited by codemaster; 15th Dec 2023 at 23:54.
    Quote Quote  
  9. Member
    Join Date
    Mar 2003
    Location
    somewhere in time
    Search Comp PM
    Try shutter encoder..load your video then in the choose function click conform. it will change the fps without compression.
    Quote Quote  
  10. And using "-r" or "fps" with setpts not only changes fps, but it also prevents dropping frames.
    Last edited by codemaster; 16th Dec 2023 at 10:36.
    Quote Quote  



Similar Threads

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