VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. Member
    Join Date
    Jul 2014
    Location
    France
    Search PM
    So this concerns iPhone footage. Now I'd previously successfully used material of this kind to integrate with camcorder footage but ALWAYS with a transcode to constant frame rate before putting it into the timeline. This is the first time where I've directly loaded the source mov files into the editor.

    So my general workflow is to edit a 720p30 project>lagarith export>handbrake 30p 'production' archive and 30p or 60p reduced 'user' files. Worked without any problems til now. In this case I wanted to convert the final step to 60p in avisynth/vdub using John Meyer's genial little interpolation script. It went fine with Mediainfo showing a 60p constant frame rate. But when I went to try to mux in a secondary audio and a short subtitle with mkvmerge the resulting file registered as 60p VFR. I could live with this in a pinch, except for the fact that whereas the original encode was pretty smooth the remux came out with very noticeable judder. To my eyes the judder isn't a result of added/dropped frames. This happens even if I do a simple in/out in mkvtoolnix without adding anything to the mux. I've been using v10 or more recently v66 of Bunkus' app.

    As a workaround I attempted to add an srt using the ffmpeg command: -i input.mkv -subtitles.srt -map 0 -map 1 -c copy output.mkv, but it either throws an error as to not recognizing the output extension or, upon a second try, letting me know there's a timestamp problem and if I don't fix it I'll have problems down the line.

    What's going on and what to do? I've included a couple of short clips. Thanks in advance.
    Image Attached Files
    Quote Quote  
  2. This is because the videostream (16.915s) is shorter than the audiostream (17.400s).
    You can remux it with clever FFmpeg-GUI and it remains constant framerate.
    Image Attached Files
    Last edited by ProWo; 30th Nov 2025 at 08:47.
    Quote Quote  
  3. More info, diff between the two files ..
    Item premux.mkv postmux.mkv
    ---------------------------------------------------
    "duration": "17.400000" "17.331000" [format level]
    --
    "duration": "17.400000" Null [v stream level]
    "duration_ts": 17400 Null [v stream level]
    --
    "bit_rate": "4825157" "4826674"
    "is_avc": "false" "true"
    "nal_length": "0" "4"
    "r_frame_rate": "60/1" "1000/17"
    "avg_frame_rate": "60/1" "1000/17"
    Pre-mux.mkv ffmpeg error msg:
    Command failed with exit code 4294967274: "C:\Portable\PortableApps\LosslessCut\resources\ff mpeg.exe" -hide_banner -i "C:\T\Amidst 60p premux.mkv" -map_metadata 0 -map 0 -ignore_unknown -c copy -y "C:\T\Amidst 60p premux-reformatted.mkv"

    Input #0, matroska,webm, from 'C:\T\Amidst 60p premux.mkv':\r
    Metadata:\r
    encoder : libebml-0.7.5 & libmatroska-0.7.7\r
    creation_time : 2025-11-30T11:15:20.000000Z\r
    Duration: 00:00:17.40, start: 0.000000, bitrate: 4825 kb/s\r
    Stream #0:0(eng): Video: h264 (High) (h264 / 0x34363268), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 1k tbn (default)\r
    Stream #0:1(eng): Audio: mp3 (mp3float) (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 224 kb/s (default)\r
    Stream mapping:\r
    Stream #0:0 -> #0:0 (copy)\r
    Stream #0:1 -> #0:1 (copy)\r
    Output #0, matroska, to 'C:\T\Amidst 60p premux-reformatted.mkv':\r
    Metadata:\r
    creation_time : 2025-11-30T11:15:20.000000Z\r
    encoder : Lavf62.3.100\r
    Stream #0:0(eng): Video: h264 (High) (h264 / 0x34363268), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 60 fps, 60 tbr, 1k tbn (default)\r
    Stream #0:1(eng): Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 224 kb/s (default)\r
    Press [q] to stop, [?] for help\r
    [matroska @ 00000199d4fe27c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly\r
    [matroska @ 00000199d4fe27c0] Can't write packet with unknown timestamp\r
    [vost#0:0/copy @ 00000199d722ed80] Error submitting a packet to the muxer: Invalid argument\r
    Last message repeated 1 times\r
    [out#0/matroska @ 00000199d503bd80] Error muxing a packet\r
    [out#0/matroska @ 00000199d503bd80] Task finished with error code: -22 (Invalid argument)\r
    [out#0/matroska @ 00000199d503bd80] Terminating thread with return code -22 (Invalid argument)\r
    [out#0/matroska @ 00000199d503bd80] video:1KiB audio:13KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown\r
    frame= 1 fps=0.0 q=-1.0 Lsize= 14KiB time=00:00:00.04 bitrate=2334.9kbits/s speed=4.96x elapsed=0:00:00.00 \r
    Conversion failed!
    Timestamp error in video file. Use modified FFmpeg command:

    ffmpeg -hide_banner -i "C:\T\Amidst 60p premux.mkv" -map_metadata 0 -map 0 -ignore_unknown -c copy -fflags +genpts -y "C:\T\Amidst 60p premux-reformatted.mkv"
    Added `-fflags +genpts` to generate missing timestamps. Helps resolve packet timestamp errors.
    If unsuccessful, verify file integrity or consider re-encoding.

    Edit#1
    -------
    @ProWo

    FYI,
    Although the 'Amidst 60p premux.mkv' generates errors in some programs, including ffmpeg, & losslesscut,
    it passes Clever 'scan for errors' fine without any issues displayed !!

    Any room for improvement here?
    Image Attached Files
    Last edited by videoAI; 30th Nov 2025 at 10:39. Reason: Clever scan for errors note to @ProWo
    There is nothing wrong .. with my environment
    Quote Quote  
  4. Member
    Join Date
    Jul 2014
    Location
    France
    Search PM
    Thanks very much guys. The time stamps business does seem to be at the heart of the problem. However, since I first posted I finally managed to attack the problem from a different angle--from within mkvtoolnix itself. And the solution was there along. Simply 'forcing' the default fps to 60p in the timecodes box removes most of the judder and sets mediainfo back to 60p. Other problem areas in the larger video were vastly improved as well. As for the muxing of the 30p source encode, if I plug in a setting of 24/1001 the remux punches out a smooth as silk clip that I wasn't even able to reproduce while editing. Lol. Curiously, entering 30p gives a slightly inferior result. Now, that leaves the question of whether to check the 'fix bitstream timing info' box. Some follow-up research seems to reveal that this function is 'destructive'. However, NOT using that function gives the same or better results as just entering 60p, 24/1001, etc. Does anyone know when and why this bitstream fix is to be used or not? As to the audio desync issue, maybe this won't be a problem since 99% of the audio was never interleaved with the video. Further testing will tell. However, is the lesson to be learned here that to avoid such issues always transcode VFR material to constant before going down the editing road? Oh, and not to sound more newbish than I am...but how do I open/read a json file?

    EDIT: In the end the mkvtoolnix route does a decent if imperfect job for the 60p files with audio in sync. But the 24/1001 idea clearly throws the audio out in left-field somewhere. Doh! And with the others I'm always losing at least 1 second at the end of my 20min video. So back to the drawing board.
    Last edited by Sumsaris; 30th Nov 2025 at 13:24. Reason: Update:
    Quote Quote  
  5. I believe your source video is using a time base of 1000. 60 FPS can't be represented exactly in 1/1000ths of a second. It has to alternate between 17 milliseconds (twice) and 16 milliseconds (once), averaging 16.666... milliseconds (exactly 60 fps). So the source is inherently variable frame rate, even though it's flagged as constant frame rate. The remux is doing what it should -- flagging the video as the VFR it is. If you want a true 60 fps CFR video you need to use a time base that is an integer multiple of 60: 60, 120, 180, 6000, 60000...
    Last edited by jagabo; 30th Nov 2025 at 11:31.
    Quote Quote  
  6. Notepad ..
    Originally Posted by Sumsaris View Post
    How do I open/read a json file?
    There is nothing wrong .. with my environment
    Quote Quote  



Similar Threads

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