Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 49489

Summary: Mplayer-1.0-pre4 has problems with locale
Product: Gentoo Linux Reporter: Sebastian <sebastian_ml>
Component: Current packagesAssignee: Gentoo Media-video project <media-video>
Status: RESOLVED UPSTREAM    
Severity: normal CC: chriswhite
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Sebastian 2004-04-30 05:37:07 UTC
Hi,

I use mplayer to play divx movies on my dvb card. It basically decodes the divx/xvid/whatever and encodes it to mpeg2 on the fly and sends it to the dvb card. I use it for VDR (a linux video disk recorder software). Anyway, there are problems usig pre4 wth 23.976fps movies that weren't in pre3. 

Here's the output of pre3:

vdr root # /usr/bin/mplayer -vo mpegpes -ao mpegpes -vop lavc=5500:29.970,expand=640:480:-1:-1:1,scale=640:362   -cache 16384 -slave -nolirc  -subpos 80 -sub-bg-color 0 -sub-bg-alpha 0 -quiet -osdlevel 0 /video/VDR/vdrrip/sk/xvid-123.avi MPlayer 1.0pre3-3.3.2 (C) 2000-2003 MPlayer Team
 
CPU: Advanced Micro Devices Athlon MP/XP/XP-M Barton 1999 MHz (Family: 6, Stepping: 0)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
 
Reading config file /usr/share/mplayer/mplayer.conf
Reading config file /root/.mplayer/config
Reading /root/.mplayer/codecs.conf: Can't open '/root/.mplayer/codecs.conf': Datei oder Verzeichnis nicht gefunden
Reading /usr/share/mplayer/codecs.conf: 61 audio & 169 video codecs
font: can't open file: /root/.mplayer/font/font.desc
Font /usr/share/mplayer/font/font.desc loaded successfully! (206 chars)
Using Linux hardware RTC timing (1024Hz).
Can't open input config file /root/.mplayer/input.conf: Datei oder Verzeichnis nicht gefunden
Input config file /usr/share/mplayer/input.conf parsed: 53 binds
 
Playing /video/VDR/vdrrip/sk/xvid-123.avi.
Cache fill:  9,23% (1548288 bytes)    AVI file format detected.
VIDEO:  [XVID]  640x272  24bpp  23,976 fps  850,8 kbps (103,9 kbyte/s)
Clip info:
 Software: Nandub v1.0rc2
SUB: Detected subtitle file format: subviewer
SUB: Read 1257 subtitles.
SUB: added subtitle file (1): /video/VDR/vdrrip/sk/xvid-123.srt
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
AC3: 5.1 (3f+2r+lfe)  48000 Hz  448,0 kbit/s
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 56000->192000 (448,0 kbit)
Selected audio codec: [a52] afm:liba52 (AC3-liba52)
==========================================================================
Opening /dev/dvb/adapter0/video0+audio0
Opening video filter: [lavc=5500:29.970]
Opening video filter: [expand w=640 h=480 x=-1 y=-1 osd=1]
Expand: 640 x 480, -1 ; -1  (-1=autodetect) osd: 1
Opening video filter: [scale w=640 h=362]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 48000 hz, little endian signed int
AF_pre: 48000Hz 2ch Signed 16-bit (Little-Endian)
AO: [mpegpes] 48000Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
Starting playback...
VDec: vo config request - 640 x 272 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2,35:1 - prescaling to correct movie aspect.
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
 
SwScaler: BICUBIC scaler, from Planar YV12 to Planar YV12 using MMX2
VO: [mpegpes] 640x480 => 851x480 Mpeg PES

So this is ok. Let's take a look at pre4:

/usr/bin/mplayer -vo mpegpes -ao mpegpes -vop lavc=5500:29.970,expand=640:480:-1:-1:1,scale=640:362   -cache 16384 -slave -nolirc  -subpos 80 -sub-bg-color 0 -sub-bg-alpha 0 -quiet -osdlevel 0 /video/VDR/vdrrip/sk/xvid-123.avi MPlayer 1.0pre4-3.3.2 (C) 2000-2004 MPlayer Team
 
CPU: Advanced Micro Devices Athlon MP/XP/XP-M Barton 1999 MHz (Family: 6, Stepping: 0)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
 
