Author Topic: Feature request - Filtering without re-encoding  (Read 360 times)

Cormy1

  • Newbie
  • *
  • Posts: 31
Feature request - Filtering without re-encoding
« on: June 17, 2020, 11:43:53 PM »
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

  • Full Member
  • ***
  • Posts: 186
Re: Feature request - Filtering without re-encoding
« Reply #1 on: June 18, 2020, 12:07:11 AM »
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.
« Last Edit: June 18, 2020, 12:11:30 AM by dosdan »

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 4187
Re: Feature request - Filtering without re-encoding
« Reply #2 on: June 18, 2020, 12:34:12 AM »
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

  • Newbie
  • *
  • Posts: 31
Re: Feature request - Filtering without re-encoding
« Reply #3 on: July 06, 2020, 02:44:07 PM »
Is it something you are able to implement yourself?

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 4187
Re: Feature request - Filtering without re-encoding
« Reply #4 on: July 07, 2020, 09:14:26 AM »
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).