Discussion:
[MPlayer-users] how do you specify the path in mplayer's "mf:" parameter
David Hepburn
2016-07-03 21:56:05 UTC
Permalink
Apologies for posting this twice (in June), but I'm not sure how these posts
work and whether they are carried over to the new month.

I'm trying to use mplayer to player a single JPG image for 10 secs. Problem
I'm finding is I don't know how to specify the path where the JPG is. It
would appear to me that the JPG must be in the "current" folder for it to
work.

Line Command to play test.jpg for 10secs, where "C:\folder1" was made the
current folder prior to this execution:-
"C:\folder1\mplayer.exe" "mf://test.jpg" -mf fps=1 -loop 425

In my example above, both mplayer.exe & test.jpg reside in "C:\folder1"
however I want to put the JPG in the subfolder, "C:\folder1\folder2",
without having to make it the "current" folder in Windows.

Is there any way to specify a windows path so the media path doesn't have to
be the current directory?
I tried adding in a Windows path like this
"mf://C:\folder1\folder2\test.jpg" but it was ignored and didn't play
anything.

Thanks,
Dave.
Windows 10
I7 processor
Stephen Mollett
2016-07-04 12:17:29 UTC
Permalink
Post by David Hepburn
Is there any way to specify a windows path so the media path doesn't
have to be the current directory?
I tried adding in a Windows path like this
"mf://C:\folder1\folder2\test.jpg" but it was ignored and didn't play
anything.
Hi Dave,

I don't have a Windows PC to hand right now to test this but have you
tried using forward slashes in the path instead of backslashes - e.g.
"C:/folder1/folder2/test.jpg"?

MPlayer is primarily developed on Unix-like operating systems where the
standard path separator is the forward slash and the backslash has a
different meaning. (It's used to "escape" characters so any special
meaning they may have is ignored and they are passed through to the
underlying program as-is - it can even escape itself!)

Stephen
David Hepburn
2016-07-04 22:17:20 UTC
Permalink
yep tried that - still gets ignored...

--------------------------------------------------
From: "Stephen Mollett" <molletts-at-***@ffmpeg.org>
Sent: Monday, July 4, 2016 10:17 PM
To: "MPlayer usage questions, feature requests, bug reports"
<mplayer-***@mplayerhq.hu>
Subject: Re: [MPlayer-users] how do you specify the path in mplayer's "mf:"
parameter
Post by Stephen Mollett
Post by David Hepburn
Is there any way to specify a windows path so the media path doesn't
have to be the current directory?
I tried adding in a Windows path like this
"mf://C:\folder1\folder2\test.jpg" but it was ignored and didn't play
anything.
Hi Dave,
I don't have a Windows PC to hand right now to test this but have you
tried using forward slashes in the path instead of backslashes - e.g.
"C:/folder1/folder2/test.jpg"?
MPlayer is primarily developed on Unix-like operating systems where the
standard path separator is the forward slash and the backslash has a
different meaning. (It's used to "escape" characters so any special
meaning they may have is ignored and they are passed through to the
underlying program as-is - it can even escape itself!)
Stephen
_______________________________________________
MPlayer-users mailing list
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
Stephen Mollett
2016-07-06 18:56:35 UTC
Permalink
Hi Dave,
Post by David Hepburn
... have you tried using forward slashes in the path ...
yep tried that - still gets ignored...
Hm, interesting. I've borrowed a Windows laptop from a friend and had a
poke around.

It seems that part of MPlayer recognises either forward- or backslashes
- it correctly says:

[mf] number of files: 1 (4)

when the file exists but then the demuxer crashes with a segmentation
fault, unless the file also exists in the current working directory, in
which case it uses that copy instead. (It works fine on Linux so it's
definitely related to running on Windows.)

I've included the output of mplayer -v for the segfault case. It doesn't
look terribly informative to me. Anyone with a knowledge of the code
base and the necessary Windows toolchain who feels like poking around -
see the end of this message.

As a workaround, you might be able to use a wrapper script - a batch
file to change directory to where the image is, call MPlayer from there,
then change back afterwards. Something like this might work:

---- Start mp.cmd ----

@echo off

pushd "%~dp1"

"C:\folder1\mplayer.exe" "mf://%~nx1" -mf fps=1 -loop 425

popd

---- End mp.cmd ----

Just call the batch file with the name of the media file as its argument
and it should work.

That's obviously a very basic case which isn't very flexible but it
might point you in the right direction. (You could use "shift" to go
through a list of files provided on the command line. The "%~dp1" pulls
out the drive letter and path from "%1" and the "%~nx1" gets the
filename and extension. Unfortunately, you can't use these operators
directly on normal variables but but you could use a dummy "for" loop to
apply them to a variable - they do work on the the pseudo-variables in a
for loop.)

