It seems to be the holy grail to patch / cut / change image areas without re-encoding videos. I’ve been interested in this topic for years.
It’s a matter of principle and I don’t want any loss of quality, which is not absolutely necessary in digital technology.
Now my problem. I have HD material from restored films. But the recording service has its channel logo in it. The material is even encoded in the Blu-Ray standard. Tmpeg Authoring Works (which is very strict) accepts it and doesn’t want to re-encode it.
The channel logo could be covered by a subtitle track using the old trick. But not every player interprets such a track in the same way. Sometimes you have flickering and when skipping the effect that the subtitle disappears and yet the logo is still visible. Also, if you select a different subtitle track, the logo cover disappears. Not the real thing.
The logo is completely in the black border and as I strongly suspect, the logo is only saved in the I-frames. (no motion vectors are affected)
Now I have done the following manually:
- I deleted the first I-frame from the h264 elementary stream using a hex editor.
- I encoded an I-frame with a covered logo in the same settings (!) as the original stream.
- I used the hex editor to copy the new I-frame into the place of the old one.
And what can I say: it works! The logo is gone and the stream is intact. Every player (even the very critical ones) does not display a logo until the next I-frame.
So it works manually!
The only flaw is that I have completely re-encoded the I-frame. This should also be lossless. So patch the I-frame at the position and patch the position where the logo is black.
And I can’t do that. I won’t understand the 300-page PDF on the h264 codec in this lifetime.
There should be an editor that can patch I-frames without loss. Limited to my special case. (Logo in the margin, only I-frames, only h264, only black)
I could offer some money for it. But I don’t know how many hours a codec programmer would need.
What do you think of the project?