Discussion:
[MPlayer-users] debian wmv Video used to play but Doesn't now.
Martin McCormick
2018-09-12 17:22:35 UTC
Permalink
I have a file that I first acquired in 2006 called
kosovo.wmv. At that time, mplayer would play the sound with no
trouble but it seems that no matter what I set in
~/.mplayer/config, there is no audio. An example of the messages
from mplayer follows:

$mplayer -quiet ~/videos/kosovo.wmv
MPlayer 1.3.0 (Debian), built with gcc-6.2.1 (C) 2000-2016 MPlayer Team

Playing /home/martin/videos/kosovo.wmv.
libavformat version 57.56.101 (external)
Mismatching header version 57.56.100
ASF file format detected.
[asfheader] Audio stream found, -aid 1
[asfheader] Video stream found, -vid 2
VIDEO: [WMV2] 320x240 24bpp 1000.000 fps 185.0 kbps (22.6 kbyte/s)
==========================================================================
Forced video codec: null
Opening video decoder: [null] Null video decoder
Movie-Aspect is undefined - no prescaling applied.
VO: [null] 320x240 => 320x240 BGR 24-bit
Selected video codec: [null] vfm: null (NULL codec (no decoding!))
==========================================================================
Load subtitles in /home/martin/videos/
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 57.64.101 (external)
AUDIO: 32000 Hz, 2 ch, floatle, 40.0 kbit/1.95% (ratio: 5000->256000)
Selected audio codec: [ffwmav2] afm: ffmpeg (DivX audio v2 (FFmpeg))
==========================================================================
[AO_ALSA] Unable to set samplerate-2: Invalid argument
Failed to initialize audio driver 'alsa'
Could not open/initialize audio device -> no sound.
Audio: no sound
Starting playback...


Exiting... (End of file)

The ~/.mplayer/config file is set as follows:

# Write your default config options here!
lirc=NO
joystick=NO
vc=null
vo=null
#ao=oss
ao=alsa

If I take out
ao=alsa and replace that with ao=oss, we get pretty much the same
results except that the mute playback appears to either never end
and lasts far longer than the video normally runs.

When run without the -quiet flag, it prints the progress
indicator and that indicator stops counting when one presses the
Space bar and resumes counting on the next press but that's all.
The -quiet session using ao=oss produces the following:

$ mplayer -quiet ~/videos/kosovo.wmv
MPlayer 1.3.0 (Debian), built with gcc-6.2.1 (C) 2000-2016 MPlayer Team

