Can't get Openshot running with vdpau.

Asked by barkman

I want to use openshot to edit videos from my Canon HD camcorder (same model as Jonathan's). I have been trying to get this to work, off and on, for over a year. Basically, I spend the better part of a week on this every time a new version of Ubuntu or Openshot is released. Over the last year I have reloaded Ubuntu from scratch at least 5 times; by the time I try all the remedies I find on forums and web, the OS becomes a gibbering mass of quivering bits.

You might think this would be working without unnatural gyrations by now.

Yes. I know Openshot relies on MLT and FFMPEG and this is not Openshot's problem. However, I believe the Openshot community has more interest in getting this stuff to work than the MLT or FFMPEG communities.

This time I upgraded to Ubuntu 10.10 using upgrade manager. With this, previewing my MTS files in openshot stutters so badly it is not usable using 104% of available CPU. ffplay and melt yield approximately the same results. mplayer -vo vdpau -vc ffh264vdpau 00000.MTS works fine only using 4% of the CPU, so vdpau is working.

Some earlier versions of Openshot would hang and the process would have to be killed from the command line.

The system has an AMD Phenom(tm) 9650 Quad-Core Processor with 8G of memory. The embedded video controller is:

Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName "GeForce 9400 GT"
EndSection

The OS is 64-bit Ubuntu 10.10

The only reason this machine exists is to run Openshot.

I have not tried this on 32-bit Ubuntu or on an Intel processor. I have not found anything in forums alluding to these problems due to issues with AMD processors or 64-bit Ubuntu.

This time around I tried:

> HOWTO: Install and use the latest FFmpeg and x264 http://ubuntuforums.org/showthread.php?t=786095

This seemed to be worse. The stock ffmpeg says:
> ffmpeg
> FFmpeg version 0.6-4:0.6-2ubuntu6, Copyright (c) 2000-2010 the FFmpeg developers
> built on Oct 5 2010 22:36:53 with gcc 4.4.5
> configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
> WARNING: library configuration mismatch
  > libavutil configuration: --extra-version=4:0.6-2ubuntu3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libmp3lame --enable-gpl --enable-postproc --enable-x11grab --enable-libfaad --enable-libxvid --enable-libx264 --enable-librtmp --enable-libdc1394 --enable-shared --disable-static
> libavutil 50.15. 1 / 50.15. 1
> libavcodec 52.72. 2 / 52.72. 2
> libavformat 52.64. 2 / 52.64. 2
> libavdevice 52. 2. 0 / 52. 2. 0
> libavfilter 1.19. 0 / 1.19. 0
> libswscale 0.11. 0 / 0.11. 0
> libpostproc 51. 2. 0 / 51. 2. 0
> Hyper fast Audio and Video encoder
> usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
>
> Use -h to get full help or, even better, run 'man ffmpeg'
>

This "latest" version did not mention anything about vdpau in its conf string. So I reverted to the stock ffmpeg.

I also enabled the medibuntu repository for 10.10. http://www.webupd8.org/2010/10/medibuntu-repository-is-available-for.html

There was supposed to be a different version of ffpeg there, but I didn't find it.

What is the secret handshake? From searching the forums and googling the net, there don't seem to be very many people sharing my pain. It would be nice to hear from someone that has this working and get their cliff notes on what they did to get it to work.

Otherwise, I am faced with 2 ugly options, 1) Buying a faster machine (and forgetting about hw acceleration) when this one should be perfectly fine for my purposed for years. 2) Paying tribute to Sony and M$ by installing Vegas (which I know works) on the windows machine that I keep promising to turn off forever someday....

I appreciate your kind indulgence. +John

Question information

Language:
English Edit question
Status:
Solved
For:
OpenShot Video Editor Edit question
Assignee:
No assignee Edit question
Solved by:
Jonathan Thomas
Solved:
Last query:
Last reply:
Revision history for this message
barkman (jbmongo) said :
#1

I tried installing these libraries from medibuntu to replace the default packages; no help...

