Skip to content

Instantly share code, notes, and snippets.

View ddennedy's full-sized avatar

Dan Dennedy ddennedy

View GitHub Profile
@ddennedy
ddennedy / getgop.sh
Last active March 29, 2018 22:21
display the GOP structure of a video file (requires ffprobe)
#!/bin/sh
startswith() { case $1 in $2*) true;; *) false;; esac; }
tmpfile=$(mktemp)
ffprobe -show_frames "$1" 2> /dev/null > "$tmpfile"
GOP=1
maxGOP=1
Bframes=0
@ddennedy
ddennedy / dash-avc264 command lines
Last active July 27, 2022 03:44
Use ffmpeg and mp4box to prepare DASH-AVC/264 v1.0 VoD
See my DASH-IF presentation from October, 2014:
https://s3.amazonaws.com/misc.meltymedia/dash-if-reveal/index.html#/
1. encode multiple bitrates with keyframe alignment:
ffmpeg -i ~/Movies/5D2_Portrait.MOV -s 1280x720 -c:v libx264 -b:v 1450k -bf 2 \
-g 90 -sc_threshold 0 -c:a aac -strict experimental -b:a 96k -ar 32000 out.mp4
My input was 30 fps = 3000 ms. If it were 29.97, then a GOP size of 90 frames will yield a base segment
size of 3003 milliseconds. You can make the segment size some multiple of this, e.g.: 6006, 9009, 12012.