PC with very jerky video

Asked by LEGOManiac

I have a PC with an ASRock motherboard and an AGI (no, not AGP) interface. I have never been able to find an AGI compatible video card so I'm currently using the on-board video which I expect to be crappy. There are two of these machine and they are basically identical. One runs XP and the other Ubuntu. Both have 1GB of RAM.

On the Ubuntu system, videos run in a jerky manner. The audo plays fine but the video often stops, then races ahead (as in fast forward, not just jumping ahead). The fact that it fast-forwards indicates that it is getting all the frames but it would seem that there is some sort of bottleneck which halts the streaming of video from the hard disk then lets if flood through as mplayer attempts to catch up.

Mind you, if it were a bottleneck in reading the file (AVI) from the hard disk, wouldn't that also affect the audio?

I do note that the 1GB of ram is divided into 18% in use by programs and 90% in use as cache (approximately - according to the system monitor tool)

These videos are 5 minute segments from my kid's Christmas concert and aren't all that large so should think Ubuntu should be able to load it all into memory (if need be) and still have room left over for the cache, yet the cache takes up all the remaining memory. Is that normal?

I should point out that this PC is being used by the kid's grandmother and as such is fairly bare-bones. It is a basic Ubuntu 9.04 desktop with only a video player, picture viewer, email and web browser installed as software. There are no unusual tasks being started up other than what came with the default install and Opera was the only additional piece of software I downloaded.

MPlayer is the only application running on the PC at the time the videos are being played.

I need help in finding out what's causing this, please.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu yelp Edit question
Assignee:
No assignee Edit question
Solved by:
LEGOManiac
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Mika Wahlroos (mpw) said :
#1

Have you tried if all video file formats suffer from the same issue or if it's specific to a single format? In which format is the video you're trying to play that gives problems? Also, have you tried any other video players such as VLC?

If the problem remains with other video players and formats, could you find out the following:

1. The exact model of your video hardware? You can run the "lspci" command in the terminal to get a list of your PCI and AGP-style hardware.

2. If you enter "xvinfo" in the terminal, does this give a lot of output, or just "No adaptors present"?

3. Is the video stopping and/or skipping constantly, or does it also run smoothly at times during the playback of the same video?

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#2

Thanks for the help. I'll gather the information tomorrow and reply. For now, here's what I know:

I have only tried AVI's and only from one camcorder. I have not tried another media player.

I wasn't aware of the lspci or xvinfo commands. I'll try them and let you know the results.

For what it's worth, there is no (add-on) video card. It's just what's built onto the motherboard, which I expect to be crappy for games and such but I do expect a basic AVI to run on it. Heck, the computer it replaced was a PIII and video was fine.

The video does not skip, but does top and then rushes to catch up constantly. It doesn't appear to miss any frames, it just looks as though someone hit the fast-forward button on a VCR. The audio plays back at normal speed throught the playback. It's just the video stream that is affected.

What puzzles me is that on the target system the memory (1GB) is reportedly (say) 25% used by programs and 73-75% used by cache. I'm suspicious of that. On my system I currently have 27% in use by programs, 11% in use by cache and the rest is free memory. While I know the video hardware sucks on that machine, I'm not convinced the abnormally large cache size and miniscule "free" memory aren't contributing factors.

Revision history for this message
Mika Wahlroos (mpw) said :
#3

So far the problem sounds like it might be an issue between a specific video player and video codec. Trying another video player or finding out if other types of video also have the same problem should allow us to narrow this down, so that's what I'd try first. If the problem persists with other video players and/or video formats, however, it might be useful to look into hardware details.

Even though the video hardware is built into the motherboard, there must be some sort of video hardware in any case, and it should be listed in the lspci output as a "VGA compatible controller".

For what it's worth, the disk cache in Linux is usually small right after system startup but naturally tends to fill up most of available memory over time. There should be no problem with that.

The operating system can and will quickly free up memory from the disk cache if it's needed for applications, so memory used for disk cache can generally be considered free memory except that it's actually being used for something potentially useful (speeding up disk access) when it's not needed for anything else. A large disk cache and little actual free (unused) memory is a normal situation in Linux when the system has been up for more than a few moments.

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#4

Thaks a lot for clearing the cache issue up. I'll have access to the problem computer this evening and I'll fill you in on the results tonight.

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#5

Thaks a lot for clearing the cache issue up. I'll have access to the problem computer this evening and I'll fill you in on the results tonight.

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#6

Well, I'm finally getting around to checking it out.

Other video formats work fine, including other AVIs. Now, I gather that the AVI format is really a wrapper for other formats and not a true format in it's own right. As an experiment, I downloaded a sample AVI's from the internet and they played just fine, so I had a closer look at the properties for the videos from my camcorder:

Dimensions: 1280 x 720
Codec: ITU H.264
Framerate: 30fps

By contrast, the AVI that worked had the following properties:

Dimensions: 384 x 288
Codec: DivX MS-MPEG-4 Version 3
Framerate: 25fps

lsusb reports the video as being an Intel chipset:

00:02.0 VGA compatible controller: Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device (rev 03)

