Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just tried playing back a 1080p AVCHD video file recorded at 60 FPS with my Sony DSLR on my Ubuntu 12.04 workstation, and to my surprise MPlayer was not able to play the video smoothly. I copied the file to a local hard drive.

The video plays slower than it should and the A-V desync continues growing steadily (about 1 second of desync per 10 seconds of playback). One of the 8 CPU threads shoots up to 100%.

I was wondering if this is to be expected on my hardware. Its a little hard to believe, considering that my T60 laptop plays the video just fine, so I suspect software issues.

Workstation specs:

  • CPU: Intel Quad Core i7-920 @2.67GHz
  • GPU: Nvidia GeForce 9600 GSO 512
  • RAM: 8Gb
  • Compiz if functioning smoothly, although I have turned it off for this testing (no improvement in video playback)
  • The system is generally lightning fast and responsive.
  • Playing an MP4 with h264 1080p stream at 30 FPS works fine.
  
root@boss:~# glxinfo | grep direct
direct rendering: Yes

root@boss:~# glxinfo | grep vendor
server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation


Mplayer output:

valprj@boss:~$ mplayer 00006.MTS 
MPlayer svn r34540 (Ubuntu), built with gcc-4.6 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing 00006.MTS.
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
TS file format detected.
VIDEO H264(pid=4113) AUDIO A52(pid=4352) SUB Teletext(pid=4608)  PROGRAM N. 1
FPS seems to be: 59.940060
Load subtitles in ./
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 256.0 kbit/16.67% (ratio: 32000->192000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Unsupported PixelFormat 81
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 1920x1080 => 1920x1080 Planar YV12 
A:   6.6 V:   6.1 A-V:  0.496 ct: -0.017 453/453 96% 10%  0.6% 221 0 


           ************************************************
           **** Your system is too SLOW to play this!  ****
           ************************************************

Possible reasons, problems, workarounds:
- Most common: broken/buggy _audio_ driver
  - Try -ao sdl or use the OSS emulation of ALSA.
  - Experiment with different values for -autosync, 30 is a good start.
- Slow video output
  - Try a different -vo driver (-vo help for a list) or try -framedrop!
- Slow CPU
  - Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts,
    e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all.
- Broken file
  - Try various combinations of -nobps -ni -forceidx -mc 0.
- Slow media (NFS/SMB mounts, DVD, VCD etc)
  - Try -cache 8192.
- Are you using -cache to play a non-interleaved AVI file?
  - Try -nocache.
Read DOCS/HTML/en/video.html for tuning/speedup tips.
If none of this helps you, read DOCS/HTML/en/bugreports.html.

A:   7.8 V:   7.2 A-V:  0.602 ct: -0.017 520/520 97% 10%  0.6% 286 0 
[h264 @ 0x7fe0a0468380]concealing 136 DC, 136 AC, 136 MV errors
A:  17.1 V:  15.6 A-V:  1.495 ct: -0.017 1022/1022 97%  9%  0.6% 779 0 

Exiting... (Quit)


Things I tried

  • Playing with -vc ffh264vdpau helped a bit. The desync ratio became 1 second of desync per 34 seconds of playback, and the video speed is almost right. The CPU usage went down significantly (20% on highest cpu thread). Yet I still get the:

    Your system is too SLOW to play this!

    message from MPlayer.

  • Playing with -lavdopts skiploopfilter=all made the video play properly. The CPU hovers at around 93% and A-V sync hovers around 0.263s


Question

So my question is this - would you say it's reasonable for mplayer to have this much trouble playing back that video on my hardware, or do you figure that there is a software problem here? Maybe the nvidia driver?

Any ideas would be appreciated!

share|improve this question

1 Answer 1

I'm not sure if you're still in need of assistance, but I'll post for future users... I believe the problem that you're having is that mplayer's default configuration only uses one processor core... Try passing the "-lavdopts threads=n" option (where 'n' is the number of threads to use).

mplayer -lavdopts threads=4 00006.MTS
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.