nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   vdpau + ffmpeg - no workie ??? (http://www.nvnews.net/vbulletin/showthread.php?t=164024)

DBabo 07-01-11 06:08 PM

vdpau + ffmpeg - no workie ???
 
hello,
i just compiled ffmpeg with vdpau support:
Code:

FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jul  1 2011 18:18:20 with gcc 4.4.4 20100726 (Red Hat 4.4.4-13)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
  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

for formats:
Code:

ffmpeg -formats | grep vdpau
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jul  1 2011 18:18:20 with gcc 4.4.4 20100726 (Red Hat 4.4.4-13)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
  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

and for codecs:
Code:

ffmpeg -codecs | grep vdpau     
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jul  1 2011 18:18:20 with gcc 4.4.4 20100726 (Red Hat 4.4.4-13)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
  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
 D V D  h264_vdpau      H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)
 D V DT mpeg1video_vdpau MPEG-1 video (VDPAU acceleration)
 D V DT mpeg4_vdpau    MPEG-4 part 2 (VDPAU)
 D V DT mpegvideo_vdpau MPEG-1/2 video (VDPAU acceleration)
 D V D  vc1_vdpau      SMPTE VC-1 VDPAU
 D V D  wmv3_vdpau      Windows Media Video 9 VDPAU

from my reading around i understand that this should be sufficient for enabling the decode on GPU ( i have GT240).

yet when i run :
Code:


ffmpeg -i 13.avi -target ntsc-dvd -aspect 16:9 -o out.mpg

FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jul  1 2011 18:18:20 with gcc 4.4.4 20100726 (Red Hat 4.4.4-13)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
  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
[mpeg4 @ 0x88b5b00]Invalid and inefficient vfw-avi packed B frames detected

Seems stream 0 codec frame rate differs from container frame rate: 23.98 (65535/2733) -> 23.98 (10000000/417083)
Input #0, avi, from '13.avi':
  Metadata:
    ISFT            : VirtualDubMod 1.5.10.2 (build 2542/release)
  Duration: 02:21:51.49, start: 0.000000, bitrate: 3557 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 1280x534 [PAR 1:1 DAR 640:267], 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s
Output #0, dvd, to 'out.mpg':
  Metadata:
    encoder        : Lavf52.64.2
    Stream #0.0: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], q=2-31, 6000 kb/s, 90k tbn, 29.97 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1

i "enjoy" the 65% CPU consumption by ffmpeg.

Am i doing smth wrong ?
thank you
Andrew

Gusar 07-02-11 05:10 AM

Re: vdpau + ffmpeg - no workie ???
 
FFMpeg doesn't support readback from vram into system ram. So you can only use VDPAU to display hardware decoded video, not to transcode it.

DBabo 07-02-11 10:29 AM

Re: vdpau + ffmpeg - no workie ???
 
Quote:

Originally Posted by Gusar (Post 2451741)
FFMpeg doesn't support readback from vram into system ram. So you can only use VDPAU to display hardware decoded video, not to transcode it.

i see. Is there any other program that would allow to take advantage of VDPAU for transcoding?

artem 07-02-11 03:30 PM

Re: vdpau + ffmpeg - no workie ???
 
mplayer and all (lib)xine based players

Gusar 07-02-11 03:49 PM

Re: vdpau + ffmpeg - no workie ???
 
Quote:

Originally Posted by artem (Post 2451849)
mplayer and all (lib)xine based players

I am *very* sure mplayer doesn't support readback. No idea about xine, but I don't think it does either. And even if it does, xine is a playback-only library, so not useful for transcoding.

The only app I know which supports readback is VLC, but I have no idea how sophisticated VLC's transcoding abilities are.

crisalide 07-03-11 01:33 PM

Re: vdpau + ffmpeg - no workie ???
 
MLT does, but do not expect a big speed increase, because in the transcoding chain, decoding is not the big part and because vram to sysram copy requires approx as much cpu time as soft decoding. In short, don't count on vdpau to speed up transcoding significantly.

DBabo 07-04-11 05:39 PM

Re: vdpau + ffmpeg - no workie ???
 
Quote:

Originally Posted by crisalide (Post 2452104)
MLT does,.... In short, don't count on vdpau to speed up transcoding significantly.

are you referring to MLT or to VLC transcoding speed ?

DBabo 07-20-11 12:19 PM

Re: vdpau + ffmpeg - no workie ???
 
Quote:

Originally Posted by crisalide (Post 2452104)
MLT does, but do not expect a big speed increase, because in the transcoding chain, decoding is not the big part and because vram to sysram copy requires approx as much cpu time as soft decoding. In short, don't count on vdpau to speed up transcoding significantly.

well, you guys and crisilide were right. To satisfy my curiosity bug i went ahead and compiled the vlc + vaapi and vdpau. And here are my results:

I ran
Code:

cvlc --ffmpeg-hw A_File.avi --sout='#transcode{vcodec=mp1v,vb=1024,acodec=mpga,ab=128}:std{access=file,mux=ts,dst=./Trans_hw.mpg}'
cvlc A_File.avi --sout='#transcode{vcodec=mp1v,vb=1024,acodec=mpga,ab=128}:std{access=file,mux=ts,dst=./Trans.mpg}'

Here are some metrics:
to convert 668Mb avi file to mpg on 2Gb AMD Sempron 3200 system"
HW enabled transcoding ~ 40 minutes, CPU utilization ~80%
no HW enabled ~30 minutes, CPU utilization ~ 97% ( full load).

Thank you for your help and advise!
Andrew

P.S. Link to vlc forums with my steps ( to get vlc _ vdpau working) and some discussion. http://forum.videolan.org/viewtopic....304401#p304401


All times are GMT -5. The time now is 07:08 PM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.