V
V
Vasily Nikonov2021-03-11 19:01:34
fmpeg
Vasily Nikonov, 2021-03-11 19:01:34

How to quickly and efficiently convert .mkv and .avi videos to .mp4 in FFmpeg?

Hello, dear Khabrchane!

I have a need to convert the series folder (directory with folders and subfolders) from .mkv , .avi to .mp4 via FFmpeg terminal version as quickly and efficiently as possible (for example, using CPU + GPU + hardware decoding) -- I have a RaspberryPi 4 model B (8 Gb) + Raspberry Pi OS Lite or Raspberry Pi OS with desktop (whichever is more efficient).

I would also like to clarify what bitrate should be set for Full HD 25 FPS video (that's what all the files of the series are like), so that the size would be nicely reduced and the video quality would not suffer much.

My 'tests' tests for bitrate
Сам немного поигравшись с битрейтом для одного файла (было 6700~ mbps), получил, что если поставить битрейт на 3000 mbps, то разницы, сильно не вглядываясь в каждый пиксель, я не вижу абсолютно. И на 4к телеке смотрел (49" и 2~ метра от глаз), и на ноуте (MacBook Air 13" 2017), и на iMac 27" 2020 -- разницу вижу только если приглядеться. Но размер при этом сократился с 1.26 ГБ до 593,2 МБ


Please help with the command for the terminal version of FFmpeg, so that the command would go through all folders and subfolders, convert .mkv and .avi files to .mp4 as efficiently and quickly as possible, a little (or a lot if the bitrate is 3000 mbps for Full HD 25 FPS video is sufficient) reducing their size, but without losing picture quality.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
1
15432, 2021-03-11
@15432

All these formats are just a container, a wrapper. Recoding is not required at all. Just specify -c copy and the desired output file format, it will instantly transfer it to you in seconds.

P
pumpkinm, 2021-03-11
@pumpkinm

Experiment with the ffmpeg options -codec:v h264_omx and -codec:v h264_mmal . This is hardware encoding/decoding on the RPi4.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question