Skip to content

Instantly share code, notes, and snippets.

@patrislav1
Created September 11, 2021 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrislav1/6156117c3ffc64f1d0165a06f220de84 to your computer and use it in GitHub Desktop.
Save patrislav1/6156117c3ffc64f1d0165a06f220de84 to your computer and use it in GitHub Desktop.
Lossless conversion from .avi to .mkv (for Smart TV compatibility)
#!/bin/bash
FILES=$(find . -name "*.avi")
while read FILE; do
DESTFILE=$(echo ${FILE} | sed 's/\.avi$/\.mkv/g')
rm -f "${DESTFILE}"
ffmpeg -fflags +genpts -nostdin -i "${FILE}" -c:v copy -c:a copy "${DESTFILE}"
ls -lh "$FILE"
ls -lh "$DESTFILE"
done <<< $FILES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment