donny662
Member
I decided to do a little test of the video playing capabilities of the GP2X. This is quite an informal test; I had the idea about an hour ago. But, I hope this will shed some light on why some videos work and others don't.
MPEG-4 is an advanced video compression specification that allows for many file size saving features. Many of these features require lots of computing power that, until recently, only computers have been able to take advantage of them. Even though in this test the XviD flavour of MPEG-4 codec is used, the features discussed apply also to DivX 4,5,6,3viX, and any other MPEG-4 codec, and unless it has something to do with an XviD specific bug in the GP2X video player, the results of this should also apply to the other MPEG-4 codecs as well.
Three encoding features of the MPEG-4 specification have become popular to use, but because of the limited computing power of handheld and set-top players, these features have not always been supported. So, one may come across video files encoded with B-Frames, Global Motion Compensation (GMC), and Quarter Pixel (Qpel) features.
A B-Frame is a type of picture encoding that is available in all of the MPEG specifications (MPEG-1,2,4), and the idea is also used in most other lossy encoding methods. MPEG video divides the frames into groups called GOPs (Group Of Pictures). The first is an intra or I frame, which stores the full picture much like a JPEG. The rest of the frames in the GOP store only the part of the picture that has changed, so they take up much less space. P-Frames are the simplest, which only store the differnce from the last frame. Basically, they look to the previous frame and only display what is different, hence the title P. B-Frames are more complicated in that they not only look to the previous frame but they can also look at frames ahead of them in the GOP. They are also known as Bi-directional frames. Of the three types of frames, I takes the most data, P less, and B the least to encode, but that also means decoding requires more power for a B-Frame than an I-Frame. For awhile, XviD didn't even implement B-Frames. Enabling B-Frames will probably give the best results in increasing the quality your videos over GMC and Qpel.
GMC is a feature of MPEG-4 that I don't really know much about. It is supposed to increase the quality of the videos, but from what I have read, it isn't that big of a boost, especially for the greater resources it requires.
Qpel I also don't know much about. I believe it offers a good improvement for quality, but is also requires a lot of resources to decode; in fact, it requires the most of these three options.
For this test, I used a two minute clip from a XviD encode of Harry Potter and the Prisoner of Azkaban with resolution of 576x240 and at 25 fps.
I used the program VirtualDubMod for the encoding. The program you use to encode the video doesn't matter as much as the codec (XviD,DivX). The codec handles all of the hard work encoding the video, and the program handles wrapping that video in a container such as avi, ogm, or mp4. For the codec settings, VirtualDubMod uses XviD's built in GUI the same as VirtualDub does. Other programs may use their own GUI to specify the parameters passed to XviD, so the same options are there, but there may be differences in how many options a program gives to you and maybe the default options it sets. If the program you use has basic settings like high and low quality, try to find out if you can select the specific settings it is using to make sure it doesn't enable something that isn't supported by the GP2X.
The B-Frames, GMC, and Quarter Pixel options in the XviD GUI are found by clicking the "more..." button by the "Profile and Level" dropdown.
I made a set of files with different options enabled at the same resolution of the test file and encoded all of them with only one pass at a bitrate of 700kbps and without audio. Also, I made a set at 320x136 to fit the width of the GP2X screen at 300kbps.
I set the following options for the files:
No B-Frames, GMC, or Qpel
B-Frames only
B-Frames and GMC
B-Frames and GMC and Qpel
GMC only
Qpel only
Since I was doing this quickly, I didn't record the encoding time, but I can say having all three options enabled nearly doubled the encoding time and the rest only added about 5-30% to the time.
Every video would jump a little, and it was usually at similar times. But, that shouldn't affect the outcome of the test and may be due to the buggy player or SD reading. I also noticed the jumpiness when I played a DivX3 video. I used a 1GB A-Data SD card I purchased from GP32z with my unit. Also, I have the v1.01 firmware with the mplayer patch installed.
The results are the same between the full and small resolution videos. The B-Frame only videos worked just as well as the video with none of the options. Any video with GMC or Qpel didn't work at all. When I selected the video, the GP2X showed the loading screen, but afterwards, only a black screen was displayed. They don't crash the player or anything because I can still exit to the menu or browser.
Make sure when you encode videos for the GP2X that GMC and Qpel are not enabled. It is a good idea to enable B-frames, though, because the quality of the video will be improved.
If they are in demand, I may post the test videos, but right now I should be studying for my Computer Science exam. It's about 1:30 am now and my exam is at 8:00 am.
MPEG-4 is an advanced video compression specification that allows for many file size saving features. Many of these features require lots of computing power that, until recently, only computers have been able to take advantage of them. Even though in this test the XviD flavour of MPEG-4 codec is used, the features discussed apply also to DivX 4,5,6,3viX, and any other MPEG-4 codec, and unless it has something to do with an XviD specific bug in the GP2X video player, the results of this should also apply to the other MPEG-4 codecs as well.
Three encoding features of the MPEG-4 specification have become popular to use, but because of the limited computing power of handheld and set-top players, these features have not always been supported. So, one may come across video files encoded with B-Frames, Global Motion Compensation (GMC), and Quarter Pixel (Qpel) features.
A B-Frame is a type of picture encoding that is available in all of the MPEG specifications (MPEG-1,2,4), and the idea is also used in most other lossy encoding methods. MPEG video divides the frames into groups called GOPs (Group Of Pictures). The first is an intra or I frame, which stores the full picture much like a JPEG. The rest of the frames in the GOP store only the part of the picture that has changed, so they take up much less space. P-Frames are the simplest, which only store the differnce from the last frame. Basically, they look to the previous frame and only display what is different, hence the title P. B-Frames are more complicated in that they not only look to the previous frame but they can also look at frames ahead of them in the GOP. They are also known as Bi-directional frames. Of the three types of frames, I takes the most data, P less, and B the least to encode, but that also means decoding requires more power for a B-Frame than an I-Frame. For awhile, XviD didn't even implement B-Frames. Enabling B-Frames will probably give the best results in increasing the quality your videos over GMC and Qpel.
GMC is a feature of MPEG-4 that I don't really know much about. It is supposed to increase the quality of the videos, but from what I have read, it isn't that big of a boost, especially for the greater resources it requires.
Qpel I also don't know much about. I believe it offers a good improvement for quality, but is also requires a lot of resources to decode; in fact, it requires the most of these three options.
For this test, I used a two minute clip from a XviD encode of Harry Potter and the Prisoner of Azkaban with resolution of 576x240 and at 25 fps.
I used the program VirtualDubMod for the encoding. The program you use to encode the video doesn't matter as much as the codec (XviD,DivX). The codec handles all of the hard work encoding the video, and the program handles wrapping that video in a container such as avi, ogm, or mp4. For the codec settings, VirtualDubMod uses XviD's built in GUI the same as VirtualDub does. Other programs may use their own GUI to specify the parameters passed to XviD, so the same options are there, but there may be differences in how many options a program gives to you and maybe the default options it sets. If the program you use has basic settings like high and low quality, try to find out if you can select the specific settings it is using to make sure it doesn't enable something that isn't supported by the GP2X.
The B-Frames, GMC, and Quarter Pixel options in the XviD GUI are found by clicking the "more..." button by the "Profile and Level" dropdown.
I made a set of files with different options enabled at the same resolution of the test file and encoded all of them with only one pass at a bitrate of 700kbps and without audio. Also, I made a set at 320x136 to fit the width of the GP2X screen at 300kbps.
I set the following options for the files:
No B-Frames, GMC, or Qpel
B-Frames only
B-Frames and GMC
B-Frames and GMC and Qpel
GMC only
Qpel only
Since I was doing this quickly, I didn't record the encoding time, but I can say having all three options enabled nearly doubled the encoding time and the rest only added about 5-30% to the time.
Every video would jump a little, and it was usually at similar times. But, that shouldn't affect the outcome of the test and may be due to the buggy player or SD reading. I also noticed the jumpiness when I played a DivX3 video. I used a 1GB A-Data SD card I purchased from GP32z with my unit. Also, I have the v1.01 firmware with the mplayer patch installed.
The results are the same between the full and small resolution videos. The B-Frame only videos worked just as well as the video with none of the options. Any video with GMC or Qpel didn't work at all. When I selected the video, the GP2X showed the loading screen, but afterwards, only a black screen was displayed. They don't crash the player or anything because I can still exit to the menu or browser.
Make sure when you encode videos for the GP2X that GMC and Qpel are not enabled. It is a good idea to enable B-frames, though, because the quality of the video will be improved.
If they are in demand, I may post the test videos, but right now I should be studying for my Computer Science exam. It's about 1:30 am now and my exam is at 8:00 am.