view TOOLS/midentify.sh @ 34476:fd5512f5bfe9

Fix -ass-styles with SRT subs and more. The most visible problems are fixed by switching SRT event "Style" value from first style to default_style. To fix issues with overriding "Default" style, this adds a dummy style first, to stop libass from adding a style with the name "Default" (this is a problem since some of the libass code picks the first, some the last style - encoded in default_track - with the name "Default"). If after loading the ass-styles file there still is no default style, MPlayer adds and sets its own.
author reimar
date Sat, 14 Jan 2012 14:06:29 +0000
parents 305dc504c407
children 877e37095c2d
line wrap: on
line source

#!/bin/sh
#
# This is a wrapper around the -identify functionality.
# It is supposed to escape the output properly, so it can be easily
# used in shellscripts by 'eval'ing the output of this script.
#
# Written by Tobias Diedrich <ranma+mplayer@tdiedrich.de>
# Licensed under GNU GPL.

if [ -z "$1" ]; then
	echo "Usage: midentify.sh <file> [<file> ...]"
	exit 1
fi

mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null |
	sed -ne '/^ID_/ {
	                  s/[]()|&;<>`'"'"'\\!$" []/\\&/g;p
	                }'