Skip to content

Instantly share code, notes, and snippets.

@xavery
Created January 25, 2014 21:23
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 xavery/8623812 to your computer and use it in GitHub Desktop.
Save xavery/8623812 to your computer and use it in GitHub Desktop.
an awk script for parsing the output of ffprobe and generating a tracklisting
#!/bin/awk -f
/TITLE/ {
FS=": ";
$0=$0;
Title=$2;
}
/Duration/ {
FS=" ";
$0=$0;
Duration=substr($2,4,5);
}
/track/ {
FS=": ";
$0=$0;
Track=$2;
}
END {
printf("%s - %s [%s]\n", Track, Title, Duration);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment