1

Is there any tool that can manipulate / transcode h264 or h265 video streams throwing away approximately half of the frames, without performing a full re-encode?

I'm thinking it would be theoretically possible to preserve motion vectors and such computed data, preserve all I-frames, and just throw away approximately half of the B- and P-frames (possibly adjusting the remaining ones.) The result does not need to be CFR.

Is there a way to do this with ffmpeg? (or any other tool)

2 Answers 2

1

The solution at question " Lower framerate without re-encode " looks promising:

ffmpeg -discard nokey -i input.mp4 -c copy -vsync 0 I-only.mp4

By manpage there should be 5 levels of frame discarding: none, noref, bidir, nokey, all.

I tested this with older ffmpeg 4.2.4 and h265 and it had no effect. Probably not implemented yet.

3
  • Comment for the OP question (can't comment yet): I came looking for the same thing. I need to play 1920x1080@60 files on a hardware player that can't effectively drop frames. I don't want to buy a new box just because people started sending me unnecessarily high quality files.
    – user185953
    Jan 4, 2021 at 8:48
  • It is just a matter of time when people start sending me 4k. Do you think it is technically possible to do something like this for halving the resolution?
    – user185953
    Jan 4, 2021 at 8:52
  • I personally think it's technically possible (and feasible) to halve the framerate and/or the resolution without a full re-encode, by analyzing and transforming the already encoded data, in much the same way as JPEG files can be rotated by 90 degrees and/or mirrored without re-encoding, or MP3 files could have their volume normalized without a full re-encode. Whether such a tool already exist is another question. I personally bought new hardware, so this question is not relevant to me anymore, but I'll keep it open because if there is a solution, it can be useful to others.
    – Tobia
    Jan 5, 2021 at 11:09
0

I think the term for this effort is statistical multiplexing where your proposed framework would be an efficient implementation thereof.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.