Pergunta

I have a 11-minute .mkv file with a h264 video stream, taking up 184MB of space. I would like to reduce the size of this file. I figured I could just reduce the bit-rate. But ffprobe doesn't output any. In fact, it says the length of the file is calculated from the bitrate and thus could be inaccurate, but there's no bitrate either in the summary or in the [FORMAT] entry:

> ffprobe -show_format file.mkv
[matroska,webm @ 0x7f8e8084b200] Estimating duration from bitrate, this may be inaccurate
Input #0, matroska,webm, from 'file.mkv':
  Duration: 00:11:11.59, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: h264 (High), yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
    Stream #0.1: Audio: aac, 48000 Hz, 5.1, s16 (default)
[FORMAT]
...
bit_rate=0.000000 
[/FORMAT]

Thank you.

EDIT: My understanding is that H.264 is a protocol. As such, I cannot tell, based on the ffprobe documentation, what implementation the h264 codec uses. If anyone knows that, I'd be grateful.

Foi útil?

Solução

file size / assumed duration = bitrate. (184 MB * 8192 [converts MB to kilobits]) / 671 seconds = ~2246 kilobits per second. Of course this is the average bitrate of the whole file, and not just the video stream.

If you want to target a specific output file size such as 100 MB and want the audio to take up to 128 kb/s: (100 MB * 8192) / 671 seconds = 1220 kb/s total bitrate - 128 kb/s desired audio bitrate = 1092 kb/s video bitrate.

Final results of the actual output file may vary.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top