some unsolicited knowledge sharing:
Here's a command you can use to convert H-264/AC3 MKV files to a browser-supported H-264/FLAC MP4 without any video transcoding (so no loss in quality). Audio streams are transcoded, but it's not really noticeable unless you have extremely high-fidelity inputs.
ffmpeg -i input.mkv -map 0 -c copy -c:a flac output.mp4
Explanation:
- ffmpeg
- executes the program, exactly what it sounds like.
- -i input.mkv
- select the input file to load. I don't think the extension matters, but it won't hurt to make sure it's
mkv
.
- -map 0
- make sure that all streams are included. Without this, alternate audio/video streams may be silently dropped.
- -c copy
- tell ffmpeg to copy streams without modification. This avoids any transcoding and ensures that the H-264 streams are preserved.
- -c:a flac
- override the previous command for audio streams specifically. We want them in FLAC format which is supported by both MP4 container format and all modern web browsers.
- output.mp4
- specify the output file. The file extension matters!
#KnowledgeSharing #FFMPEG