decodificador de hardware usando apenas ffmpeg

0

Como faço para usar o decodificador de hw para processar dados de vídeo diretamente na tela?

estou usando o orangepipc (H3).

se eu estiver usando o mpv player, tudo funcionará bem.

sudo mpv av://v4l2:/dev/video0 --vo=vdpau --hwdec=vdpau --hwdec-codecs=all --fs

mas eu quero usar o ffmpeg apenas para fazer o mesmo trabalho:

$ sudo ./ffmpeg -hwaccel vdpau  -f v4l2 -channel 0 -video_size 1280x720 -i /dev/video0 -pix_fmt nv12 -r 10
ffmpeg version 3.3.git Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/usr --enable-nonfree --enable-gpl --enable-version3 --enable-vdpau --enable-libx264 --enable-libmp3lame --enable-libpulse --enable-libv4l2
  libavutil      55. 63.100 / 55. 63.100
  libavcodec     57. 96.101 / 57. 96.101
  libavformat    57. 72.101 / 57. 72.101
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 90.100 /  6. 90.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Trailing options were found on the commandline.
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1503479273.620903, bitrate: 88473 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720, 88473 kb/s, 8 fps, 8 tbr, 1000k tbn, 1000k tbc
At least one output file must be specified

EDITAR:

$ sudo ./ffmpeg -devices

...

Devices:
 D. = Demuxing supported
 .E = Muxing supported
 --
 DE alsa            ALSA audio output
 D  dv1394          DV1394 A/V grab
 DE fbdev           Linux framebuffer
 D  jack            JACK Audio Connection Kit
 D  lavfi           Libavfilter virtual input device
 DE oss             OSS (Open Sound System) playback
 DE pulse           Pulse audio output
  E v4l2            Video4Linux2 output device
 D  video4linux2,v4l2 Video4Linux2 device grab
 D  x11grab         X11 screen capture, using XCB
  E xv              XV (XVideo) output device

ainda recebe uma mensagem de erro:

$ DISPLAY=:0 sudo ./ffmpeg -hwaccel vdpau  -f v4l2 -channel 0 -video_size 1280x720 -i /dev/video0 -f xv display

...

Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1503483702.709213, bitrate: 88473 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720, 88473 kb/s, 8 fps, 8 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[xv @ 0x2551040] No X-Video adaptors present
Could not write header for output file #0 (incorrect codec parameters ?): No such device
Error initializing output stream 0:0 --
Conversion failed!

$ DISPLAY=:0 sudo xvinfo
X-Video Extension version 2.2
screen #0
 no adaptors present

mpv suporta saída vdpau

$ sudo mpv -vo help
LIBGL: Initialising glshim
Available video outputs:
  vdpau          : VDPAU with X11
  sdl            : SDL 2.0 Renderer
  x11            : X11 (slow, old crap)
  null           : Null video output
  image          : Write video frames to image files
  caca           : libcaca
  drm            : Direct Rendering Manager
    
por sailfish009 23.08.2017 / 11:22

0 respostas

Tags