[FFmpeg-trac] #5170(undetermined:new): feature request: conforming
FFmpeg
trac at avcodec.org
Mon Jan 18 22:48:07 CET 2016
#5170: feature request: conforming
-------------------------------------+-------------------------------------
Reporter: zhangweiwu | Type:
Status: new | enhancement
Component: | Priority: normal
undetermined | Version:
Keywords: | unspecified
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
When a playback device can only accept 25fps and input is 24fps, people
usually have to re-encode. But some other software provided an alternative
way called conforming.
Instead of re-encoding for a different framerate, the video stream can be
copied with a different set of timestamps and duration. This is called
conforming. The stretch of video length is usually not observable, and the
audio is stretched at the same rate (ffmpeg's atempo filter can do that)
and re-encoded.
This feature useful in the case that re-encoding video damages perceived
quality more than alterating its duration.
It is especially useful when audio doesn't matter: e.g. when user wants
slow-mo effect from a 240fps camera, or when user processes security
camera output at low framerate.
Currently for this to work, users do the following:
1. mencoder allow users to specific framerate, overwriting the framerate
specified in the source file. Use mencoder to conform the video:
{{{
> mencoder -fps 25 -o conformed.avi -ovc copy -nosound 24fps_input.mp4
}}}
2. use ffmpeg to set tempo:
{{{
> ffmpeg -i conformed.avi -i 24fps_input.mp4 -map 0 -map 1 -c:v copy -af
"atempo=0.96" 25fps_output.mp4
}}}
3. delete the temp file
{{{
> rm conformed.avi
}}}
where 0.96 equals 24⁄25.
This feature request propose to allow user do this without the need of
mencoder.
This can be done by making -r parameter overwrite the framerate specified
in input file when user specifies video stream to be copied instead of re-
encoded.
If user specified -r when re-encoding the video, he could mean that input
video's frames be dropped or duplicated, or that the output video should
be encoded in the specified framerate.
However, if user specifies -r together with '-c:v copy' for video stream
to be copied, he unambiguously means that he intends conforming. ffmpeg
can proceed with conforming, and, by the end of the process, if it found
that video and audio duration in input mathces each other, but in output
different, it can give a warning, prompting the user to google for
solution (which is to use atempo).
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5170>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list