Stephen

---- mplayer -v output ----

MPlayer sherpya-r37875+gce466d0-5.4.0 (C) 2000-2016 MPlayer Team

CPU vendor name: GenuineIntel max cpuid level: 2

CPU: Intel(R) Celeron(R) M processor 1.40GHz (Family: 6, Model:
13, Stepping: 8)

extended cpuid-level: 8

extended cache-info: 67125312

Detected cache-line size is 64 bytes

Testing OS support for SSE... yes.

CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNowExt: 0 SSE: 1 SSE2: 1 SSE3: 0
SSSE3: 0 SSE4: 0 SSE4.2: 0 AVX: 0

Compiled with runtime CPU detection.

Setting PATH to
C:\Users\Stephen\Downloads\MPlayer-generic-r37875+gce466d0\MPlayer-generic-r37875+gce466d0\codecs

get_path('codecs.conf') ->
'C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/codecs.conf'

Reading optional codecs config file
C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/codecs.conf:
No such file or directory

Using built-in default codecs.conf.

init_freetype

Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay

get_path('fonts') ->
'C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/fonts'

Configuration: --prefix=/invalid --host-cc=gcc --cc=i686-w64-mingw32-gcc
--as=i686-w64-mingw32-as --ar=i686-w64-mingw32-ar
--nm=i686-w64-mingw32-nm --ranlib=i686-w64-mingw32-ranlib
--windres=i686-w64-mingw32-windres --enable-cross-compile
--enable-runtime-cpudetection --enable-static --enable-postproc
--disable-vidix --disable-inet6 --enable-gnutls --enable-dvdnav
--enable-dvdread --enable-bluray --enable-menu --enable-faac
--disable-faac-lavc --enable-libfdk-aac
--extra-cflags=-I/usr/i686-w64-mingw32/live --with-arch=i486
--with-tune=generic --disable-fast-clz

CommandLine: '-v' 'mf://E:/My Stuff/nobrain.jpg' '-mf' 'fps=1' '-loop' '10'

Using Windows native timing

get_path('input.conf') ->
'C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/input.conf'

Parsing input config file
C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/input.conf

Input config file
C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/input.conf
parsed: 92 binds

get_path('nobrain.jpg.conf') ->
'C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/nobrain.jpg.conf'



Playing mf://E:/My Stuff/nobrain.jpg.

get_path('sub/') ->
'C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/sub/'

WINSOCK2 init: 0

STREAM: [mf] mf://E:/My Stuff/nobrain.jpg

STREAM: Description: Multiple files input

STREAM: Author: Benjamin Zores, Albeu

STREAM: Comment:

MF file format detected.

[mf] search expr: E:/My Stuff/nobrain.jpg*

[mf] number of files: 1 (4)

Fontconfig warning: line 146: blank doesn't take any effect anymore.
please remove it from your fonts.conf





MPlayer interrupted by signal 11 in module: demux_open

- MPlayer crashed by bad usage of CPU/FPU/RAM.

Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and

disassembly. Details in
DOCS/HTML/en/bugreports_what.html#bugreports_crash.

- MPlayer crashed. This shouldn't happen.

It can be a bug in the MPlayer code _or_ in your drivers _or_ in your

gcc version. If you think it's MPlayer's fault, please read

DOCS/HTML/en/bugreports.html and follow the instructions there. We
can't and

won't help unless you provide this information when reporting a
possible bug.
David Hepburn
2016-07-06 21:50:48 UTC
Permalink
Thanks Stephen. I ended up writing an AutoHotKey script that changes the
working directory prior to running mplayer. That did the job but would still
be interested in knowing how mplayer could do it directly.
Interestingly, the "loop 425" option was the only way I could get it to show
a JPG for 10 secs. Would seem the "-mf fps=1 -loop 0.1" way must be a Linux
thing too as it doesn't work on Windows - that just plays the JPG for a
split second no matter what value I put in the loop.

