Skip to content

Instantly share code, notes, and snippets.

View Lucky1313's full-sized avatar

David Hedin Lucky1313

  • Skylla Technologies
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lucky1313 on github.
  • I am davidhedin (https://keybase.io/davidhedin) on keybase.
  • I have a public key ASDMHAUxr8pNRfTagVnjHc-bjT-_oUy4GY8TiupUyjzMNAo

To claim this, I am signing this object:

@Lucky1313
Lucky1313 / convert.sh
Created October 26, 2016 05:58
Convert file to mp4, with stream monitoring
#!/bin/sh
for file in "$@"; do
echo "-> Transcoding '$file'..."
dst=`dirname "$file"`
new=`basename "$file" | sed 's@\.[a-z0-9][a-z0-9][a-z0-9]$@@'`.mp4
#ffmpeg -i "$file" -v warning -c:v libx264 -c:a copy -map 0:v -map 0:a "$dst/$new"
ffmpeg -v warning -i "$file" -c:v libx264 -c:a copy -map 0:v -map 0:a -f matroska pipe:1 | pv | ffmpeg -v warning -i pipe:0 -c copy -f mp4 "$dst/$new"