Reading config file /usr/share/mplayer/mplayer.conf
Reading config file /root/.mplayer/config
Reading /root/.mplayer/codecs.conf: Can't open '/root/.mplayer/codecs.conf': Datei oder Verzeichnis nicht gefunden
Reading /usr/share/mplayer/codecs.conf: 66 audio & 176 video codecs
font: can't open file: /root/.mplayer/font/font.desc
Font /usr/share/mplayer/font/font.desc loaded successfully! (206 chars)
Using Linux hardware RTC timing (1024Hz).
Can't open input config file /root/.mplayer/input.conf: Datei oder Verzeichnis nicht gefunden
Input config file /usr/share/mplayer/input.conf parsed: 53 binds
 
Playing /video/VDR/vdrrip/sk/xvid-123.avi.
Cache fill:  1,17% (196608 bytes)    AVI file format detected.
VIDEO:  [XVID]  640x272  24bpp  23,976 fps  850,8 kbps (103,9 kbyte/s)
Clip info:
 Software: Nandub v1.0rc2
SUB: Detected subtitle file format: subviewer
SUB: Read 1257 subtitles.
SUB: added subtitle file (1): /video/VDR/vdrrip/sk/xvid-123.srt
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
AC3: 5.1 (3f+2r+lfe)  48000 Hz  448,0 kbit/s
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 56000->192000 (448,0 kbit)
Selected audio codec: [a52] afm:liba52 (AC3-liba52)
==========================================================================
Opening /dev/dvb/adapter0/video0+audio0
Opening video filter: [lavc=5500:29.970]
Opening video filter: [expand w=640 h=480 x=-1 y=-1 osd=1]
Expand: 640 x 480, -1 ; -1  (-1=autodetect) osd: 1
Opening video filter: [scale w=640 h=362]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 48000 hz, little endian signed int
AF_pre: 48000Hz 2ch Signed 16-bit (Little-Endian)
AO: [mpegpes] 48000Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
Starting playback...
VDec: vo config request - 640 x 272 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2,35:1 - prescaling to correct movie aspect.
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
 
SwScaler: BICUBIC scaler, from Planar YV12 to Planar YV12 using MMX2
[mpeg1video @ 0x849cf60]removing common factors from framerate
[mpeg1video @ 0x849cf60]MPEG1/2 doesnt support 29/1 fps
Could not open codec.
FATAL: Cannot initialize video driver.
 
FATAL: Could not initialize video filters (-vf) or video output (-vo).
 
 
Exiting... (End of file)
vdr root #

I was on #mplayerdev at freenode and this is the convo with the devs there:

<dalias> maybe there's some way to enable it sikkh, i dunno
<micmac> Hi. I got a problem and no answer in mplayer. Can I post it here?
<dalias> better to wait on #mplayer or post to mplayer-users list, but...
<dalias> we're being really idle and stupid in here right now
<micmac> Ok :)
<dalias> so we might as well
<dalias> answer a question
<micmac> I got a problem with pre4 when I want it to send the video to my dvb card. pre3 works, pre4 doesn't. It tried FFMPEGs lavc to decode the vid but fails with "[mpeg1video @ 0x849cf60]removing common factors from framerate" and "[mpeg1video @ 0x849cf60]MPEG1/2 doesnt support 29/1 fps". If you want to you can see the whole error message and the output of both mplayer versions at [URL]http://www.vdrportal.de/board/thread.php?threadid=16398&sid=[/URL]
<dalias> uhg ok
<dalias> just a sec
<dalias> the problem is locale
<dalias> in your locale "," is the decimal separator
<dalias> so 29.97 gets parsed as 29
<micmac> I don't understand. Why does it work with pre3?
<Mosu> probably because pre3 hasn't used setlocale or sth like that
<dalias> because the old libavcodec ignored the fact that the framerate was invalid
<Mosu> or that
<dalias> mosu, no, old lavc silently let you use bad framerate and results were probably unpredictable
<micmac> So it's a Gentoo problem in my case?
<dalias> micmac, no
<dalias> if mplayer is going to support locale, it needs to work around problems like this
<sikkh> dalias: btw Jeff Dike (UML creator) also uses emacs ;)
<micmac> Then it's a problem with my "export LANG=de_DE@euro"?
<dalias> the problem is that people put locale support in mplayer without thinking about it
<dalias> so it's buggy
<dalias> yeah
<dalias> if you get rid of that it will work fine
<dalias> you could also try using 30
<micmac> How can I get rid of it with ./configure?
<dalias> and see if that gets rounded to a reasonable number
<timebomb_> micmac: just put an alias that overrides that lang
<timebomb_> then when you use mplayer it will have no probs
<dalias> --disable-i18n
<dalias> or what timebomb_ said
<timebomb_> u could e.g. use alias mplayer 'LANG=en_US mplayer' in your .bashrc
<micmac> timebomb_, sorry, I'm nut dumb but maybe my English is not too well. Can you say that once more please.
<timebomb_> assuming that you use bash from that export and gentoo
<micmac> oh. ok thx.
<timebomb_> hehe nut dumb might be misunderstood :D
<micmac> Can I paste this convo in the [URL]www.vdrportal.de[/URL] thread I opened?
<dalias> sure
--- timebomb_ ist jetzt bekannt als timebomb
<micmac> ty guys. Are you gonna try to get rid of this locale mixpup in the future?
--- ChanServ gibt Voice-Status an timebomb
<timebomb> that might be so
<timebomb> maybe with pre5 :)
<micmac> Thanks!
<micmac> bye bye
<timebomb> bye

Maybe you guys can have a look at this behaviour, too.

Thanks
Sebastian

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Chris White (RETIRED) gentoo-dev 2004-08-17 08:29:00 UTC
Please confirm this in pre5.
Comment 2 Sebastian 2004-08-17 09:19:48 UTC
Hello!

Yep, same thing with pre5:

vdr movies $ /usr/bin/mplayer -vo mpegpes -ao mpegpes -vop lavc=5500:29.970,expand=640:480:-1:-1:1,scale=640:362   -cache 16384 -slave -nolirc  -subpos 80 -sub-bg-color 0 -sub-bg-alpha 0 -quiet -osdlevel 0 /mnt/cdrom/b-spartan.avi
MPlayer 1.0pre5-3.3.3 (C) 2000-2004 MPlayer Team

CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred 865.8 MHz (Family: 6, Stepping: 1)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

Reading config file /usr/share/mplayer/mplayer.conf
Reading config file /usr/local/vdr/.mplayer/config
Reading /usr/local/vdr/.mplayer/codecs.conf: Can't open '/usr/local/vdr/.mplayer/codecs.conf': Datei oder Verzeichnis nicht gefunden
Reading /usr/share/mplayer/codecs.conf: 73 audio & 180 video codecs
font: can't open file: /usr/local/vdr/.mplayer/font/font.desc
Font /usr/share/mplayer/font/font.desc loaded successfully! (206 chars)
Using Linux hardware RTC timing (1024Hz).
Can't open input config file /usr/local/vdr/.mplayer/input.conf: Datei oder Verzeichnis nicht gefunden
Input config file /usr/share/mplayer/input.conf parsed: 53 binds

Playing /mnt/cdrom/b-spartan.avi.
Cache fill: 17,04% (2859008 bytes)    AVI file format detected.
VIDEO:  [XVID]  624x272  24bpp  23,976 fps  773,0 kbps (94,4 kbyte/s)
Clip info:
 Software: Nandub v1.0rc2
SUB: Detected subtitle file format: subviewer
SUB: Read 1155 subtitles.
SUB: added subtitle file (1): /mnt/cdrom/b-spartan.srt
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
MP3lib: init layer2&3 finished, tables done
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 4000->192000 (32,0 kbit)
Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Opening /dev/dvb/adapter0/video0+audio0
Opening video filter: [lavc=5500:29.970]
Opening video filter: [expand w=640 h=480 x=-1 y=-1 osd=1]
Expand: 640 x 480, -1 ; -1  (-1=autodetect) osd: 1
Opening video filter: [scale w=640 h=362]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 48000 hz, little endian signed int
AF_pre: 48000Hz 2ch Signed 16-bit (Little-Endian)
AO: [mpegpes] 48000Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
Starting playback...
VDec: vo config request - 624 x 272 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2,29:1 - prescaling to correct movie aspect.
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4

