News:

--

Main Menu

Feature request - Filtering without re-encoding

Started by Cormy1, June 17, 2020, 11:43:53 PM

Previous topic - Next topic

Cormy1

Scenario: I want to change playback rate of a video.
As I understand it, each frame of video has a timestamp associated with it, that is what determines playback behaviour.
Since that is metadata and not tied to the image data, is it not possible to change playback rate without re-encoding and losing quality...?
There should be some filters that can be applied without re-encoding.
I noticed even ffmpeg will duplicate or drop frames to achieve a specified framerate, but that shouldn't be necessary.

Is it not possible?

dosdan

#1
Quote from: Cormy1 on June 17, 2020, 11:43:53 PM
Scenario: I want to change playback rate of a video.
I noticed even ffmpeg will duplicate or drop frames to achieve a specified framerate, but that shouldn't be necessary.

Dropping frames to speed up playback or duplicating frames to slow it down, without re-encoding, would be risky with any video compression format that uses inter-frame compression methods, as I'd expect this would lead to increased blockiness or image corruption.  The sequence of frames need to be decoded so that the partial frames can be rebuilt into fully-formed image frames from info contained in earlier and later frames, and then arranged in the correct order. You could then safely delete or duplicate frames, but unless you want to accept the enormous size of uncompressed DV, you'd needed to re-compress the video stream again.

eumagga0x2a

For H.264, some basic timing info (the time base for the stream as a numerator / denominator pair) is usually encoded in SPS, so at least SPS units in the stream will need to be re-encoded. Apart from that, yes, nice to have.

Cormy1

Is it something you are able to implement yourself?

eumagga0x2a

No promises, even if the mere regeneration of parameter sets turns out to be feasible, it may be very difficult to integrate it into the existing design. Other topics have higher priority (especially support for DTS extensions in audio parser else we lose everything except of DTS core in copy mode).