shell - Using mplayer to determine length of audio/video file -


Works very well to determine the length of the various audio / video files:

  Mplayer-unknownify file.ogg 2> / Dev / null | Grep id_LENGTH  

However, I want to kill the output of mplayer so that I can determine the length of many files more efficiently. How do i do this MPlayer source ships with a sample script blurring

, which looks like this:
  #! / Bin / Sh # # This is a cover around the dependent functionality # This output is considered to be properly avoided, so it can easily be used in # shellscripts by 'eval'ing the output of this script # # Written by Tobias Diderich; & Lt; Ranma+mplayer@tdiedrich.de> # Licensed under GNU GPL If [- "$ 1"]; Then echo "use: midentify.sh  [ gt; ...)" exit 1fire emplaire -va null-oaol-frame 0 -define "$ @" 2> gt; & lt; file & gt; ; / Dev / null | Sed -ne '/ ^ id_ / {s / [] () | & Amp;; & Lt; & Lt; & Gt; `'' '' \\! $ "[] / \\ & amp; / g; P} ' 

-frame 0 creates mplayer immediately out of To open any video or audio device to prevent this from happening, this option is all entered in the man mplayer , and -or null-n tap.


Comments