idea

create a hotpluggable 'virtual screen' which streams using h264 encoded data to a raspberry PI where it is then decoded and displayed on the display.

target hardware:

  • t530 laptop with HD4000 open source graphics drivers on nixos linux
  https://wiki.archlinux.org/index.php/VA-API
  https://cgit.freedesktop.org/cgit/?url=libva/tree/test/encode/h264encode.c
  https://github.com/mzyy94/QSV-on-Linux
  http://www.tomshardware.de/video-transcoding-amd-app-nvidia-cuda-intel-quicksync,testberichte-240740-2.html
  https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC_products_and_implementations#Encoding
  http://www.avsforum.com/forum/26-home-theater-computers/1515782-estimating-handbrake-encoding-speed-comparing-other-cpu-benchmarks.html
  • raspberry pi with Omxplayer:
  https://wiki.matthiasbock.net/index.php/Hardware-accelerated_video_playback_on_the_Raspberry_Pi


most promising software to start hacking on:

nixos va driver config

services.xserver.vaapiDrivers
Description:		Packages providing libva acceleration drivers.
Default value:		[]
Example value:		[ pkgs.vaapiIntel pkgs.vaapiVdpau ]
Declared in:		nixos/modules/services/x11/xserver.nix

hd4000 h264encode tests

➜  films h264encode -w 1920 -h 1080 --profile MP                                                                                                                                     ~/Desktop/films
Source frame is 1920x1080 and will code clip to 1920x1088 with crop


INPUT:Try to encode H264...
INPUT: Resolution   : 1920x1080, 60 frames
INPUT: FrameRate    : 30
INPUT: Bitrate      : 14929920
INPUT: Slieces      : 1
INPUT: IntraPeriod  : 30
INPUT: IDRPeriod    : 60
INPUT: IpPeriod     : 1
INPUT: Initial QP   : 26
INPUT: Min QP       : 0
INPUT: Source YUV   : AUTO generated
INPUT: Coded Clip   : /tmp/test.264
INPUT: Rec   Clip   : Not save reconstructed frame


libva info: VA-API version 0.38.1
libva info: va_getDriverName() returns 0
libva info: Trying to open /run/opengl-driver/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
Use profile VAProfileH264Main
Support rate control mode (0x12):CBR CQP 
RateControl mode: CQP
Support VAConfigAttribEncPackedHeaders
Support packed sequence headers
Support packed picture headers
Support packed slice headers
Support packed misc headers
Support 1 RefPicList0 and 1 RefPicList1
Loading data into surface 15.....Complete surface loading
      \00000059(054456 bytes coded)

PERFORMANCE:   Frame Rate           : 5.59 fps (60 frames, 10730 ms (178.83 ms per frame))
PERFORMANCE:   Compression ratio    : 51:1
PERFORMANCE:     UploadPicture      : 10467 ms (174.45, 97.55% percent)
PERFORMANCE:     vaBeginPicture     : 0 ms (0.00, 0.00% percent)
PERFORMANCE:     vaRenderHeader     : 1 ms (0.02, 0.01% percent)
PERFORMANCE:     vaEndPicture       : 42 ms (0.70, 0.39% percent)
PERFORMANCE:     vaSyncSurface      : 244 ms (4.07, 2.27% percent)
PERFORMANCE:     SavePicture        : 7 ms (0.12, 0.07% percent)
PERFORMANCE:     Others             : -31 ms (71582787.75, 40027653.91% percent)
(Multithread enabled, the timing is only for reference)

links

Powered by MediaWiki