Playing /home/martin/videos/kosovo.wmv.
libavformat version 57.56.101 (external)
Mismatching header version 57.56.100
ASF file format detected.
[asfheader] Audio stream found, -aid 1
[asfheader] Video stream found, -vid 2
VIDEO: [WMV2] 320x240 24bpp 1000.000 fps 185.0 kbps (22.6 kbyte/s)
==========================================================================
Forced video codec: null
Opening video decoder: [null] Null video decoder
Movie-Aspect is undefined - no prescaling applied.
VO: [null] 320x240 => 320x240 BGR 24-bit
Selected video codec: [null] vfm: null (NULL codec (no decoding!))
==========================================================================
Load subtitles in /home/martin/videos/
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 57.64.101 (external)
AUDIO: 32000 Hz, 2 ch, floatle, 40.0 kbit/1.95% (ratio: 5000->256000)
Selected audio codec: [ffwmav2] afm: ffmpeg (DivX audio v2 (FFmpeg))
==========================================================================
[AO OSS] audio_setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-(
AO: [oss] 32000Hz 2ch s16le (2 bytes per sample)
Starting playback...

Exiting... (Quit)

The exit occurred after typing q.

ao=oss seems to cause it to attempt to play nothing forever but
the alsa driver causes the attempt to play to last about as long
as a proper play of that video should run.

Any constructive suggestions are welcome. The file in
question is listed on youtube. It is a good test file to see if
one can play the sound from an older .wmv file and, so far, one
can't although it used to play with no issues.

Martin McCormick WB5AGZ
Nick Koretsky
2018-09-12 18:32:26 UTC
Permalink
On Wed, 12 Sep 2018 12:22:35 -0500
Post by Martin McCormick
I have a file that I first acquired in 2006 called
kosovo.wmv. At that time, mplayer would play the sound with no
trouble but it seems that no matter what I set in
~/.mplayer/config, there is no audio. An example of the messages
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 57.64.101 (external)
AUDIO: 32000 Hz, 2 ch, floatle, 40.0 kbit/1.95% (ratio: 5000->256000)
Selected audio codec: [ffwmav2] afm: ffmpeg (DivX audio v2 (FFmpeg))
==========================================================================
[AO_ALSA] Unable to set samplerate-2: Invalid argument
Failed to initialize audio driver 'alsa'
Could not open/initialize audio device -> no sound.
Audio: no sound
Starting playback...
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 57.64.101 (external)
AUDIO: 32000 Hz, 2 ch, floatle, 40.0 kbit/1.95% (ratio: 5000->256000)
Selected audio codec: [ffwmav2] afm: ffmpeg (DivX audio v2 (FFmpeg))
==========================================================================
[AO OSS] audio_setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-(
AO: [oss] 32000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Any constructive suggestions are welcome. The file in
question is listed on youtube. It is a good test file to see if
one can play the sound from an older .wmv file and, so far, one
can't although it used to play with no issues.
You hardware doesnt support 32Khz. You need to either tell mplayer
to resample audio (-srate whatever you hardware support), or use
autoresampling driver like pulse.
--
Nick Koretsky (***@gmail.com)
stan
2018-09-12 18:37:39 UTC
Permalink
On Wed, 12 Sep 2018 12:22:35 -0500
Post by Martin McCormick
I have a file that I first acquired in 2006 called
kosovo.wmv. At that time, mplayer would play the sound with no
trouble but it seems that no matter what I set in
~/.mplayer/config, there is no audio.
[snip]
Post by Martin McCormick
[AO_ALSA] Unable to set samplerate-2: Invalid argument
Failed to initialize audio driver 'alsa'
Could not open/initialize audio device -> no sound.
Audio: no sound
The alsa device didn't open, so you are never going to get sound. The
error sounds like you are requesting the device set itself to a frame
rate that it doesn't allow. Have you changed your sound device?
Post by Martin McCormick
Any constructive suggestions are welcome. The file in
question is listed on youtube. It is a good test file to see if
one can play the sound from an older .wmv file and, so far, one
can't although it used to play with no issues.
Is it available? Try
aplay -lv
then if the device is there and recognized,
aplay [some wav file]
or
aplay -v -D plughw:0,0 [some wav file]
with the first 0 replaced with the device from the aplay -lv output.
This form compensates for frame rate differences. Does it play?

Do you have pulseaudio installed? Is it controlling the device? Check
with pavucontrol in the gui.

What if you remove the line completely from the configuration file and
let mplayer find the audio device?

I tried grabbing kosovo.wmv with youtube-dl, it complained that the
sound format wasn't compatible with the video, and performed a
transformation, so it probably isn't a good test. But mplayer told me
this about the sound,

Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 1 ch, floatle, 0.0 kbit/0.00% (ratio: 0->192000)
Selected audio codec: [ffopus] afm: ffmpeg (FFmpeg opus)

and played without issue.
Mike Hodson
2018-09-12 19:30:47 UTC
Permalink
Post by stan
Post by Nick Koretsky
On Wed, 12 Sep 2018 12:22:35 -0500
I have a file that I first acquired in 2006 called kosovo.wmv.
Martin, you do you have the .WMV file locally, correct?

"Listed on youtube" implies that indeed, Youtube themselves have converted
the file.
Interestingly enough, to 44.1khz for AAC audio, and by default Opus is
48khz due to its spec.

mediainfo has the following to say about the AAC audio after a manual
download with youtube-dl -f 133+140
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 1mn 5s
Bit rate mode : Variable
Bit rate : 93.6 Kbps
Channel(s) : 2 channels
Channel(s)_Original : 1 channel
Channel positions : Front: C
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 744 KiB (27%)
Encoded date : UTC 2014-02-26 00:20:22
Tagged date : UTC 2014-02-26 00:20:22

and about the Opus audio:
Audio
ID : 2
Format : Opus
Codec ID : A_OPUS
Duration : 1mn 5s
Channel(s) : 1 channel
Channel positions : Front: C
Sampling rate : 48.0 KHz
Compression mode : Lossy
Delay relative to video : -7ms
Language : English
Default : Yes
Forced : No


This test is at best wrong, and at worst altogether misleading if someone
doesn't understand the mechanics behind youtube ingesting a video means the
original audio and video just get eaten up, and new data entirely spat out,
at different samplerates, and file formats. Apparently nothing but the
video dimensions of 320x240 were retained.
Post by stan
I tried grabbing kosovo.wmv with youtube-dl, it complained that the
sound format wasn't compatible with the video, and performed a
transformation, so it probably isn't a good test.
Stan, What ended up happening, is that youtube-dl by default ended up
choosing the Opus audio, with the MP4 video. Why, I'm not 100% sure. In
this case, MKV is used to re-multiplex non-similar-codec bitstreams into 1
file, as MKV does not care that "Mpeg codecs should go with mpeg codecs,
Opus and Vp9 should be together" MKV just contains them, and keeps a codec
label on the stream so the decoder can do what it needs to with the file.

Indeed the test is wholly invalid for reasons outlined above in reply to
Martin's part of this double-reply.

What is actually cared about is the actual WMV format file, that presently
seems to only exist on Martin's local system.

Mike
Martin McCormick
2018-09-13 13:24:23 UTC
Permalink
Post by Mike Hodson
Martin, you do you have the .WMV file locally, correct?
Yes and I don't remember all the details about how I got it as I
have slept a few times since 2006.:-)

A coworker of mine at the time had seen it and had it on
her Windows computer. Where she got it, I have no idea.

I've got it working now. Read on.

I am also actually replying to 2 different messages, here
and my thanks to both posters.
Post by Mike Hodson
The alsa device didn't open, so you are never going to get sound. The
error sounds like you are requesting the device set itself to a frame
rate that it doesn't allow.
Right!
Post by Mike Hodson
Have you changed your sound device?
No but I used to have pulseaudio running quite some time ago.
Then I said,
Post by Mike Hodson
Post by Martin McCormick
Any constructive suggestions are welcome. The file in
question is listed on youtube. It is a good test file to see if
one can play the sound from an older .wmv file and, so far, one
can't although it used to play with no issues.
If Is it available? Try
aplay -lv
That worked.
Post by Mike Hodson
then if the device is there and recognized,
aplay [some wav file]
or
aplay -v -D plughw:0,0 [some wav file]
That also worked. In this case, the old Dell I am using reported
a CS4237B. It doesn't like the sound format.
Post by Mike Hodson
with the first 0 replaced with the device from the aplay -lv output.
This form compensates for frame rate differences. Does it play?
It does. The test wav file I chose turned out to be 8K sampling
and it played that fine.
Post by Mike Hodson
Do you have pulseaudio installed? Is it controlling the device? Check
with pavucontrol in the gui.
What if you remove the line completely from the configuration file and
let mplayer find the audio device?
An excellent question. This is with no specified audio driver:

$ mplayer -quiet kosovo.wmv
MPlayer 1.3.0 (Debian), built with gcc-6.2.1 (C) 2000-2016 MPlayer Team

Playing kosovo.wmv.
libavformat version 57.56.101 (external)
Mismatching header version 57.56.100
ASF file format detected.
[asfheader] Audio stream found, -aid 1
[asfheader] Video stream found, -vid 2
VIDEO: [WMV2] 320x240 24bpp 1000.000 fps 185.0 kbps (22.6 kbyte/s)
==========================================================================
Forced video codec: null
Opening video decoder: [null] Null video decoder
Movie-Aspect is undefined - no prescaling applied.
VO: [null] 320x240 => 320x240 BGR 24-bit
Selected video codec: [null] vfm: null (NULL codec (no decoding!))
==========================================================================
Load subtitles in ./
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 57.64.101 (external)
AUDIO: 32000 Hz, 2 ch, floatle, 40.0 kbit/1.95% (ratio: 5000->256000)
Selected audio codec: [ffwmav2] afm: ffmpeg (DivX audio v2 (FFmpeg))
==========================================================================
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
[AO_ALSA] Unable to set samplerate-2: Invalid argument
Failed to initialize audio driver 'alsa'
[AO SDL] Samplerate: 32000Hz Channels: Stereo Format floatle
[AO SDL] using aalib audio driver.
[AO SDL] Unsupported audio format: 0x1d.
[AO SDL] Unable to open audio: No available audio device
Failed to initialize audio driver 'sdl:aalib'
Could not open/initialize audio device -> no sound.
Audio: no sound
Starting playback...


Exiting... (End of file)

The exit was after about the correct play time.

Here is a little background. At about the time I could
play this file, pulseaudio was installed because I
A. had an application that used pulseaudio libraries and also
B. I wrote some audio applications in C that used /dev/dspx
where x stands for a sound card. The examples I based the C code
on were obsolete but I thought that was how one communicated with
audio devices at the time I wrote the code. If you still need
/dev/dspx, install alsa-oss but the better solution is to write
the code so that you don't need /dev/dsp.

I really appreciate all the help I have gotten here in
figuring out why the video in question doesn't play.

With no audio device specified in config, I had a flash
of brilliance and tried a popular usb sound card that I normally
use for recording audio as a playback device.
mplayer -quiet kosovo.wmv -ao alsa:device=hw=1.0

It worked perfectly. The mystery is solved. That
CS4237B is part of the mother board and gives fairly decent audio
but it is a bear-bones sound card and there are lots of ways for
it not to work. If I don't put the module in /etc/modules and
use udev rules, the usb device and the on-board sound system
trade places as Card 1 and Card 0 about 50% of the time after
each boot.

Forcing the alsa sound driver in /.mplayer/config
prevented the usb sound device from working the first time I
tried that.

Since the CS4237B couldn't play the audio format in the
video, it was game over.

Again, many thanks to all.

Martin WB5AGZ
Mike Hodson
2018-09-13 13:50:10 UTC
Permalink
Post by Martin McCormick
With no audio device specified in config, I had a flash
of brilliance and tried a popular usb sound card that I normally
use for recording audio as a playback device.
mplayer -quiet kosovo.wmv -ao alsa:device=hw=1.0
It worked perfectly.
Sweet :)
Post by Martin McCormick
The mystery is solved. That
CS4237B is part of the mother board and gives fairly decent audio
but it is a bear-bones sound card and there are lots of ways for
it not to work. If I don't put the module in /etc/modules and
use udev rules, the usb device and the on-board sound system
trade places as Card 1 and Card 0 about 50% of the time after
each boot.
Personally I'm a fan of pulseaudio and its high quality resampling
options, and the ability to record either the input of the card, or a
mirror of its output via pavucontrol.

