Different mplayer_opts depending on file extension

Moderator: Moderator

sylence
Posts: 1
Joined: Sun Dec 14, 2008 2:12 pm

Different mplayer_opts depending on file extension

Postby sylence » Sun Dec 14, 2008 2:22 pm

Greetings,

Forum search didn't help - there were similiar topics some time ago,
but none of them gave me a useful answer. Is it possible to pass totally different option strings to mplayer, depending on filenames, playlist contents or something? At the moment I'm trying to pass "-vc vp6" only for a specific .pls file, but I've no idea how to do that in an elegant manner. I know it might be possible to change the mplayer_path to a self-written script containing some regex garbage, but I wonder if it's possible to use the filetypes_m options in MovieConfig for different option strings (e.g. mplayer_pls_opts)?

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Re: Different mplayer_opts depending on file extension

Postby Uatschitchun » Sun Dec 14, 2008 3:40 pm

Pls post a feature request on that
Lg
Roman

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Re: Different mplayer_opts depending on file extension

Postby acmelabs » Sun Dec 14, 2008 5:06 pm

sylence wrote:Greetings,

Forum search didn't help - there were similiar topics some time ago,
but none of them gave me a useful answer. Is it possible to pass totally different option strings to mplayer, depending on filenames, playlist contents or something? At the moment I'm trying to pass "-vc vp6" only for a specific .pls file, but I've no idea how to do that in an elegant manner. I know it might be possible to change the mplayer_path to a self-written script containing some regex garbage, but I wonder if it's possible to use the filetypes_m options in MovieConfig for different option strings (e.g. mplayer_pls_opts)?

I use this garbage here, and it works pretty well fro me. Create this file /usr/local/bin/mplayer.sh and make it executable.

Code: Select all

TRANSPORT_STREAM=$(echo "${@}" | egrep -i "(\.ts$|\.mts$|\.m2ts$)")
MATROSKA_STREAM=$(echo "${@}" | egrep -i "(\.mkv$)")
if [[ $TRANSPORT_STREAM ]]; then
  echo "transport stream given.."
/usr/local/bin/mplayer "${@}" -ao sdl -lavdopts threads=3:fast:skiploopfilter=all -cache 4096 -osdlevel 3 -fps 50  -vo xv  -vf pp=fd
  renice -20 $(pgrep mplayer)
  renice -20 $(pgrep mplayer-ts)
elif [[ $MATROSKA_STREAM ]];  then
  echo "matroska given..("$MATROSKA_STREAM")"
   /usr/local/bin/mplayer -vc coreserve -demuxer mkv "${@}" -ao sdl
else
  echo "all other given.."
   /usr/local/bin/mplayer "${@}" -ao sdl
fi



And edit your /etc/mms/MplayerConfig accordingly.

Code: Select all

mplayer_path = /usr/local/bin/mplayer.sh

The default behavior of MMS suits most for old formats like divx and avi, and doesn't reflect the new 720p/1080p HD formats.
This is my way to play .mts (mpeg transport stream (AVCHD/H.264) form my Canon HF100, mkv (Matroska/H.264, mostly from PirateBay ;-), and old avi files. Extend this scripts to your needs.

Regards,
Andreas

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Re: Different mplayer_opts depending on file extension

Postby Uatschitchun » Mon Dec 15, 2008 9:42 am

The solution with running an external script is ok, but I do like the idea of:
use the filetypes_m options in MovieConfig for different option strings (e.g. mplayer_pls_opts)?

So pls do file a feature-request on that!

Else, a nice and extensible external script would be fine, so I could add that to the debs, too :P
Lg

Roman

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Re: Different mplayer_opts depending on file extension

Postby acmelabs » Mon Dec 15, 2008 12:48 pm

Uatschitchun wrote:The solution with running an external script is ok, but I do like the idea of:
use the filetypes_m options in MovieConfig for different option strings (e.g. mplayer_pls_opts)?

So pls do file a feature-request on that!

Else, a nice and extensible external script would be fine, so I could add that to the debs, too :P

I'd even like to see, that the thumbnailer obeys to this filetypes_m thing too, else I do have grey or distorted thumbs for .mts (AVCHD) stuff, no matter what thumbnail switch I use for it.
At the moment I've bent the source code in ~/mms-1.1.0/plugins/features/movie/mplayer/mplayer.cpp in line 336, in order to have thumbs for .mts content (without the internal thumbnailer).

Code: Select all

run::external_program(string("mplayer -fps 50 -noconsolecontrols -loop 1 -nojoystick -nolirc -nomouseinput -ao null ") + scale + " -frames 4 -vo jpeg:outdir=" + conf->p_temp_image_loc() + " -ss " + conv::itos(seeklength) + " " + string_format::escape_string(file) + " > /dev/null");


Regards,
Andreas


Return to “general discussion”

Who is online

Users browsing this forum: No registered users and 3 guests