hvfvhigh, new ffmpeg, etc

Vangelis forthnet northmedia1 at the.forthnet.gr
Sun Aug 28 16:13:02 PDT 2016


On Wed Aug 24 10:50:19 BST 2016, RS wrote:

> When I wrote the suggestion of re-encoding HVFHD to 25fps
> I was assuming that I could use ffmpeg -r 25 to drop alternate frames
> to reduce the frame rate. It seems it is not that easy.

Your query should be better addressed to the
ffmpeg mailing list or a specialised AV forum;
but yes, the issue at hand is not just halving
the frame rate losslessly (i.e. by keeping original video frames);
-r switch is incompatible with -c:v copy,
so a recode is inevitable.

(For anyone interested, changing the FR losslessly
can't be done with ffmpeg yet, but tools such as
mkvtoolnix (Matroska container) and MP4Box
(MP4 container) can be used to change FR at
container level. Starting with a 50fps file one
can end up with a 25fps file but with doubled
original duration - the end file plays at half the
speed of original, i.e. a "slow-motion" effect...)

> h.264 identifies the difference from the previous frame
> and encodes it.  If I delete the previous frame
> it stops working.
> I just got a lot of Invalid timestamp errors from ffmpeg.

In the 50fps original file, the 50 individual frames
that make up a second's worth of video stream are
inter-related/inter-dependent.
They consist of a number of I (intra- or key-frames),
which are autonomous, a larger number of P (predicted)
frames, dependent on the immediate previous I frame and all
the other P frames after that, and a number of B (bidirectional)
frames that depend on both previous and following P frames.
You can read more about at:

https://en.wikipedia.org/wiki/Video_compression_picture_types

So just
> dropping alternate frames
won't work :-(

> It seems I have to uncompress the HVFHD,
> which will result in an enormous file,
> and then re-encode it at 25fps with libx264.

It's not necessary to first save the RAW uncompressed
video stream file; see more at:

https://trac.ffmpeg.org/wiki/Encode/H.264

I conducted a test myself:
a 5min long hvfsd (960x540p, 25fps, VideoBR ca. 2750k)
sample was recoded to 25fps via:

ffmpeg -i "audio-video50fps.mp4" -c:a copy -c:v libx264 -profile:v 
high -level 4.1 -r 25.000 -crf 20 -maxrate 1200k -bufsize 1800k 
"audio-video25fps.mp4"

This is on an ancient under-resourced laptop,
conversion rate was only x0.3 and temp of
one core rose to 80 C (second core was at 76C)
during conversion, so am not willing to do more
tests on this machine!

Original file was at 105 MiB, the end file was 48.5 MiB
and played fine on all my software players...

Regards,
Vangelis.
 




More information about the get_iplayer mailing list