Skip to content

Instantly share code, notes, and snippets.

@mche
Created September 11, 2020 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mche/855dc9624f7ea24132f2de1fd01d4b1a to your computer and use it in GitHub Desktop.
Save mche/855dc9624f7ea24132f2de1fd01d4b1a to your computer and use it in GitHub Desktop.
$ ffmpeg -i 'rtsp://192.168.128.10:554/user=admin&password=&channel=1&stream=0.sdp?' -f mpegts -codec:v mpeg1video -b:v 1200k -bf 0 -an -s 1280x720 -segment_time 20 -f segment /tmp/test%05d.ts
ffmpeg -i input.mp4 -c:v libx264 -crf 22 -map 0 -segment_time N -reset_timestamps 1 -g XX -sc_threshold 0 -force_key_frames “expr:gte(t,n_forced*N)” -f segment output%03d.mp4
XX — Number of frames
N — Number of seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment