LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to set bitrate for mplayer? (https://www.linuxquestions.org/questions/linux-software-2/how-to-set-bitrate-for-mplayer-806729/)

lugoteehalt 05-08-2010 10:34 PM

How to set bitrate for mplayer?
 
Trying to play a *.mp4 video using mplayer and the picture is jumpy and the sound completely screwed.

It say it is guessing the bitrate thus:

Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder)

In fact the bitrate should be 139 or possibly 132. So assume that is what is wrong.

Have assiduously coated myself with nourishing smegma and the like but am unable to work out how to set the bitrate in this case. Anybody know?

smoker 05-09-2010 03:17 AM

Does the video improve if you add the option -nosound when starting mplayer ?

If not then the problem is unlikely to be the audio bitrate. More likely a non-spec mp4 file.

You might want to use mediainfo to find out more about the file concerned.

business_kid 05-09-2010 03:23 AM

Try these in turn in a terminal
mplayer -vo help
mplayer -ao help
Most of the cpu, driver & bandwidth issues are with video (ati particularly). It defaults to xvid iirc. My box only works on
mplayer -vo sdl

You can always try
mplayer -vo null somefile to just get the audio track
mplayer -ao null just to get the video track

lugoteehalt 05-09-2010 02:23 PM

Thanks both.

When used -nosound the video was alright, it did not jump. Incidentally, clever idea.

When used mplayer -vo null the video *did* jump, as before.

When used mplayer -ao null it advised me the computer was too slow to play this, it isn't.

mplayer -vo sdl gave the original problem: Incidentally the video jumps and the audio jumps too, it seems like the same thing is happening to both.

Tried mplayer -abr 139 filename.mp4 but it does not recognize this as sensible.

Code:

lugo@fido:~/Politics/Economics$ mediainfo moneyAsDebt.mp4                 
General                                                                   
Complete name                    : moneyAsDebt.mp4                         
Format                          : MPEG-4                                 
Format profile                  : Base Media                             
Codec ID                        : isom                                   
File size                        : 138 MiB                                 
Duration                        : 47mn 9s                                 
Overall bit rate                : 409 Kbps                               
Movie name                      : Money As Debt                           
Encoded date                    : UTC 2007-10-11 01:02:59                 
Tagged date                      : UTC 2007-10-11 01:02:59                 

Video
ID                              : 1
Format                          : AVC
Format/Info                      : Advanced Video Codec
Format profile                  : Baseline@L1.1     
Format settings, CABAC          : No                 
Format settings, ReFrames        : 1 frame           
Codec ID                        : avc1               
Codec ID/Info                    : Advanced Video Coding
Duration                        : 47mn 9s             
Bit rate mode                    : Variable           
Bit rate                        : 281 Kbps           
Maximum bit rate                : 2 323 Kbps         
Width                            : 320 pixels         
Height                          : 240 pixels         
Display aspect ratio            : 4:3                 
Frame rate mode                  : Constant           
Frame rate                      : 29.970 fps         
Resolution                      : 8 bits             
Colorimetry                      : 4:2:0               
Scan type                        : Progressive         
Bits/(Pixel*Frame)              : 0.122               
Stream size                      : 94.7 MiB (69%)     
Encoded date                    : UTC 2007-10-11 01:02:59
Tagged date                      : UTC 2007-10-11 01:03:07

Audio
ID                              : 2
Format                          : AAC
Format/Info                      : Advanced Audio Codec
Format version                  : Version 4         
Format profile                  : LC                 
Format settings, SBR            : No
Codec ID                        : 40
Duration                        : 47mn 7s
Bit rate mode                    : Variable
Bit rate                        : 126 Kbps
Maximum bit rate                : 265 Kbps
Channel(s)                      : 2 channels
Channel positions                : Front: L R
Sampling rate                    : 44.1 KHz
Stream size                      : 42.3 MiB (31%)
Encoded date                    : UTC 2007-10-11 01:03:04
Tagged date                      : UTC 2007-10-11 01:03:07

Still lost, any suggestions might be helpful.

smoker 05-09-2010 03:19 PM

You could try using the option -autosync 1 or a higher number, but read man mplayer for what it does.

or -ac ffaac to use a different audio decoder.

John VV 05-09-2010 05:49 PM

how much ram is there , the mp4 uses a lot
is it running on the cpu or in the nvidia gpu (cuda)
that is if you have a nvidia card

i find that the smplayer front end really slows down mp4's
i run them from the terminal.

lugoteehalt 05-09-2010 08:07 PM

Quote:

Originally Posted by John VV (Post 3962604)
how much ram is there , the mp4 uses a lot
is it running on the cpu or in the nvidia gpu (cuda)
that is if you have a nvidia card

