Skip to content

Instantly share code, notes, and snippets.

@leandromoreira
Created April 22, 2020 15:48
Show Gist options
  • Save leandromoreira/c208689e5d29c8a3c1bc290c44cb0031 to your computer and use it in GitHub Desktop.
Save leandromoreira/c208689e5d29c8a3c1bc290c44cb0031 to your computer and use it in GitHub Desktop.

Revisions

  1. leandromoreira created this gist Apr 22, 2020.
    24 changes: 24 additions & 0 deletions ffmpeg.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    # webm - mp4
    ffmpeg -hide_banner \
    -re -f lavfi -i "testsrc2=size=1280x720:rate=30,format=yuv420p" \
    -f lavfi -i "sine=frequency=220:beep_factor=4:duration=5" \
    -c:v libx264 -preset ultrafast -tune zerolatency -profile:v high \
    -b:v 1400k -bufsize 2800k -x264opts keyint=30:min-keyint=30:scenecut=-1 \
    -c:a aac -b:a 128k \
    -window_size 5 -extra_window_size 10 -remove_at_exit 1 -adaptation_sets "id=0,streams=v id=1,streams=a" \
    -fflags +genpts \
    -movflags isml+frag_keyframe output.mpd

    # webm - vp9
    ffmpeg -hide_banner \
    -re -f lavfi -i "testsrc2=size=384x216:rate=30,format=yuv420p" \
    -f lavfi -i "sine=frequency=220:beep_factor=4:duration=5" \
    -map 0 -c:v libvpx-vp9 -deadline realtime \
    -minrate 400k -maxrate 400k -b:v 400k -keyint_min 30 -g 30 \
    -map 0 -c:v libvpx-vp9 -deadline realtime -s 254x144 \
    -minrate 400k -maxrate 400k -b:v 400k -keyint_min 30 -g 30 \
    -map 1 -c:a libvorbis -b:a 128k \
    -window_size 5 -extra_window_size 10 -remove_at_exit 1 -adaptation_sets "id=0,streams=0,1 id=1,streams=a" \
    -fflags +genpts \
    -movflags isml+frag_keyframe output.mpd