Hello guest, if you like this forum, why don't you register? https://fanrestore.com/member.php?action=register (December 14, 2021) x


New frame or shot insertion into an existing MKV
#1
I know we have had this discussion before but looking for an update, if there is anything better out there now.

My problem is that I'm trying a new way to color regrade and it is screwing up every once and a while. So I find the error(s) fix it and re-render. Then when I thought I found all the errors, I randomly find another and fix that and re-render. So for the Aliens dvd regrade, I ended up rendering it about 12 times. So that boils down to more then 24 days of encoding. That's a real pain.

So what I'm looking for is a way to insert the fixes (shots or frames) into the MKV without going through the 2-ish days of re-rendering. I know there was some commercial software but I also hear of some freeware ways of doing the work.

Thanks
Reply
Thanks given by:
#2
This is what AI had to say:

Short answer: You can't paste frames into an H.264/HEVC stream in-place, but you can limit the re-encode to just the shot you're fixing and stream-copy the rest. Cuts it from ~2 days to a few minutes per fix.

Free workflow (FFmpeg + MKVToolNix):
  • Find keyframes near the bad shot:
    Code:
    ffprobe -v error -select_streams v:0 -skip_frame nokey -show_entries frame=pkt_pts_time -of csv=p=0 Aliens.mkv

  • Split the MKV at the keyframes just before and after the shot (mkvmerge --split, or ffmpeg -ss/-to with -c copy).

  • Re-encode ONLY that small segment with identical settings (codec, profile, level, res, fps, CRF/bitrate). A single shot is seconds of video — minutes, not days.

  • Concat the three parts back together:
    Code:
    ffmpeg -f concat -i list.txt -c copy -fflags +genpts output.mkv


Steps 2 and 4 are stream copies — no re-encode of the unchanged 99% of the file.

Commercial options (automate the GOP-boundary logic):
  • TMPGEnc MPEG Smart Renderer 6 — most recommended for this exact use case. Frame-level, re-encodes only around edit points.
  • VideoReDo TV Suite — similar smart-rendering, frame-accurate.
  • SolveigMM Video Splitter — lighter weight, handles more codec types.

TMPGEnc Smart Renderer 6 is the one I'd go with if you want a GUI and don't want to script it.

Proactive tip for next time:

If you know a regrade will need iterative fixes, encode the initial pass with keyframes forced at every shot boundary using x264's
Code:
--qpfile
:

Code:
1 I 2 P 3 P ... 147 K <- shot boundary 148 P ...

Now you can cut at any shot boundary with zero re-encode of surrounding frames. Slightly bigger file, but for a one-off regrade where you expect 10+ iterations, it pays for itself immediately.

TL;DR:

There's no tool that will literally "paste" new frames into an existing H.264 stream without touching the surrounding GOP. But the split-at-keyframes → re-encode-only-the-shot → concat workflow reduces your 2-day re-render to a few minutes per fix. TMPGEnc Smart Renderer 6 automates this nicely if you want a GUI; FFmpeg + MKVToolNix does the same thing for free.
Reply
Thanks given by: PDB


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is it possible to edit a existing Blu-Ray disc? Red41804 3 4,110 2024-10-01, 06:45 AM
Last Post: Red41804
  Best way to manage variable frame rates? alexp2000 2 5,603 2022-06-11, 02:10 PM
Last Post: alexp2000
  [Help] Frame-accurate subtitles theprion 3 5,903 2021-05-15, 11:11 PM
Last Post: Beber
  [Help] Correct Bad Frame Rate Conversion CSchmidlapp 29 47,297 2019-05-24, 10:17 PM
Last Post: zoidberg
  How to remove every 25th dupe frame from h264 video Plissken1138 8 12,735 2019-03-31, 12:04 AM
Last Post: Chewtobacca

Forum Jump:


Users browsing this thread: 1 Guest(s)