i find that the smplayer front end really slows down mp4's
i run them from the terminal.

Running from terminal inside X. 4GB RAM.

Tried all the above advice, nothing worked unfortunately, probably give up on it. Does not *appear* to be just this file, bug perhaps.

However, "is it running on the cpu or in the nvidia gpu (cuda)" You mean is the GPU doing it or the CPU? - how would I tell?

EDIT: Tried running it under Enlightenment17, a light thing, instead of the heavy KDE to ensure the computer is not overloaded and got the same problem with it guessing the bitrate, it also said the computer was too slow (It is an "entry level games machine"). An interesting feature was that the 'scroll lock' led on the keyboard flashed irregularly - well it interested me.:)

Shadow_7 05-09-2010 08:28 PM

I had this issue. Upgrading from debian etch to debian lenny fixed it. You're probably using some old DLL or something in the decoding process. I'm not exactly sure WHAT is different I was running etch earlier this year and mplayer from svn within the past two months, so it's some other underlying issue like version of X or DLLs. FWIW, the computer in question is a 2006 laptop 32 bit / 2GHz single core. And as long as it's not 1080p30 or higher, it copes.

John VV 05-09-2010 08:35 PM

Quote:

You're probably using some old DLL or something
a MS Windows dll ??? and not a linux .so ???

what is odd is according to
Code:

Width                            : 320 pixels         
Height                          : 240 pixels

the vid is VERY small
are you running it full screen at 1600x1200
with a 320x240 vid and 4 gig ram you should have NO problem running 4 at one time .

did you install 3d desktop ( compiz fusion ) and if so IS it also running ?

lugoteehalt 05-09-2010 09:34 PM

Quote:

Originally Posted by John VV (Post 3962706)
what is odd is according to
Code:

Width                            : 320 pixels         
Height                          : 240 pixels

the vid is VERY small
are you running it full screen at 1600x1200
with a 320x240 vid and 4 gig ram you should have NO problem running 4 at one time .

did you install 3d desktop ( compiz fusion ) and if so IS it also running ?

Mplayer automatically switches the resolution to 640x480 in a fairly small box, the same problem at full screen.

I have transparency in KDE and Enlightenment17. It is quite an up market computer, it is unlikely to be too slow unless there is a program problem.

Perhaps I should have said earlier that the motivation for using mplayer is that I normally run these *.mp4 files in iceweasel, i.e. firefox. But cannot get it to rewind, pause and that sort of thing: inconvenient. So mplayer is very good in that area. But perhaps something else would do the job?

John VV 05-10-2010 12:18 AM

so this is inside firefox
is it the very old mplayer-plugin
or the current gecko-plugin

or are you just running mplayer as a separate process in a new window

business_kid 05-10-2010 02:51 AM

The options were for running mplayer itself. There's a config file /etc/mplayer.conf which you can set these things in and have them run on the plugin. mplayer is something I would keep up to date. Mine is an SVN snapshot r29687-snapshot-4.2.4 compiled for x86_64, but I think the options are pretty universal.

There's also some sneaky option for predownloading. I did my testing and optimizing using a film dvd which eliminates bandwidth issues. There are some smoothness options too, iirc. Man page is one of the all-time great man pages.

Shadow_7 05-10-2010 10:18 AM

Quote:

Originally Posted by John VV (Post 3962706)
a MS Windows dll ??? and not a linux .so ???

Yes a DLL.

ls /usr/lib/codecs/

John VV 05-10-2010 01:34 PM

/usr/lib/codecs/ forgot about those i only see them one time when i set up mplayer
all-20100303.tar.bz2

lugoteehalt 05-10-2010 08:39 PM

Quote:

Originally Posted by John VV (Post 3962862)
so this is inside firefox
is it the very old mplayer-plugin
or the current gecko-plugin

or are you just running mplayer as a separate process in a new window

Just running mplayer seperate in new window.

Code:

lugo@fido:~/Politics/Economics$ ls /usr/lib/codecs/
cook.so  drvc.so  sipr.so

Tried vlc instead of mplayer and got:
Code:

lugo@fido:~/Politics/Economics$ vlc moneyAsDebt.mp4
VLC media player 0.8.6h Janus
[00000307] main decoder error: no suitable decoder module for fourcc `avc1'.
VLC probably does not support this sound or video format.

The sound played alright though.

I just initially thought all I had to do was set the audio bit rate manually and calmness would return to middle earth. Get impression it is a bug with mplayer, so I'd probably better just stop worrying about not being able to rewind and so on - when these *.mp4 files are run inside iceweasel.


All times are GMT -5. The time now is 09:39 AM.