This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Dichotomic search in bash | |
# This is a bash-specific function that uses bash features. | |
# This is not guaranteed to work in other shells. | |
# | |
# Usage: | |
# source dichotomic-bash.sh | |
# result=$(dichotomic_search min max command) | |
# | |
# Returns the largest i for which `command i` succeeds (exits with a null exit code) |
Essentially just copy the existing video and audio stream as is into a new container, no funny business!
The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.
With ffmpeg
this can be achieved with -c copy
. Older examples may use -vcodec copy -acodec copy
which does the same thing.
These examples assume ffmpeg
is in your PATH
. If not just substitute with the full path to your ffmpeg binary.