Skip to content

Instantly share code, notes, and snippets.

@tvararu
Last active June 25, 2017 00:27
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 tvararu/a684c7e20a7692716a8c500c34f3ef0d to your computer and use it in GitHub Desktop.
Save tvararu/a684c7e20a7692716a8c500c34f3ef0d to your computer and use it in GitHub Desktop.
file 'ghost-1.mp4'
file 'ghost-2.mp4'
ffprobe -v 0 -of compact=p=0 -select_streams 0 \
-show_entries stream=r_frame_rate ghost.mp4
cat frames.csv | grep -n I | cut -d ':' -f 1 > i-frames.csv
ffmpeg -f concat -safe 0 -i filelist.txt -c copy ghost-concat.mp4
33:04 to 33:53
34:04 to 36:20
ffmpeg -i ghost-old.mp4 -ss "00:33:02.898" -to "00:33:52.905" -c copy ghost-1.mp4
ffmpeg -i ghost-old.mp4 -ss "00:34:03.500" -to "00:36:19.969" -c copy ghost-2.mp4
ffmpeg -i ghost-saver.mp4 -i ghost-audio.mp3 -codec copy -shortest ghost-saver-with-audio.mp4
ffprobe -select_streams v -show_frames \
-show_entries frame=pict_type \
-of csv ghost.mp4
33m04s = 1980 + 4 = 1984 =
= 47568.431568432
47556 = 1983.4815
00:33:03.518
33m53s = 1980 + 53 = 2033 =
= 2033 * (24000 / 1001) =
= 48743.256743257
48741 = 2032.905875
00:33:52.905
34m04s = 2040 + 4 = 2044 =
= 2044 * (24000 / 1001) =
= 49006.993006993
48998 = 2043.624916667
00:34:03.624
36m20s = 2160 + 20 = 2180 =
= 2180 * (24000 / 1001) =
= 52267.732267732
52289 = 2180.887041667
00:36:20.887
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment