[MPlayer-users] Possible to get full track path in slave mode?

Alexander Strasser eclipse7 at gmx.net
Sat Mar 30 21:47:01 EET 2019


Hi!

On 2019-03-28 20:26 -0700, Alec Bennett wrote:
> If there was some way to get mplayer to display the text it shows at the
> start of playback, I could process that.
>
> As it is, my workaround has been to launch a thread in my script that
> constantly monitors stdout from mplayer for the intro message shown at the
> start of each track, but that's of course messy.
>
> Here's sample output when it starts playing in -quiet mode, with the text I
> need in bold:

I'm a bit puzzled about how your script works or what your use case
is exactly.

The usual way to get the information you need reliably is use the
-identify option. Here is the excerpt from the man page:

   -identify

     Shorthand for -msglevel identify=4. Show file parameters in an
     easily parseable format. Also prints more detailed information
     about subtitle and audio track languages and IDs. In some cases
     you can get more information by using -msglevel identify=6. For
     example, for a DVD or Blu-ray it will list the chapters and time
     length of each title, as well as a disk ID. Combine this with
     -frames 0 to suppress all video output. The wrapper script
     TOOLS/midentify.sh suppresses the other MPlayer output and
     (hopefully) shellescapes the filenames.


Hope it helps.

  Alexander


> *Playing /media/wrybread/test/test.mp3*
> Audio only file format detected.
> Load subtitles in /media/wrybread/test/
> ==========================================================================
> Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
> AUDIO: 44100 Hz, 2 ch, s16le, 192.0 kbit/13.61% (ratio: 24000->176400)
> Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II,
> III)
> ==========================================================================
> AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
> Video: no video
> Starting playback...
>
>
> On Thu, Mar 28, 2019 at 8:21 PM Alec Bennett <wrybread at gmail.com> wrote:
>
> > Looking over the docs for slave mode:
> >
> > http://www.mplayerhq.hu/DOCS/tech/slave.txt
> >
> > I see "get_file_name", which returns the basename of the currently playing
> > track, but I don't see a way to get the complete path of the currently
> > playing track.
> >
> > Is there some clever way to get the complete path?


More information about the MPlayer-users mailing list