VideoHelp Forum
+ Reply to Thread
Results 1 to 25 of 25
Thread
  1. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    is it possible to convert video to extra low frame rates below 24, such as 6 per second.

    even better would be a way to produce a frame when there is substantial change (not considering noise difference). maybe even just one frame (one I-frame) over the whole video ... such as a voice blog or a musical song.
    Quote Quote  
  2. in virtualdub use change frame rate and make it one.

    When rendering h264, make the preset "still picture"
    Quote Quote  
  3. Originally Posted by Skaperen View Post
    maybe even just one frame (one I-frame) over the whole video ... such as a voice blog or a musical song.
    Yes, but some players won't play it properly. Just include one frame and set the frame rate to 1/N where N is the running time of the video in seconds.
    Image Attached Files
    Quote Quote  
  4. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    Originally Posted by s-mp View Post
    in virtualdub use change frame rate and make it one.

    When rendering h264, make the preset "still picture"
    anything for Linux?
    Quote Quote  
  5. Originally Posted by Skaperen View Post
    anything for Linux?
    Maybe AviDemux. Or ffmpeg.

    Code:
    ffmpeg -y -loop 1 -r 1 -i "image.jpg" -i "audio.aac" -c:v libx264 -preset veryfast -tune stillimage -c:a copy -shortest output.mp4
    That creates a 1 fps AVC video from a jpg image and an aac audio file.
    Last edited by jagabo; 5th Nov 2021 at 07:47.
    Quote Quote  
  6. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    i can imagine two ways to do things:
    if i take a 30 fps video and "convert" it to 6 fps:
    1. the video plays all original frames 5 times as slow.
    2, the video has every 5th frame and plays at the same speed with a lot of frame jerkiness.

    i have use cases for both.

    also playing every 5th frame of that 30 fps video at 30 fps. this would be a time-lapse method. i have use cases for this, too.
    Quote Quote  
  7. Originally Posted by Skaperen View Post
    1. the video plays all original frames 5 times as slow.
    AssumeFPS(6)
    Originally Posted by Skaperen View Post
    2, the video has every 5th frame and plays at the same speed with a lot of frame jerkiness.
    ChangeFPS(6)
    Originally Posted by Skaperen View Post
    also playing every 5th frame of that 30 fps video at 30 fps.
    ChangeFPS(6).AssumeFPS(30)
    All simple AviSynth instructions. It requires reencoding, of course.
    Quote Quote  
  8. If you want to convert a video to low frame rates you can use ffmpeg with the -r switch. That will maintain the running time. To reduce a 24 fps movie to 4 fps (keep one of six frames) use:
    Code:
    ffmpeg -i input.mp4 -r 4 -c:v libx264 -c:a copy output.mp4
    Quote Quote  
  9. There is also another possibility - you can use MPEG or H.264 capable to perform "pulldown" - at the entry there is low frame video and at the output normal framerate video (for players incapable to play low frame rate video). For MPEG-2 you can use https://www.videohelp.com/software/DGPulldown to modify already encoded video stream and/or https://www.videohelp.com/software/TMPGEnc to encode such video (use in advanced features "D" frames - if i recall correctly - not used this encoder from at least 12 years) and for H.264 use x264 with proper syntax:
    Code:
    --pulldown <string>     Use soft pulldown to change frame rate
                                      - none, 22, 32, 64, double, triple, euro (requires cfr input)
    Decimation (brutal i.e. skipping frames or "smart" by motion compensation) can be done for example by ffmpeg. Low frame rate video can be beneficial from video codecs supporting Variable Frame Rate.
    Quote Quote  
  10. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    this question was in consideration of a project where i am generating the video. so i can set the frame rate that way. but that way happens to be very CPU costly since the generation is producing fractals (Mandelbrot/Julia set extreme depth zooms, heavy CPU per run). so what i need to consider is storing raw frames to do the various frame rates from. i can't run everything in parallel as i don't have enough cores. i am looking at finding a cheap cloud provider to do that in. AWS is too pricey for a hobby. then maybe i can run several ffmpegs at once to encode each frame rate (the generator feeding several pipes at once).
    Quote Quote  
  11. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    Originally Posted by manono View Post
    Originally Posted by Skaperen View Post
    1. the video plays all original frames 5 times as slow.
    AssumeFPS(6)
    Originally Posted by Skaperen View Post
    2, the video has every 5th frame and plays at the same speed with a lot of frame jerkiness.
    ChangeFPS(6)
    Originally Posted by Skaperen View Post
    also playing every 5th frame of that 30 fps video at 30 fps.
    ChangeFPS(6).AssumeFPS(30)
    All simple AviSynth instructions. It requires reencoding, of course.
    i originally typed the post for fps 5 and decided that was bad and edited it to be 6. i failed to complete the editing. 6 was to be a factor of all NA frame rates.

    now i'm thinking how to generate fps 25, too.
    Quote Quote  
  12. Originally Posted by Skaperen View Post
    this question was in consideration of a project where i am generating the video. so i can set the frame rate that way. but that way happens to be very CPU costly since the generation is producing fractals (Mandelbrot/Julia set extreme depth zooms, heavy CPU per run). so what i need to consider is storing raw frames to do the various frame rates from.
    based on your description seem lossless codec should deliver higher compression than standard. I would go for this approach - generate all frames compressed with lossless codec and later decimate those videos - you may use multiple ffmpeg instances to generate subsequent (decimated) video streams. Alternatively you may think about modern lossy codec (such as H.264) but with high quality settings and with GOP=1 (or use lossy mezzanine codec tailored for this kind of workflow).
    Quote Quote  
  13. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    Originally Posted by pandy View Post
    Originally Posted by Skaperen View Post
    this question was in consideration of a project where i am generating the video. so i can set the frame rate that way. but that way happens to be very CPU costly since the generation is producing fractals (Mandelbrot/Julia set extreme depth zooms, heavy CPU per run). so what i need to consider is storing raw frames to do the various frame rates from.
    based on your description seem lossless codec should deliver higher compression than standard. I would go for this approach - generate all frames compressed with lossless codec and later decimate those videos - you may use multiple ffmpeg instances to generate subsequent (decimated) video streams. Alternatively you may think about modern lossy codec (such as H.264) but with high quality settings and with GOP=1 (or use lossy mezzanine codec tailored for this kind of workflow).
    i'm too newb to know what "decimate" means in this context (classic meaning is to break into ten parts).
    Quote Quote  
  14. Originally Posted by Skaperen View Post
    i'm too newb to know what "decimate" means in this context
    Reduce the frame rate by discarding M in N frames. For example, reduce 24 fps to 6 fps by discarding 3 out of every 4 frames. The remaining frames are displayed four times longer than originally to keep the original running time.

    Originally Posted by Skaperen View Post
    (classic meaning is to break into ten parts).
    Or more broadly, to reduce drastically: https://www.merriam-webster.com/dictionary/decimate
    Quote Quote  
  15. Handbrake goes down to 5fps
    Quote Quote  
  16. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    i want to do 1 fps.
    Quote Quote  
  17. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    what i am wanting to ultimately do is time-lapse a video at various rates by taking every Nth frame from the original (if that is not an I-frame then whatever playback decoding would produce at that point) and use them as the frames to encode an X fps video. i'd be starting with N = whatever the original fps is (to get a frame about one per second) and X = 24, 25 or 30. i'm not worried about frame rates like 29.97 or 59.94. 1000/1001 is close enough
    Quote Quote  
  18. Originally Posted by Skaperen View Post
    what i am wanting to ultimately do is time-lapse a video at various rates by taking every Nth frame from the original (if that is not an I-frame then whatever playback decoding would produce at that point) and use them as the frames to encode an X fps video. i'd be starting with N = whatever the original fps is (to get a frame about one per second) and X = 24, 25 or 30. i'm not worried about frame rates like 29.97 or 59.94. 1000/1001 is close enough
    You've been given many methods to do that already.
    Quote Quote  
  19. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    Originally Posted by manono View Post
    All simple AviSynth instructions. It requires reencoding, of course.
    i am unable to find a Linux or Debian or Ubuntu version of AviSynth. re-encoding would be expected.
    Quote Quote  
  20. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    Originally Posted by jagabo View Post
    If you want to convert a video to low frame rates you can use ffmpeg with the -r switch. That will maintain the running time. To reduce a 24 fps movie to 4 fps (keep one of six frames) use:
    Code:
    ffmpeg -i input.mp4 -r 4 -c:v libx264 -c:a copy output.mp4
    i don't have much experience using ffmpeg directly and do not understand the options "-c:v libx264 -c:a copy". i'm guessing the 2nd means to copy the audio. i don't understand the first at all.
    Quote Quote  
  21. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    Originally Posted by jagabo View Post
    If you want to convert a video to low frame rates you can use ffmpeg with the -r switch. That will maintain the running time. To reduce a 24 fps movie to 4 fps (keep one of six frames) use:
    Code:
    ffmpeg -i input.mp4 -r 4 -c:v libx264 -c:a copy output.mp4
    i tried this at 1 fps. the result was not a small file. i'll guess that the original was 30 fps. what i got looked more like 3 or 4 fps. i'll guess 3 fps. it looked like i got every 10th frame duplicated 10 times. what i really want is 1 new frame every second, without any duplicates. i expect 1 fps to be a smaller file. then if i do another conversion making the 1 fps file into a 30 fps file, then i expect frames to be duplicated.

    fyi, i did this without those two -c options.
    Quote Quote  
  22. Originally Posted by Skaperen View Post
    Originally Posted by jagabo View Post
    If you want to convert a video to low frame rates you can use ffmpeg with the -r switch. That will maintain the running time. To reduce a 24 fps movie to 4 fps (keep one of six frames) use:
    Code:
    ffmpeg -i input.mp4 -r 4 -c:v libx264 -c:a copy output.mp4
    i don't have much experience using ffmpeg directly and do not understand the options "-c:v libx264 -c:a copy". i'm guessing the 2nd means to copy the audio. i don't understand the first at all.
    The meaning of the parameters:

    Code:
    -i input.mp4
    Specifies the source video as input.mp4.

    Code:
    -r 4
    Specifies the frame rate should be 4 fps for the output video. If the source is a higher frame rate frames will be decimated. If the source is a lower frame rate frames will be duplicated. Note that the placement of this parameter is important, it must come after the source specification.

    Code:
    -c:v libx264
    Use the libx264 encoder for the output file's video. That is an h.264 (AVC) encoder. Since no encoding properties were specify it used the medium preset at crf 23.

    Code:
    -c:a copy
    Use the "copy" encoder for the output file's audio. I.e, just copy the source audio to the output file, without re-encoding.

    Code:
    output.mp4
    Specifies the output file is to be named output.mp4 (and specifies the mp4 container).

    If you did this:
    Code:
    ffmpeg -i input.mp4 -r 1 output.mp4
    Since no video codec was specified, and the output is mp4, libx264 was used to re-compress the video (the default codecs vary depending on the container). And since no video encoding parameters were specified the encoder's default settings were used. The defaults for libx264 are the medium preset and crf 23. Since no audio codec was specified, and the output is mp4, the aac encoder was used to compress the audio. The default for the aac encoder and a stereo track is 128 kbps.

    Originally Posted by Skaperen View Post
    i'll guess that the original was 30 fps.
    Why guess? Check the properties of the source video.

    Originally Posted by Skaperen View Post
    what i got looked more like 3 or 4 fps.
    It sounds to me like you left -r set to 4, specifying a 4 fps video.

    Originally Posted by Skaperen View Post
    i'll guess 3 fps.
    Again, why guess? Check the properties.

    Originally Posted by Skaperen View Post
    it looked like i got every 10th frame duplicated 10 times. what i really want is 1 new frame every second, without any duplicates.
    If you used "-r 1" that's what you got, one new frame every second.

    Originally Posted by Skaperen View Post
    i expect 1 fps to be a smaller file. then if i do another conversion making the 1 fps file into a 30 fps file, then i expect frames to be duplicated.
    If you re-encode a 1 fps video with:
    Code:
    ffmpeg -i input.mp4 -r 30 output.mp4
    That's exactly what you will get, each frame of the source duplicated to the new rate. The file size won't be much different than the 1 fps video because exact duplicate frames require hardly any bitrate. Of course, there will be no obvious difference in playback between the 1 fps video and the 30 fps video with duplicates.

    I tested this command line with a very high quality (x264, crf 10) 1920x858, 24 fps, 12 minute, 2.0 GB source:
    Code:
    ffmpeg -i input.mp4 -r 1 output.mp4
    The result was a 1920x858, 1 fps video with a file size of 135 MB. It took about half a minute on my computer.

    Note that the x264 video encoder is frame rate aware. With crf encoding it will allocate more bitrate per frame at lower frame rates, less bitrate per frame at higher bitrates. The idea is that the longer you see each frame the higher the quality should be -- you will notice artifacts in a frame that's visible for 1 second much more than in a frame that's only visible for 1/30 second. So reducing the frame rate from 30 fps to 1 fps will not necessarily reduce the stream size by a factor of 30.

    Using qp (constant quantizer) mode rather than crf (constant rate factor) mode should give smaller files (lower bitrates) with very low frame rates:

    Code:
    ffmpeg -i input.mp4 -r 4 -c:v libx264 -qp 23 -c:a copy output.mp4
    Select a qp value that gives the quality you want (lower values give larger files and higher quality, higher values give smaller files and lower quality).
    Last edited by jagabo; 11th Nov 2021 at 17:00.
    Quote Quote  
  23. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    > there will be no obvious difference in playback between the 1 fps video and the 30 fps video with duplicates.

    maybe what would help me is a player that can show the frame number (an/or exact time in milliseconds) within the viewed frame (or field number/time/even/odd for interlaced), as well as easy keyboard controls for stop and forward/backward one frame at a time.

    > Why guess? Check the properties of the source video.

    i'm still new to digital video and don't know a command to do that. my familiarity with video is from the analog NTSC world. i am familiar with digital signals. i am also a ham radio tech licensee.

    > So reducing the frame rate from 30 fps to 1 fps will not necessarily reduce the stream size by a factor of 30.

    i would not have expected that just because more frames in 30fps would be similar to others than in 1 fps, without that variation of quality inverse to rate. but it would have expected some.

    one thing i wonder is if the rate that frames are I-frames is fixed or can vary. if it _can_ vary at playback, is it commonly encoded that way?
    Quote Quote  
  24. Originally Posted by Skaperen View Post
    Maybe what would help me is a player that can show the frame number (an/or exact time in milliseconds) within the viewed frame (or field number/time/even/odd for interlaced), as well as easy keyboard controls for stop and forward/backward one frame at a time.
    Most media players support frame-by-frame advance. They usually only show time in HH:MM:SS But that's good enough for this. They also let you view the renderer statistics -- which will show the frame rate that's being displayed. In MPCHC for example right click on the player while a video is playing, select Filters -> "name of renderer", something like "Video Mixing Renderer 9".

    Image
    [Attachment 61785 - Click to enlarge]


    Many players also let you view statistics (including frame rate) while playing. Look through the menus or right click and select it from the context menu. MPCHC -> View -> Statistics:

    Image
    [Attachment 61786 - Click to enlarge]


    Originally Posted by Skaperen View Post
    > Why guess? Check the properties of the source video.

    i'm still new to digital video and don't know a command to do that. my familiarity with video is from the analog NTSC world. i am familiar with digital signals. i am also a ham radio tech licensee.
    MediaInfo, ffprobe, etc. Windows can give you basic information with right click -> properties -> Details.

    Originally Posted by Skaperen View Post
    > So reducing the frame rate from 30 fps to 1 fps will not necessarily reduce the stream size by a factor of 30.

    i would not have expected that just because more frames in 30fps would be similar to others than in 1 fps, without that variation of quality inverse to rate. but it would have expected some.
    More "different" frames makes it more likely that a frame will be an I frame rather than a P or B frame (with the latter two consuming much less bitrate).

    Originally Posted by Skaperen View Post
    one thing i wonder is if the rate that frames are I-frames is fixed or can vary. if it _can_ vary at playback, is it commonly encoded that way?
    It depends on the encoder and the settings. x264 defaults to a max GOP size of 250 frames, a min GOP size of 24, and a new I frame at scene changes. You can change those settings when you encode.
    Quote Quote  
  25. Member
    Join Date
    Oct 2021
    Location
    Wheeling WV USA
    Search Comp PM
    "I-frame at scene changes" is good. i presume that means any player accepts the end of a GOP and an I-frame to start a new GOP at any time because it could be enough of a change to count as a scene change. i can't envision any player checking if there really is a scene change when it gets an I-frame. but i might want to make a frame rate much slower than the I-frame rate. i would expect a smaller file in this case (the smaller file is not the goal). a frame at every I-frame would be expected to be about the same size.

    one of the video feeds i monitor shows river levels. it is of interest when there is a lot of rain. but i want to get 1 minute samples every hour instead of waiting for the feed to end.
    Quote Quote  



Similar Threads

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