libavfilter-extra-1
libavdevice-extra-52
libavutil-extra-50
libavcodec-extra-52
libavformat-extra-52
libavdevice-unstripped-52
libavutil-unstripped-50
libavcodec-unstripped-52
libavformat-stripped-52

Revision history for this message
barkman (jbmongo) said :
#2

I also loaded the latest openshot from LL-PPA-jonoomph-openshot-edge/maberick

Revision history for this message
Best Jonathan Thomas (jonoomph) said :
#3

Unfortunately, the "MTS" container format still has really bad performance in FFmpeg. MLT add even more overhead, as it has to scale and convert between color-spaces for each frame. So, the secret handshake is... convert the "MTS" files into a friendlier format, and then edit them with OpenShot. Here is an example command:

This example command is from the README file in the /openshot/ folder (somewhere on your computer). It will convert all MTS videos in a folder to MP4 videos. Of course, change the folder name to match your folder path.

find '/home/jonathan/Desktop/Caveman Movie/Videos' -iname "*.MTS" -exec ffmpeg -i {} -acodec libfaac -ab 128k -ac 2 -r 60 -vcodec mpeg4 -f mp4 -y -sameq {}.mp4 \;

If this command does not work, you might try using a different audio codec, such as (ac3):
find '/home/jonathan/Desktop/Caveman Movie/Videos' -iname "*.MTS" -exec ffmpeg -i {} -acodec ac3 -ab 128k -ac 2 -r 60 -vcodec mpeg4 -f mp4 -y -sameq {}.mp4 \;

Let me know how this works for you. Good luck.

Revision history for this message
Jonathan Thomas (jonoomph) said :
#4

By the way, vdpau will be disabled in the next version of OpenShot (coming soon). This is due to some issues I've encountered with MLT, and the fact it does not help out that much in a video editor. Decoding is only part of the work. As I mentioned, after the hardware decodes the frame, then MLT has to scale the pixels, convert between colorspaces, and then re-encode, etc... So, vdpau can save a little bit of CPU, but not as much as a video playback scenario... if that makes sense.

Revision history for this message
Olivier Girard (eolinwen) said :
#5

There is a workaround for this problem using the DNxHD format, working well on Openshot. You must convert your files with using an external too (GUI) like EKD (see my comment here : http://openshotusers.com/forum/viewtopic.php?f=11&t=623&p=2909&hilit=dnxhd#p2909) or in command line.

Revision history for this message
barkman (jbmongo) said :
#6

@Jonathan,
I was reaching the conclusion that the .MTS files had to be converted to something else; you just confirmed it. A couple of days ago, I converted one of my .MTS files to 1920x1080p .mpeg and .mp4 files using a demo version of a windows program designed specifically to convert .MTS into other formats. I was able to bring these files into openshot, preview and edit smoothly without any obvious video degradation. At that point, I started experimenting with various incantations using ffmpeg and mencoder to create a high quality conversion with out much success.

I tried both of your incantations and they both worked well, creating files approximately 2x the size of the .MTS file and indistinquishable from each other (except for the small difference in files sizes). These conversions were surprisingly quick.

BTW: I did not find a README file on my conputer with these commands. This could be because I currently have openshot installed from LL-PPA-jonoomph-openshot-edge/maverick.

VDPAU has been a boon to the Mythtv world; I can add a cheap nvidia card to a computer that would otherwise be too slow to be a doorstop, and use it to play HD TV and videos. I guess this led me to unrealistic expectations for its application to openshot.

@cenwen,
Thanks for your suggestion. EKD looks very interesting (but I need to brush up on my highschool French :-D). It does not seem to be in the repositories for Ubuntu 10.10 yet, but I will keep my eye out for it!

+jb

Revision history for this message
barkman (jbmongo) said :
#7

Thanks Jonathan Thomas, that solved my question.

Revision history for this message
Olivier Girard (eolinwen) said :
#8

Thanks for your suggestion. EKD looks very interesting (but I need to brush up on my highschool French :-D). It does not seem to be in the repositories for Ubuntu 10.10 yet, but I will keep my eye out for it!

Just a precision about EKD, he exists in English and in Spanish. And now, his official website is translated in English too.