Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 2.05 KB

README.md

File metadata and controls

69 lines (48 loc) · 2.05 KB

README

Demonstrate creating an ffmpeg image with Nix.

📝 TODO:

🏠 Build and Run (builder)

# build ffmpeg 
docker build -f Dockerfile.builder -t nix-builder .

# create image
docker run -v $(pwd):/build -it nix-builder     

# debugging
docker run -v $(pwd):/build -it --entrypoint /bin/sh nix-builder
nix-build ./ffmpeg-full.nix 

🏠 Load image into registry

# load image into local registry
docker load < ffmpeg-image

# should be most recent image
docker images

# show version
docker run -v $(pwd):/output -it ffmpeg ffmpeg

🔍 Inside build container

# jump into bash in container
docker run -v $(pwd):/output -it ffmpeg:latest ffmpeg -f lavfi -i testsrc=size=1920x1080 -t 20 -pix_fmt yuv420p -vf "drawtext=fontfile=/windows/fonts/arial.ttf:text='Testcard':fontcolor=white:fontsize=100" /output/testcard_1080p2.mp4

⚡️ Build and Run (fat image)

# build ffmpeg 
docker build -f Dockerfile.ffmpeg -t nix-ffmpeg .

# debugging
docker run -v $(pwd):/output -it --entrypoint /bin/sh nix-ffmpeg   

⚡️ Use ffmpeg

# show build 
docker run -v $(pwd):/output -it nix-ffmpeg 

# output a testcard 
docker run -v $(pwd):/output -it nix-ffmpeg ffmpeg -f lavfi -i testsrc=size=1920x1080 -t 20 -pix_fmt yuv420p -vf "drawtext=fontfile=/windows/fonts/arial.ttf:text='Testcard':fontcolor=white:fontsize=100" /output/testcard_1080p.mp4

👀 Resources

  • ffmpeg 5 linux install with the nixpkgs package manager video here
  • NapoleonWils0n/cerberus repo here
  • nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix here
  • nixpkgs/pkgs/development/libraries/ffmpeg here