Keeping the original bitrate while encoding to H.264

0

Is there any ways to use the original bitrate of the input file? The purpose I do this is because I don't know whether keeping the original bitrate while encoding will shorten the conversion time. If it doesn't shorten the time, I will just simply use the closest bitrate.

ffmpeg -i input.avi -c:v libx264 -preset slow -b:v ORIGINAL -pass 2 -c:a ac3 -b:a 192k output.mp4

WhatWhereWhen

Posted 2015-10-25T14:47:21.617

Reputation: 1

2Original bitrate does not necessarily mean much. How do you know the original bitrate is sane? How do you know that whoever made the video knew what they were doing? How do you know that the encoder implementation used was good or crappy? What if the input format is different? For example, imagine DV input at about 25 megabits/sec, then trying to use that bitrate for H.264. I suggesting re-wording your question. What is it that you want to do, exactly? – llogan – 2015-10-25T16:58:17.000

I would still like an actual answer to the question, because I'm using complex_filter to mute certain parts of the video and cut out others. Otherwise, I want to keep the video file as original as possible. – Matt – 2017-07-24T22:49:14.740

Answers

1

Unless you absolutely need to reencode the video track to a different codec for compability issues, there is no point in encoding with the exact same bitrate.

Seeing that you try to convert video from a .avi (likely MPEG-4 Part 2 or MPEG-2) to an H.264 track, I don't think that compatiliby is an issue ?

Have you tried keeping the original video stream using stream copy ?

ffmpeg -i input.avi -c:v copy -c:a ac3 -b:a 192k output.mp4

Ely

Posted 2015-10-25T14:47:21.617

Reputation: 1 378

But how do you do this while using filter_complex? In other words, how do you actually keep the original bitrate? – Matt – 2017-07-24T22:53:18.027

The command shown changes the container from avi to mp4, the video stream is copied into the new file as is - their bitrates will be identical. – dkam – 2019-03-10T23:03:15.283