• sudo apt-get install git cmake gcc yasm build-essential autoconf libtool libfreetype-dev libfribidi-dev libfontconfig1-dev python libsdl2-2.0-0 libsdl2-dev libgnutls28-dev libva2 libva-dev vainfo libbluray-dev liblua5.3 liblua5.3-dev libdrm-dev libsdl2-dev libsdl2-mixer-dev libarchive-dev wayland-protocols libvdpau-dev libplacebo-dev libgdm-dev libluajit-5.1-dev -y
  • git clone https://github.com/mpv-player/mpv-build.git && cd mpv-build
  • ./use-mpv-release
  • ./use-ffmpeg-release
  • ./rebuild -j8
  • sudo ./install
  • echo "hwdec=vaapi" > .config/mpv/mpv.conf
  • mpv http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_2160p_60fps_normal.mp4

AMD Settings

  • Enable GPU Scaling on 1920x1200 Display 1 (if you have one, this will make both 1080p)
  • Pixel Format: YCbCr 4:2:2 on Display 2 (Cam Link 4K)
  • Disable HDMI Link Assurance on Display 2 (just in case)

Windows Settings

  • Clone Displays (1080p)

Hardware

  • Directly plug in the cam link into your usb port, do not use cable (if you have 10Gbps or faster ports use that)

Capture (FFMPEG, AMF)

720p AVC

  • ffmpeg -hide_banner -rtbufsize 1024M -f dshow -i video="Cam Link 4K":audio="Digital Audio Interface (Cam Link 4K)" -vf scale=1280:-1 -pix_fmt yuv420p -c:v h264_amf -b:v 50M -c:a flac -preset:v high -f matroska test.mkv

720p HEVC

  • ffmpeg -hide_banner -rtbufsize 1024M -f dshow -i video="Cam Link 4K":audio="Digital Audio Interface (Cam Link 4K)" -vf scale=1280:-1 -pix_fmt yuv420p -c:v hevc_amf -b:v 50M -c:a flac -preset:v high -f matroska test.mkv

1080p AVC

  • ffmpeg -hide_banner -rtbufsize 1024M -f dshow -i video="Cam Link 4K":audio="Digital Audio Interface (Cam Link 4K)" -pix_fmt yuv420p -c:v h264_amf -b:v 50M -c:a flac -profile:v high -f matroska test.mkv

1080p HEVC

  • ffmpeg -hide_banner -rtbufsize 1024M -f dshow -i video="Cam Link 4K":audio="Digital Audio Interface (Cam Link 4K)" -pix_fmt yuv420p -c:v hevc_amf -b:v 50M -c:a flac -profile:v high -f matroska test.mkv

OBS Studio

  • You can now simply use it as usual in obs studio

Reference

  • switch to h264_nvenc or h264_qsv if you have nvidia or intel gpu
  • ffmpeg -hide_banner -list_devices true -f dshow -i dummy
  • if you are using a DSLR, try switching camera to 720p60 mode, also change the pixel format if it has support for that to YCbCr 4:2:2 or YCbCr 4:2:0 to lower the bandwith used

the rebel alliance has finally released the av1 video codec

aomenc encoder aomenc
aomdec decoder aomdec file.webm output.y4m or aomdec file | mpv -

  • -v for verbose
  • --cpu-used= for quality level like x264s profiles and 0 is placebo and 4 is fastest
  • -w for width and -h for height

ffmpeg to prep the source video

  • ffmpeg -i 8bit-src.mkv -pix_fmt yuv420p 8bit.y4m
  • ffmpeg -i 10bit-src.mkv -pix_fmt yuv420p10le 10bit.y4m
  • ffmpeg -i 12bit-src.mkv -pix_fmt yuv420p12le 12bit.y4m

Encode 8-bit AV1

aomenc -v -w 1920 -h 1080 --cpu-used=0 --target-bitrate=1500 --threads=16 --profile=0 --aq-mode=0 --lag-in-frames=25 --auto-alt-ref=1 -o av1-8bit.webm 8bit.y4m

Encode 10-bit AV1

aomenc -v -w 1920 -h 1080 --cpu-used=0 --target-bitrate=1500 --threads=16 --profile=0 --aq-mode=0 --lag-in-frames=25 --auto-alt-ref=1 -o av1-10bit.webm 10bit.y4m

Encode 12-bit AV1

aomenc -v -w 1920 -h 1080 --cpu-used=0 --target-bitrate=1500 --threads=16 --profile=0 --aq-mode=0 --lag-in-frames=25 --auto-alt-ref=1 -o av1-12bit.webm 12bit.y4m

  • ffmpeg output yuv420 (8-bit), yuv420p10le (10-bit), yuv420p12le (12-bit)
  • Encodng Speed/Quality --cpu-used 0 to 4 is currently tuned

if this is wrong please contact me on twitter or by email




But first we need to some background music for our work

Gaming Machine (OBS Studio)

  • Stream > Stream Type: Custom streaming Sever rtmp://encodingserver:1935/live/
  • Output > Streaming
  • Encoder: H264/AVC Encoder (AMD Advanced Media Framework)
  • Preset: Reset to Default
  • Target Bitrate: 25000 (25mbps)

Gaming Machine (AMD Relive)

  • Relive > Streaming
  • Custom Stream Enabled
  • Server URL rtmp://encodingserver:1935/live/
  • Connection Key blank
  • Streaming Profile Custom
  • Streaming Resolution 1080p
  • Streaming Bitrate 20 Mbps
  • Streaming FPS 60
  • Audio Bitrate 192 kbps

Rant@AMD why cant people with non-16:9 display have a crop/pan option!
so that we can crop 1920x1200 to 1920x1080?

with ffmpeg you can do -vf "crop=1920:1080:60:60"

panning would also been nice...

Windows Encoding Server (Nginx/FFMPEG Simulcast)

Recommended Hardware for 1080p: Ryzen 1700/1600
Recommended Hardware for 720p: Ryzen 1500X

if your using a server on the intertubes please add auth or restrict by ip
http://nginx-rtmp.blogspot.no/2013/06/secure-links-in-nginx-rtmp.html
https://helping-squad.com/nginx-rtmp-secure-your-nginx-server/

  • Download: https://github.com/nwgat/ninjastreamer/archive/master.zip
  • Open conf/nginx.conf in notepad
  • Change push urls under liveout
  • Run ninjastreamer.1080p.bat for 1080p 6mbps
  • Run ninjastreamer.720p.bat for 720p 3mbps
  • in OBS Studio click start streaming
  • Run stop nginx.bat to stop nginx
  • Run kill nginx and ffmpeg.bat to taskkill if it hangs

Linux Encoding Server (Nginx/FFMPEG Simulcast)

Recommended Hardware for 1080p: Ryzen 1700/1600
Recommended Hardware for 720p: Ryzen 1500X

if your using a server on the intertubes please add auth or restrict by ip
http://nginx-rtmp.blogspot.no/2013/06/secure-links-in-nginx-rtmp.html
https://helping-squad.com/nginx-rtmp-secure-your-nginx-server/

  • sudo apt-get install ffmpeg nano git
  • git clone https://github.com/nwgat/ninjastreamer && cd ninjastreamer
  • nano conf/nginx.conf
  • Change push urls under liveout
  • chmod 777 nginx
  • chmod 777 ninjastreamer.*
  • Run sh ninjastreamer.1080p.sh for 1080p 6mbps
  • Run sh ninjastreamer.720p.sh for 720p 3mbps
  • in OBS Studio click start streaming
  • Run pkill -9 nginx && pkill -9 ffmpeg to kill if it hangs

Notes

  • Depending on your CPU you can change x264 quality with preset from ultrafast,superfast, veryfast, faster, fast, medium
  • You can even use hardware encoders like h264_amf, h264_nvenc or h264_qs

*because i was bored





The Fire Escape is a 4K benchmark that measure the time it takes to encode a 4K file to x264 using open souce video editor OpenShot

uses a shotcut project file with a raw 4k video file, flac music by GUNSHIP, Text Overlay

above scores are average of 5 runs
please note that these systems are not benchmark systems and are real world

  • bench.x264.py Encoding 3840x2160p24 4K Shotcut Project using qmelt to x264 with Slow Preset and 16 CRF
  • bench.x265.py Encoding 3840x2160p24 4K Shotcut Project using qmelt to x265 with Slow Preset and 16 CRF
  • bench.vp9.py whenever google gets around to implementing proper multi-threading
  • bench.av1.py whenever aomedia gets around to finalizing spec and implementing multi-threading

Install

Tests cpu/ram and ssd/hdd and the results are in seconds

Special Thanks to

  • iWalkingCorpse for 1500X
  • Vegetables for 1700 3.8Ghz
  • Xplode for Threadripper 1950X
  • T-Nan for 7800X
  • shillzude for 5820K

This Benchmark is based on Shotcut and MLT open source project https://www.shotcut.org/

Receive $10 in credit at DigitalOcean for your VPS Hosting
Cheaper Games on Instant-Gaming
Proudly published with Ghost | Theme based on Draugur | Header Image by GUWEIZ@DeviantArt
Creative Commons Licence