VideoHelp Forum
+ Reply to Thread
Results 1 to 2 of 2
Thread
  1. So after beating my head against the wall for the better portion of a day, I'm afraid I need some help. Basically, I want to do the following:
    1. Take a variable framerate video and extract its contents to an image sequence with FFMPEG
    2. Perform whatever enhancements I need to on the image sequence, retaining the same number of still images from start to finish
    3. Convert the still image sequence into a variable framerate *.mov file (h.264 for testing purposes, something like ProRes once I've figured the process out) and remux with the audio
    So far
    Code:
    ffmpeg -i INPUT.MOV -vsync passthrough /path/to/still/images/frame-%04d.png
    yields a 1063 frame sequence while
    Code:
    ffmpeg -i INPUT.MOV -vsync vfr /path/to/still/images/frame-%04d.png
    yields a 1062 frame sequence; the former is correct while the latter is not based on my testing. (The source file is 00:01:04.50 in length according to ffmpeg.)

    If I attempt to recombine the image sequence into an MP4 for testing purposes using
    Code:
    ffmpeg -r 16.48 -i /path/to/still/images/frame-%04d.png -pix_fmt yuv420p -enc_time_base 1:300 -video_track_timescale 600 -vsync vfr OUTPUT.MP4
    my output is 00:01:04.50 in length according to ffmpeg, but the frames are out of sync with the original video. Changing -vsync vfr to passthrough does not fix the issue.

    Is there a way to copy the PTS from the original INPUT.MOV into the OUTPUT.MP4 file to create a FIXED.MOV file that plays identically to the original file? If my length is the same I would think that the issue would be mismatched timestamps in the variable framerate file.

    Other VFR-related headaches that may or may not play a factor in what I'm trying to do:
    1. The original video reports 16.48 fps 16.50 tbr 600 tbn 600 tbc (default) in ffmpeg; the output video reports a 16.50 fps 300 tbr 600 tbn 600 tbc (default) — I can never get all four numbers to match the original video and excluding the timebase information above from my command results in 19200 tbn/tbc
    2. Simply rewrapping the video
      Code:
      ffmpeg -i INPUT.MOV -c copy OUTPUT.MOV
      with no timestamp instructions yields a 19200 tbn/tbc

    Video(s) are/have been shot using iOS devices and the MoviePro app, 400% quality, 30fps, and uncompressed audio settings. Unfortunately, like all iOS devices, the end result is VFR video.

    Any help with this is greatly appreciated, thank you in advance for your time and assistance.
    Specs: Mac Mini (Early 2006): 1.66 GHz Intel Core Duo CPU, 320GB HDD, 2GB DDR2 RAM, Intel GMA 950 integrated graphics card, Matshita UJ-846 Superdrive, Mac OS X 10.5.7 and various peripherals. System runs Final Cut Express 3.5 for editing.
    Quote Quote  
  2. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by Cyrax9 View Post
    So after beating my head against the wall for the better portion of a day, I'm afraid I need some help. Basically, I want to do the following:
    1. Take a variable framerate video and extract its contents to an image sequence with FFMPEG
    2. Perform whatever enhancements I need to on the image sequence, retaining the same number of still images from start to finish
    3. Convert the still image sequence into a variable framerate *.mov file (h.264 for testing purposes, something like ProRes once I've figured the process out) and remux with the audio
    So far
    Code:
    ffmpeg -i INPUT.MOV -vsync passthrough /path/to/still/images/frame-%04d.png
    yields a 1063 frame sequence while
    Code:
    ffmpeg -i INPUT.MOV -vsync vfr /path/to/still/images/frame-%04d.png
    yields a 1062 frame sequence; the former is correct while the latter is not based on my testing. (The source file is 00:01:04.50 in length according to ffmpeg.)

    If I attempt to recombine the image sequence into an MP4 for testing purposes using
    Code:
    ffmpeg -r 16.48 -i /path/to/still/images/frame-%04d.png -pix_fmt yuv420p -enc_time_base 1:300 -video_track_timescale 600 -vsync vfr OUTPUT.MP4
    my output is 00:01:04.50 in length according to ffmpeg, but the frames are out of sync with the original video. Changing -vsync vfr to passthrough does not fix the issue.

    Is there a way to copy the PTS from the original INPUT.MOV into the OUTPUT.MP4 file to create a FIXED.MOV file that plays identically to the original file? If my length is the same I would think that the issue would be mismatched timestamps in the variable framerate file.

    Other VFR-related headaches that may or may not play a factor in what I'm trying to do:
    1. The original video reports 16.48 fps 16.50 tbr 600 tbn 600 tbc (default) in ffmpeg; the output video reports a 16.50 fps 300 tbr 600 tbn 600 tbc (default) — I can never get all four numbers to match the original video and excluding the timebase information above from my command results in 19200 tbn/tbc
    2. Simply rewrapping the video
      Code:
      ffmpeg -i INPUT.MOV -c copy OUTPUT.MOV
      with no timestamp instructions yields a 19200 tbn/tbc

    Video(s) are/have been shot using iOS devices and the MoviePro app, 400% quality, 30fps, and uncompressed audio settings. Unfortunately, like all iOS devices, the end result is VFR video.

    Any help with this is greatly appreciated, thank you in advance for your time and assistance.
    try this - https://stackoverflow.com/questions/35269387/ffmpeg-overlay-one-video-onto-another-video
    Quote Quote  



Similar Threads

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