-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotes.txt
More file actions
82 lines (53 loc) · 4.35 KB
/
notes.txt
File metadata and controls
82 lines (53 loc) · 4.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Skratch pad for some notes!
# Convert directory of cr2 files to jpg files
> for i in *.cr2; do sips -s format jpeg $i --out "${i%.*}.jpg"; done; say -v Daniel "Conversion Complete\!"
> for i in *.cr2; do convert "$i" "$i.jpg"; echo "$i"; done; say -v Daniel "Conversion Complete\!"
# Convert series of images to 24fps video file
> ffmpeg -r 24 -f image2 -start_number 1 -i image_%02d.jpg -codec:v prores -profile:v 2 output.mov
converts a sequence [image_xx, … , image_yy] to a movie ‘output.mov’ at frame rate 24
# Convert series of images to 24fps video file, cropping and scaling 5472x3648 source images to a 1920x1080 output
>ffmpeg -r 24 -f image2 -start_number 1 -i image_%03d.jpg -vf crop=5472:3078:0:285,scale=1920:-1 -codec:v prores -profile:v 2 ~/Desktop/1920x1080Test.mov
crop=(sourceWidth):(sourceWidth*9/16):0:(sourceHeight-(sourceWidth*9/16))/2 crops vertical from center to get the correct aspect ratio (16:9)
scale=1920:-1 set output scale, the -1 will match the 1920 to the aspect ration we cropped to
# Convert series of images to 24fps video file, cropping and scaling 6000x4000 source images to a 1920x1080 output
>ffmpeg -r 24 -f image2 -start_number 1 -i image_%03d.jpg -vf crop=6000:3375:0:312,scale=1920:-1 -codec:v prores -profile:v 2 ~/Desktop/1920x1080Test.mov
# adjust datetime of all images in a dirctory with exiftool
>exiftool '-AllDates+=0:0:0 1:0:0' *
# Panning crop left to right on 5496x3670 source images - for instagram story
> ffmpeg -r <framerate> -f image2 -start_number 1 -i image%04d.cr2.jpg -vf crop=<sourceWidth>*9/16:<sourceWidth>:'(<sourceWidth>-(<sourceHeight>*9/16))/(<#frames>/<framerate>))'*t:0,scale=1080:-1 -codec:v prores -profile:v 2 ~/1080x1920_vertical_<framerate>fps.mov
ffmpeg -r 60 -f image2 -start_number 1 -i image%04d.cr2.jpg -vf crop=3670*9/16:3670:'(5496-(3670*9/16))/(1967/60)'*t:0,scale=1080:-1 -codec:v prores -profile:v 2 ~/Desktop/1080x1920_vertical_60fps_LRPan.mov
ffmpeg -r 60 -f image2 -start_number 1 -i image%04d.cr2.jpg -vf crop=ih*9/16:ih:'(iw-(ih*9/16))/(1967/60)'*t:0,scale=1080:-1 -codec:v prores -profile:v 2 ~/Desktop/1080x1920_vertical_60fps_LRPan.mov
ffmpeg -r 60 -f image2 -start_number 1 -i image%04d.cr2.jpg -vf crop=2064:3670:104.7*t:0,scale=1080:-1 -codec:v prores -profile:v 2 ~/Desktop/1080x1920_vertical_60fps_LRPan.mov
# Crop 2k drone footage for IGTV
> ffmpeg -i source_video.MOV -r 30 -vf crop=860:1530 source_story_crop.mp4
# Crop 4k Drone footage down to 1920x1080HD, assumes 4096x2160 source footage
> ffmpeg -i input.mov -vf crop=3840:2160:128:0,scale=1920:-1 -codev:v prores:v 2 output.mov
128 = (4096-3840)/2
# Slow down or speed up video clips
> ffmpeg -i <sourceFile>.<ext> -vf “setpts=(<sourceFPS>/<desiredFPS>*PTS” -r “<outputFileFPS” <outputFile>.<ext>
examples:
Slow down 60fps source to 24fps, creating a 60fps file (this would be a little choppy)
> ffmpeg -i input.mov -vf “setpts=(60/24)*PTS” -r “60” output.mov
Slow down 60fps source to 24fps, creating a 24fps file
> ffmpeg -i input.mov -vf “setpts=(60/24)*PTS” -r “24” output.mov
Speed up 24fps source to 60fps, creating a 60fps file
> ffmpeg -i input.mov -vf “setpts=(24/60)*PTS” -r “60” output.mov
Syncing Audio Speed changes with Video Speed Changes, playback video and audio at half speed
> ffmpeg -i input.mov -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map ["a"] output.mov
*** note the atempo and setpts are inverse each other ***
# Convert MOV to mp4
> ffmpeg -i input.mov -vcodec h264 -acodec aac -strict -2 output.mp4
# Convert mp4 to MOV
> ffmpeg -i input_file.mp4 -acodec copy -vcodec copy -f mov output_file.mov
# Smoothing out video
# First create transform.trf
> ffmpeg -i clip.mp4 -vf vidstabdetect -f null -
# Use the .trf file to create a stabilized video
> ffmpeg -i clip.mp4 -vf vidstabtransform=smoothing=5:input="transforms.trf" clip-stabilized.mp4
# Bonus: create a side by side comparison video
> ffmpeg -i clip.mov -i clip-stabilized.mov -filter_complex "[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w" clips-merged.mp4
# Reverse a Video Clip
> ffmpeg -i sourceVideo.mp4 -vf reverse reversed.mp4
# Reverse a Video and Audio Clip
> ffmpeg -i sourceVideo.mp4 -vf reverse -af areverse reversed.mp4
# EOF