Video play not smooth on A20 Micro with hardware acceleration on mplayer

Started by nsingh, July 05, 2016, 05:09:12 PM

Previous topic - Next topic

nsingh

I am working on 1080p MP4 (around 20 Mbps/29.97 fps) video play with hardware acceleration on mplayer that use video output as vdpau and video codecs as ffmpeg12vdpau, ffh264vdpau, ffwmv3vdpau, ffvc1vdpau
I already installed libvdpau-sunxi on my debian system. The debian version I am using is 3.4.90+ (wheezy). The hardware I am using is Olimex A20 Olinuxino-Micro.
But when I play video using serial console command:
mplayer TestVideo1.mp4
I observed panning/jitters on many frames of the video and the playback is not smooth. The audio and video are also out of sync in the first iteration of the video. The out of sync problem happens only in the first iteration of the video; if I play the same video again, the audio-video remains in sync, but the panning/jitters are still there in the video. I tried to troubleshoot the issue with different videos/web forums, but couldn't get success. Since A20 can easily play 30 Mbps/30 fps 1080p videos as mentioned in specifications, I don't understand why my hardware is not playing it smoothly. Is there any kind of specific settings that I need to look upon. Since I am quite new to A20 Micro board based developments, so need a direction to fix my issue.

Can anyone help me out to solve the issue?

I am enclosing link to the video where u can see panning/jitters at 7-8th second and 12-13th second of the video:
Link:
http://sendvid.com/zuarix67

igorpec

linux for ARM development boards
www.armbian.com

LubOlimex

Hey,

Did you test with another player?

We run 1080p videos without any problems with mpv. Make sure to test with both official images for A20-OLinuXino-MICRO - the Jessie and the Wheezy one and then open a console window in X environment. Log as super user (olimex/olimex in the GUI). Type:

#export VDPAU_DRIVER=sunxi
#mpv --vo=vdpau --hwdec=vdpau --hwdec-codecs=all test.mp4

,where test.mp4 is the video file name

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

nsingh

Hi

@LUBOlimex

Understood, we also have played some 1080p videos without issues.  However we do not get smooth playback with any video that has fullscreen panning.  Also 20MB/s+ videos have issues.  We have to force the video output to 1080p @ 30fps because 60fps will not playback smoothly (even at 15MB/s) audio and video will be seriously out of sync.

We can always transcode the video to a lower bitrate or framerate to try and fix the issues (other than fullscreen panning which NEVER is fixed 100%).

Can you test the video I posted as this video is perfect for displaying the issue I am stating.  Let me know your results also you have to play the video to a 1080p TV to really see the issue (we use a 40" Samsung).  Smaller computer monitors also have the issue but on the smaller screen its understated.

I tried with mpv but only on Debian Wheezy as I read on olimex wiki that Jessie version is not yet stable and they recommend to use wheezy 3.4.90+.
But mpv doesn't makes any difference in video play. It also shows panning/jitters and playback is not smooth.
Is there any other specific settings that are required for smooth video playback??


thanks
Nav

LubOlimex

Hey,

The bad 60FPS playback is most likely due to a software limitation. The open source driver is not that optimized. Furthermore, there are videos with monster bit rates that would choke a lot of powerful personal computers. Try this one for example: http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_native_60fps_normal.mp4

I can say this thing for sure - there are videos that the board would not be able to play fluently especially under Linux.

One of the videos that we often use for testing the FullHD playback might be downloaded from here: http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_surround.avi - since there are different versions of the same video and also it is not very short. The source web-site is here: https://peach.blender.org/download/

You can test the latest Jessie release for the board - the stability issues had been resolved lately.

Also if the 60FPS video playback is important to you - I would recommend you to test the Android - the original closed source drivers provided by the manufacturer would probably decode 60FPS videos better.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

nsingh

@ LubOLIMEX

I understand what you are saying about monster bitrates BUT I am talking about 16MB/s videos that do not play smoothly.  All I need to know is if someone can test the video I posted to see if they get the same results I am getting.  The issue we want to look into is why videos with panning (especially if all the pixels on the screen are panning at the same time) do not play smoothly even if we transcode them to 10MB/s???

Please try the video I posted originally and look at the times I posted that cause us issues.

Just want to know if my results are because of some setting or if this is a known issue with the A20 decoding.

LubOlimex

Hey,

I did some tests today. This video seems to be poorly encoded. It has built-in lag at two points at least:

1) The first point of low FPS seems to be in the scene after the coliseum - when the terraces of Machu Picchu are shown

2) The second point of low FPS seems to be the second time the pyramid of Intiwuatana is show (at top of Machu Picchu)

I used two different computers with a number of different players and there seems to be slight but noticeable lag at those two points. I then tested the video on a LIME2 board with two different players - the default one of the graphical environment and the mpv player - the video plays exactly the same as on personal computers - slight but noticeable lag at those two point. The video output of the board was set to 1080p FullHD resolution.

It would be nice if somebody else with attention to video detail can download and play your video on his/hers computer and confirm that the video is poorly encoded and has built-in lag. It is located here: http://sendvid.com/zuarix67

Also note that the bit rate of the video you shared is much much lower compared to what we use for testing and that works here fine. It is less than 3000 kbps, this video that I shared before has more than 12000 kbps video bit rate and 5-channel audio at more than 400 kbps: http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_surround.avi

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

nsingh

@ LubOLIMEX

Thanks for testing the video. Actually the video I posted is 22 MB/s video and not 3 MB/s, I think the files sharing website did a poor encoding and transcode it to 3 MB/s. I apologize for this.
Because I also tried the native file on my computer and it plays really smooth but on A20 Micro board, it doesn't.

I am sharing the native file at this link:
http://mbf.cc/eJ4sRJ

Please try on your systems/computer and on A20 boards too and let me know if you are getting the same results as of me. I appreciate your help.

thanks
Nav

LubOlimex

Hey,

This video plays smooth in the first few seconds then stops abruptly before the second segment (Machu Picchu terraces). The command line looks like this:

olimex@A20-OLinuXino:~$ export VDPAU_DRIVER=sunxi
olimex@A20-OLinuXino:~$ mpv --vo=vdpau --hwdec=vdpau --hwdec-codecs=all /mnt/TestVideo2222.mp4
Playing: /mnt/TestVideo2222.mp4
[stream] Video (+) --vid=1 (*) (h264)
[stream] Audio (+) --aid=1 --alang=und (*) (aac)
File tags:
major_brand: mp42
minor_version: 512
compatible_brands: isomiso2avc1mp41
creation_time: 2016-07-04 19:59:02
encoder: HandBrake 0.10.5 2016021100
[VDPAU SUNXI] VE version 0x1623 opened.
Trying to use hardware decoding.
AO: [alsa] 48000Hz stereo 2ch float
VO: [vdpau] 1920x1080 => 1920x1080 vdpau
[VDPAU SUNXI] Presentation time not supported
AV: 00:00:02 / 00:00:15 (19%) A-V:  0.726
[vo/vdpau] OSD: error when creating surface: An invalid/unsupported VdpRGBAFormat value was supplied.
Segmentation fault00:15 (42%) A-V:  1.687


It stops at exactly the same place no matter how many times I play it. I would suggest that it tries to load too big surface more than 10bits as explained here: https://github.com/linux-sunxi/libvdpau-sunxi/issues/27

For reference this is a normal output, playing full HD big bunny and stopping the video manually:

olimex@A20-OLinuXino:~$ mpv --vo=vdpau --hwdec=vdpau --hwdec-codecs=all /mnt/big_buck_bunny_1080p_surround.avi
Playing: /mnt/big_buck_bunny_1080p_surround.avi
[stream] Video (+) --vid=1 (mpeg4)
[stream] Audio (+) --aid=1 (ac3)
File tags:
encoder: AVI-Mux GUI 1.17.7, Aug  8 2006  20:59:17
JUNK:
[VDPAU SUNXI] VE version 0x1623 opened.
Trying to use hardware decoding.
[libav/audio] ac3: channel layout does not match number of channels
AO: [alsa] 48000Hz stereo 2ch float
VO: [vdpau] 1920x1080 => 1920x1080 vdpau
[VDPAU SUNXI] Presentation time not supported
AV: 00:00:02 / 00:09:56 (0%) A-V: -0.001

Exiting... (Quit)


Again note that I'm not convinced that your video is fluent. I notice the same slight lag/camera jerking at the two points that I mentioned previously.

Also the discrepancies of the video performance can be related to the container of the video while both videos use mpeg-4 for encoding one of them uses avi while the other mp4. Yet, it is probably too big of bit-rate. Try with lower bit rate.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

nsingh

@ LubOLIMEX

Thanks for testing the Video. I am sharing one more video but this is of lower bit rate and doesn't stops at all on Micro board. It plays smooth on Computer PC, but again shows jitters/lag on A20 Olimex Micro board as discussed earlier. Please test on your hardware and suggest why the playback is not smooth on Olimex Micro board since it is playing smoothly on PC.


LINK for the VIDEO:
http://mbf.cc/Qtedxo


Thanks for your help/suggestion.

I am sharing my mplayer logs for your reference:

MPlayer2 UNKNOWN (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 TestVideo2.mp4.
Detected file format: QuickTime/MPEG-4/Motion JPEG 2000 format (libavformat)
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  1920x1080  24bpp  29.970 fps  13719.4 kbps (1674.7 kbyte/s)
Clip info:
major_brand: mp42
minor_version: 512
compatible_brands: isomiso2avc1mp41
creation_time: 2016-07-04 20:04:43
encoder: HandBrake 0.10.5 2016021100
Load subtitles in .
[VDPAU SUNXI] VE version 0x1623 opened.
==========================================================================
Forced video codec: ffmpeg12vdpau
Forced video codec: ffh264vdpau
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264vdpau] vfm: ffmpeg (FFmpeg H.264 (VDPAU))
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 159.0 kbit/10.35% (ratio: 19879->192000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 1920x1080 => 1920x1080 H.264 VDPAU acceleration  [fs]
<4>[DISP] layer allocated: 0,102
[   39.166662] [DISP] layer allocated: 0,102
[vdpau] Got display refresh rate 60.000 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
[VDPAU SUNXI] Presentation time not supported
A:  15.0 V:  15.0 A-V:  0.036 ct:  0.000   0/  0 61% 27%  6.6% 187 0

<4>[DISP] layer released: 0,102
[   54.850787] [DISP] layer released: 0,102

Exiting... (End of file)
<4>[DISP] layer released: 0,101
[   54.897350] [DISP] layer released: 0,101
<4>[DISP] layer allocated: 0,101
[   54.933117] [DISP] layer allocated: 0,101


Regards
Nav

LubOlimex

Hey,

Instead of me testing videos that might not work, using a player that I'm not sure if it work wouldn't it be easier for you to test with a video that does work with a player that works (mpv)?

I'm not sure if I can do anything even if the video is not working properly.

It is a single board computer - its video playback capabilities are limited hardware-wise by default. The open source software nature of the support makes the video playback limitations even greater since the driver support is not perfect. Even if there are problems with the video playback it might be more productive to contact the people behind the player or behind the cedarx driver.

Edit: By the way where do you want the video from? You might be hitting the baudrate transfer maximum.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex