[solved] Wildcard, Video Audio ID.

Forum rules
Before you post please read how to get help
Post Reply
Mattyboy
Level 6
Level 6
Posts: 1196
Joined: Thu Mar 26, 2015 2:17 pm

[solved] Wildcard, Video Audio ID.

Post by Mattyboy » Wed May 09, 2018 6:20 am

Code: Select all

mintman@mintman-To-be-filled-by-O-E-M ~ $ cat /home/mintman/.bash_aliases
alias lost='cd ~/Desktop/shows/lost; ls && mplayer L* -aid 2' 
My mother is in bed after having a hip operation and she's been watching the show Lost which I've downloaded for her. The idea is to just type in 'lost' in terminal and it will then play and continue to play the next episode without her having to get out of bed.

The above command works fine apart from selecting the audio id contained in the video stream -aid 2. The wildcard, used to play each file in numerical order, seems to be throwing that selection off in mplayer

Code: Select all

mplayer L* -aid 2
any suggestions? Thanks :)
Last edited by Mattyboy on Wed May 09, 2018 9:32 pm, edited 1 time in total.

rene
Level 7
Level 7
Posts: 1888
Joined: Sun Mar 27, 2016 6:58 pm

Re: Wildcard, Video Audio ID.

Post by rene » Wed May 09, 2018 7:59 pm

mplayer's -aid is I believe a strictly per-input option. That is, while you are saying, e.g.,

Code: Select all

mplayer L1 L2 L3 -aid 2
you should be saying

Code: Select all

mplayer L1 -aid 2 L2 -aid 2 L3 -aid 2
You can do so with

Code: Select all

mplayer $(for LOST in L*; do echo "$LOST" -aid 2; done)
Note, before you do, also try if simply mplayer -aid 2 L* makes the -aid apply to all inputs; don't have mplayer here to test but don't believe it does. Also, before this I posted calling mplayer itself in a loop,

Code: Select all

for LOST in L*; do mplayer "$LOST" -aid 2; done
but near-immediately deleted it again when noticing that wasn't in fact what you were asking; you may have still gotten a notification for it though. And, in fact, might be all you need I suppose.

Mattyboy
Level 6
Level 6
Posts: 1196
Joined: Thu Mar 26, 2015 2:17 pm

Re: Wildcard, Video Audio ID.

Post by Mattyboy » Wed May 09, 2018 9:32 pm

rene wrote:
Wed May 09, 2018 7:59 pm
Thanks rene.

Simply swapping the aid selection round worked a treat, it became the default for all episodes.

Code: Select all

mintman@mintman-To-be-filled-by-O-E-M ~ $ cat /home/mintman/.bash_aliases
alias lost='cd ~/Desktop/shows/lost; ls && mplayer -aid 2 L*'
Appreciated :D

rene
Level 7
Level 7
Posts: 1888
Joined: Sun Mar 27, 2016 6:58 pm

Re: [solved] Wildcard, Video Audio ID.

Post by rene » Thu May 10, 2018 9:40 am

Darn it. The for loop so as to build the command line was much neater.

Post Reply

Return to “Scripts & Bash”