I know these chip sets are limited so I suppose it's possible that either the chipset cannot handle HD video formats or there's something wrong with the H.323 codec.

I'm not sure what to do from here. I had a look in Synaptic for "323" but couldn't find any other codecs beyond what's already installed. I suppose I could downconvert the video files into, say, 800 x 600 format and see if that helps, although I'm not sure how to do that in Linux either. I could use Nero on my XP system but I'm making a concerted effort to leave the windows world behind.

Revision history for this message
Mika Wahlroos (mpw) said :
#7

You're correct that AVI is a container format, and that an AVI file can contain video encoded in a number of different actual video encoding formats. The MPlayer package probably gets its support for H.264 decoding from the libx264 shared library, as do many other video players, but it might still be worth a shot to try a different player if you haven't already.

However, I searched the web a little and found a blog post ( http://www.ubuntugeek.com/intel-graphics-performance-guide-for-ubuntu-904-jaunty-users.html ) suggesting that there may be some performance issues with the Intel video driver in Ubuntu 9.04. The post includes suggestions for a workaround in case the bug it mentions is actually the cause of the problem.

A third possibility that comes to my mind is that H.264 decoding at a 1280x720 resolution requires some punch from the CPU. You didn't specify which CPU the computer has but if it's fairly old or low-end, it's possible that it doesn't have what it takes to decode H.264 video at HD resolution in real time.

So, I'd suggest the following course of action, in this order:

1. Try a different video player, if you haven't already. This might help if it's a codec issue. Have you tried Totem, the default Movie Player that comes installed with Ubuntu? Or VLC? Do they all yield similar results?

2. If all those video players suffer from the same problem, check if your CPU usage is maxed out during video playback. You can monitor your CPU usage with the system monitor that comes with Ubuntu (System > Administration > System Monitor) or with the "top" command in the terminal. If the usage hits 100% or is constantly very close to it (say, around 95%), that's probably enough to cause jerky playback. Also, please provide your CPU model and speed. You can find out that information in the System Monitor, or by entering "cat /proc/cpuinfo" in the terminal.

3. If you provide your CPU specifications and the model and speed suggest it should be fast enough, and there's still a performance issue with at least a couple of different video players, take a look at the blog post and/or bug report and see if you can find out a workaround that works for you. Since this may involve upgrading to a newer version of the Intel video driver etc., I'd try this only after the other options have been covered. If you feel comfortable trying this, go ahead, but if you don't, please come back with your CPU details first.

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#8

Wow, that was very helpful. Thanks for the thoughtful response. I don't own the computer in question, so I'll have to go back and have a look at it (probably Saturday).

It''s a celeron 2.4GHz PC with 1GB RAM. CPU usage is not maxed out. I can't remember exactly where it stands during playback, but I'll check it when I go back to it on the weekend.

VLC does not play the video at all. I thought it was MPlayer that was the default video player for Ubuntu 9.04? I'll check if it is indeed mplayer on that machine and if so, I'll try totem.

I'll go on to reading the blog now and take that info with me on the weekend....

Revision history for this message
Mika Wahlroos (mpw) said :
#9

If CPU use is not maxed out, it doesn't sound like a decoding performance issue. Also, a Celeron 2.4 GHz should be enough for decoding H.264 at 1280x720, according to my gut feeling.

The default player in a standard Ubuntu install is actually Totem, not MPlayer. Totem is listed in the menus as "Movie Player", though, so that might cause confusion. It's still separate from MPlayer. MPlayer should also be available in the "multiverse" repository if you want to try that.

I've actually seen some issues with H.264 playback on Totem in the past. The version of the Totem player UI shipped with Ubuntu 9.04 can use a couple of different player engines (back-ends) for doing the actual video decoding etc. The default Totem package in Ubuntu uses GStreamer, which generally works well, but I've seen some issues with H.264 with it.

The other player engine supported by Totem in Ubuntu 9.04 is the Xine back-end. If you'd like to try that, you can search for "totem" in Synaptic and install the totem-xine package and remove the totem-gstreamer one. If you decide to try this, you'll also want to install the libxine1-plugins package for extra video and audio format support. This may sound complex but it might actually be a good option since the Totem UI is the same regardless of the engine, so to the end user it'd be a very clean solution and would appear exactly the same as the default player. I understand that you want to keep the system as minimal and simple as possible.

The potential driver performance issues mentioned in the blog post are still a possibility, but if your video problems were caused by the video driver, I'd expect the jerkiness to be constant rather than sometimes going fast and at other times slow without dropping frames.

I'd still try and see if I can get a different video player working (e.g. totem-xine, or perhaps MPlayer), and if that doesn't work, then try and see if the driver tweaks from the blog help.

For now, this is as much as I can think of. Thanks for your co-operation and providing such accurate information when needed -- it truely makes troubleshooting much easier! If you still have trouble after this and you can't find a fix in the driver tweaks from the blog post, let me know and we'll see if we can still come up with something to try.

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#10

I'm surprised this thread hasn't expired. I ended up working around the problem with a Western Digital Media Player box, hooked up to a TV. The videos play just fine on there so I've stopped pursuing this problem.