SwScaler: BICUBIC scaler, from Planar YV12 to Planar YV12 using MMX2
[mpeg1video @ 0x848f600]removing common factors from framerate
[mpeg1video @ 0x848f600]MPEG1/2 doesnt support 29/1 fps
Could not open codec.
FATAL: Cannot initialize video driver.

FATAL: Could not initialize video filters (-vf) or video output (-vo).


Exiting... (End of file)
vdr movies $


I ask Juri in the mplayer-dvb mailing list if this could be fixed easily. And he said that I would have to change the 29.976 to 30. Well, that works:

vdr movies $ /usr/bin/mplayer -vo mpegpes -ao mpegpes -vop lavc=5500:30,expand=640:480:-1:-1:1,scale=640:362   -cache 16384 -slave -nolirc  -subpos 80 -sub-bg-color 0 -sub-bg-alpha 0 -quiet -osdlevel 0 /mnt/cdrom/b-spartan.avi
MPlayer 1.0pre5-3.3.3 (C) 2000-2004 MPlayer Team

CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred 865.8 MHz (Family: 6, Stepping: 1)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

Reading config file /usr/share/mplayer/mplayer.conf
Reading config file /usr/local/vdr/.mplayer/config
Reading /usr/local/vdr/.mplayer/codecs.conf: Can't open '/usr/local/vdr/.mplayer/codecs.conf': Datei oder Verzeichnis nicht gefunden
Reading /usr/share/mplayer/codecs.conf: 73 audio & 180 video codecs
font: can't open file: /usr/local/vdr/.mplayer/font/font.desc
Font /usr/share/mplayer/font/font.desc loaded successfully! (206 chars)
Using Linux hardware RTC timing (1024Hz).
Can't open input config file /usr/local/vdr/.mplayer/input.conf: Datei oder Verzeichnis nicht gefunden
Input config file /usr/share/mplayer/input.conf parsed: 53 binds

Playing /mnt/cdrom/b-spartan.avi.
Cache fill: 17,97% (3014656 bytes)    AVI file format detected.
VIDEO:  [XVID]  624x272  24bpp  23,976 fps  773,0 kbps (94,4 kbyte/s)
Clip info:
 Software: Nandub v1.0rc2
SUB: Detected subtitle file format: subviewer
SUB: Read 1155 subtitles.
SUB: added subtitle file (1): /mnt/cdrom/b-spartan.srt
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
MP3lib: init layer2&3 finished, tables done
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 4000->192000 (32,0 kbit)
Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Opening /dev/dvb/adapter0/video0+audio0
Opening video filter: [lavc=5500:30]
Opening video filter: [expand w=640 h=480 x=-1 y=-1 osd=1]
Expand: 640 x 480, -1 ; -1  (-1=autodetect) osd: 1
Opening video filter: [scale w=640 h=362]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 48000 hz, little endian signed int
AF_pre: 48000Hz 2ch Signed 16-bit (Little-Endian)
AO: [mpegpes] 48000Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
Starting playback...
VDec: vo config request - 624 x 272 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2,29:1 - prescaling to correct movie aspect.
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4

SwScaler: BICUBIC scaler, from Planar YV12 to Planar YV12 using MMX2
[mpeg1video @ 0x848f600]removing common factors from framerate
VO: [mpegpes] 640x480 => 830x480 Mpeg PES
SLAVE: time=13,01 position=0,20

MPlayer interrupted by signal 2 in module: play_audio
vdr movies $

But isn't that the wrong fix? Isn't it only a workaround? Well, maybe it's just fine. At least it works. Maybe this is a good time to close this bug #? What do you think?

Greetings

Sebastian
Comment 3 Chris White (RETIRED) gentoo-dev 2004-11-10 20:46:17 UTC
Can you post a bug for this in the MPlayer -dev mailing list and in their bugzilla?  Please also provide the tracking number.  I have a few ideas on how to solve it, but I'm not 200% sure.  Thanks ahead of time.
Comment 4 Sebastian 2004-11-11 03:10:46 UTC
Hi Chris!

Are you sure you want to investigate further? I found that lavc no longer accepts float input. If you feed it with -vop lavc=5500:30 instead 29.97.. all's well. If I remember correctly I already posted this quite some time ago at mplayer-dvb. But response was rare. I was told to use int numbers instead. How about just closing this #?

Greets

Sebastian