--------------------------------------------------
From: "Stephen Mollett" <molletts-at-***@ffmpeg.org>
Sent: Thursday, July 7, 2016 4:56 AM
To: "MPlayer usage questions, feature requests, bug reports"
<mplayer-***@mplayerhq.hu>
Subject: Re: [MPlayer-users] how do you specify the path in mplayer's "mf:"
parameter - verbose output included
Post by Stephen Mollett
Hi Dave,
Post by David Hepburn
... have you tried using forward slashes in the path ...
yep tried that - still gets ignored...
Hm, interesting. I've borrowed a Windows laptop from a friend and had a
poke around.
It seems that part of MPlayer recognises either forward- or backslashes
[mf] number of files: 1 (4)
when the file exists but then the demuxer crashes with a segmentation
fault, unless the file also exists in the current working directory, in
which case it uses that copy instead. (It works fine on Linux so it's
definitely related to running on Windows.)
I've included the output of mplayer -v for the segfault case. It doesn't
look terribly informative to me. Anyone with a knowledge of the code
base and the necessary Windows toolchain who feels like poking around -
see the end of this message.
As a workaround, you might be able to use a wrapper script - a batch
file to change directory to where the image is, call MPlayer from there,
---- Start mp.cmd ----
@echo off
pushd "%~dp1"
"C:\folder1\mplayer.exe" "mf://%~nx1" -mf fps=1 -loop 425
popd
---- End mp.cmd ----
Just call the batch file with the name of the media file as its argument
and it should work.
That's obviously a very basic case which isn't very flexible but it
might point you in the right direction. (You could use "shift" to go
through a list of files provided on the command line. The "%~dp1" pulls
out the drive letter and path from "%1" and the "%~nx1" gets the
filename and extension. Unfortunately, you can't use these operators
directly on normal variables but but you could use a dummy "for" loop to
apply them to a variable - they do work on the the pseudo-variables in a
for loop.)
Stephen
---- mplayer -v output ----
MPlayer sherpya-r37875+gce466d0-5.4.0 (C) 2000-2016 MPlayer Team
CPU vendor name: GenuineIntel max cpuid level: 2
13, Stepping: 8)
extended cpuid-level: 8
extended cache-info: 67125312
Detected cache-line size is 64 bytes
Testing OS support for SSE... yes.
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNowExt: 0 SSE: 1 SSE2: 1 SSE3: 0
SSSE3: 0 SSE4: 0 SSE4.2: 0 AVX: 0
Compiled with runtime CPU detection.
Setting PATH to
C:\Users\Stephen\Downloads\MPlayer-generic-r37875+gce466d0\MPlayer-generic-r37875+gce466d0\codecs
get_path('codecs.conf') ->
'C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/codecs.conf'
Reading optional codecs config file
No such file or directory
Using built-in default codecs.conf.
init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
get_path('fonts') ->
'C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/fonts'
Configuration: --prefix=/invalid --host-cc=gcc --cc=i686-w64-mingw32-gcc
--as=i686-w64-mingw32-as --ar=i686-w64-mingw32-ar
--nm=i686-w64-mingw32-nm --ranlib=i686-w64-mingw32-ranlib
--windres=i686-w64-mingw32-windres --enable-cross-compile
--enable-runtime-cpudetection --enable-static --enable-postproc
--disable-vidix --disable-inet6 --enable-gnutls --enable-dvdnav
--enable-dvdread --enable-bluray --enable-menu --enable-faac
--disable-faac-lavc --enable-libfdk-aac
--extra-cflags=-I/usr/i686-w64-mingw32/live --with-arch=i486
--with-tune=generic --disable-fast-clz
CommandLine: '-v' 'mf://E:/My Stuff/nobrain.jpg' '-mf' 'fps=1' '-loop' '10'
Using Windows native timing
get_path('input.conf') ->
'C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/input.conf'
Parsing input config file
C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/input.conf
Input config file
C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/input.conf
parsed: 92 binds
get_path('nobrain.jpg.conf') ->
'C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/nobrain.jpg.conf'
Playing mf://E:/My Stuff/nobrain.jpg.
get_path('sub/') ->
'C:/Users/Stephen/Downloads/MPlayer-generic-r37875+gce466d0/MPlayer-generic-r37875+gce466d0/mplayer/sub/'
WINSOCK2 init: 0
STREAM: [mf] mf://E:/My Stuff/nobrain.jpg
STREAM: Description: Multiple files input
STREAM: Author: Benjamin Zores, Albeu
MF file format detected.
[mf] search expr: E:/My Stuff/nobrain.jpg*
[mf] number of files: 1 (4)
Fontconfig warning: line 146: blank doesn't take any effect anymore.
please remove it from your fonts.conf
MPlayer interrupted by signal 11 in module: demux_open
- MPlayer crashed by bad usage of CPU/FPU/RAM.
Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
disassembly. Details in
DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
gcc version. If you think it's MPlayer's fault, please read
DOCS/HTML/en/bugreports.html and follow the instructions there. We
can't and
won't help unless you provide this information when reporting a
possible bug.
_______________________________________________
MPlayer-users mailing list
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
Loading...