As it would appear you have a 48KHz-only fairly oldschool Cirrus/Crystal
card with no in-chip resampling like its newer and more featured sibling
the cs46xx series (Turtle Beach Santa Cruz was my favorite soundcard ever),
you might just want to add the resample option to your mplayer config
instead, if using pulse is a non-starter. This would allow you to just
keep one cord plugged into the back of your computer for audio to speakers,
and use the USB device for recording, or on the go. I for one hate extra
things attached to my computer; I bump things all the time, and have broken
both flash drives and knocked spinning USB disks off of my desk before..

Glad you've found a solution, and I hope you check into resampling either
in mplayer, or in the audio subsystem(s) underneath of it. As my 20 years
with Linux keeps proving, there are many paths leading to the same goal -
any goal. ;)

Mike
Martin McCormick
2018-09-13 16:58:15 UTC
Permalink
Post by Mike Hodson
Sweet :)
Post by Martin McCormick
The mystery is solved. That
CS4237B is part of the mother board and gives fairly decent audio
but it is a bear-bones sound card and there are lots of ways for
it not to work. If I don't put the module in /etc/modules and
use udev rules, the usb device and the on-board sound system
trade places as Card 1 and Card 0 about 50% of the time after
each boot.
Personally I'm a fan of pulseaudio and its high quality resampling
options, and the ability to record either the input of the card, or a
mirror of its output via pavucontrol.
As it would appear you have a 48KHz-only fairly oldschool Cirrus/Crystal
card with no in-chip resampling like its newer and more featured sibling
the cs46xx series (Turtle Beach Santa Cruz was my favorite soundcard ever),
you might just want to add the resample option to your mplayer config
instead, if using pulse is a non-starter. This would allow you to just
keep one cord plugged into the back of your computer for audio to speakers,
and use the USB device for recording, or on the go. I for one hate extra
things attached to my computer; I bump things all the time, and have broken
both flash drives and knocked spinning USB disks off of my desk before..
Glad you've found a solution, and I hope you check into resampling either
in mplayer, or in the audio subsystem(s) underneath of it. As my 20 years
with Linux keeps proving, there are many paths leading to the same goal -
any goal. ;)
Mike
Hey! The srate option did work. Had I known a bit more,
i would have just stuck that in and never bothered anybody. On
this system, pulseaudio never seemed to do much but cause
occasional weird behavior but that could be because I was doing
something wrong with it. There is an expression that goes, "A
poor craftsman always blames his tools." I wouldn't exactly call
myself a poor craftsman but I am probably not in the top third of
my class and some days, I'm not even in the top half.

I started using Linux around 2000 and had been using DEC
Ultrix, Sunos and even a little IBM AIX at work as I first
touched unix in 1989.

I am now retired so this is what I do for fun.

Again, thanks for the help.

Martin McCormick WB5AGZ

Loading...