Video on Linux

Linux
Video
Published

September 14, 2014

Modified

February 28, 2023

Formats

Install a broad selection of media formats

sudo dnf install -y \
  https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
  https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpmfusion
sudo dnf groupupdate multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugins
sudo dnf groupupdate sound-and-video

DVD

Install DVD support 1:

sudo dnf install -y \
     https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
     https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install -y rpmfusion-free-release-tainted
sudo dnf install -y libdvdcss

Play DVD with the VLC player

OpenH264

Cisco provides an OpenH264 codec…

sudo dnf config-manager --set-enabled fedora-cisco-openh264
sudo dnf install gstreamer1-plugin-openh264 mozilla-openh264

Transcode

FFmpeg …universal media converter

sudo dnf install -y ffmpeg-free

# ...convert a video
ffmpeg -i input.mp4 output.web

LosslessCut

  • …cross platform FFmpeg GUI
  • …lossless trimming and cutting of video and audio files
cd $HOME/bin
wget https://github.com/mifi/lossless-cut/releases/download/v3.56.0/LosslessCut-linux-x86_64.AppImage
# ...or...
flatpak install losslesscut

Handbrake 2

…cross platform video transcoder

  • …convert video to MP4, MKV, or WebM
  • …crop and resize video
  • …pass-through audio without conversion for certain audio types
sudo flatpak install handbrake
# ...or...
sudo dnf install -y \
  https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install handbrake handbrake-gui

For DVD encoding …x264/1080p

  • Preset **Supor HQ 1080p30 Surround
  • Video…
    • RF 21 (rate factor)
    • Constant quality & Constant Framerate (VFR)
    • 2-Pass Encoding & Preset: “very slow” (quality over encoder speed)
    • Tunse: “film” (optimize for movies)
    • Profile “High” (CPU envelope) & Level 4.0 (bitrate, framerate & resolution constrains)
    • More settings ref=5:bframes=5
  • Audio & Subtitle …add additional language tracks

yt-dlp

yt-dlp 3 is a fork of the original youtube-dl

sudo dnf install -y ffmpeg-free
pip install --upgrade yt-dlp
alias yt='yt-dlp -f "bv*+ba/b"'

WebCam

sudo modprobe v4l2loopback exclusive_caps=1
gphoto2 --stdout --capture-movie \
        | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0

libgphoto2 supported cameras
http://gphoto.org/proj/libgphoto2/support.php

v4l2loopback - a kernel module to create V4L2 loopback devices
https://github.com/umlaeute/v4l2loopback