Schnee (schnee) wrote,
Schnee
schnee

Recoding videos with ffmpeg

It's easy. To only recode the video stream (using HEVC/H.265/libx265 in this case), do this:

$ ffmpeg -i infile.mp4 -c:v hevc -c:a copy outfile.mp4

To also encode audio (using AAC), do this:

$ ffmpeg -i infile.mp4 -c:v hevc -c:a aac -b:a 192k outfile.mp4

In either case, “-c” stands for “codec”, while “-b” stands for “bitrate”. To find out what codecs a file currently uses and what the bitrates are, use

$ ffmpeg -i infile.mp4

I don't usually recommend reencoding audio; you'll get a noticeable quality loss without saving much in terms of file size. Video, on the other hand …

Tags: ffmpeg, useful stuff, videos
Subscribe

Recent Posts from This Journal

  • Icelandic is cool

    Just spotted this over on OCremix: I think that should be " veiðigyðja fjallanna" instead — Icelandic doesn't work like…

  • How democracy should work

    From Allan J. Lichtman, Predicting the Next President: The Keys to the White House (2020 Edition), p. viii–ix: A properly functioning…

  • Blade Runner: San Francisco

    It's exactly what it says on the tin: Impressive — just wish it was longer. (H/t to canisrufus_uk BTW.)

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments