Skip to content

Commit ffd0006

Browse files
committed
Much closer, but not identical 360 camera generation
Best that can be done for now Thanks @morrislee Closes Better 360 Videos #50
1 parent 5eb3199 commit ffd0006

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

ffmpeg_clip.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414
1515
ffmpeg -i clip.ecam.clipped.mp4 -i clip.dcam.clipped.mp4 -filter_complex "[0:v][1:v]hstack=inputs=2[v];[v]v360=dfisheye:equirect:ih_fov=185:iv_fov=185[vout]" -map "[vout]" -c:v libx265 clip.equirect.mp4
1616
17+
Note that the above is not a complete command, it's missing some pre-processing of the driver camera file that comma does and has not been disclosed. More reverse engineering was done to figure out a command that's much closer but not quite identical.
18+
19+
Discovered:
20+
21+
* Driver camera might be shifted down and padded with a dark red color
22+
* Forward camera is initial view
23+
24+
Unresolved Differences:
25+
26+
* The curving is a bit different in the padded and final result. The padded result is a bit more curved somehow.
27+
* Is it possible there's lens correction going on in the driver camera? This would explain the difference in curving.
28+
1729
"""
1830

1931
import argparse
@@ -141,19 +153,19 @@ def make_ffmpeg_clip(
141153
"-r",
142154
"20",
143155
"-i",
144-
wide_concat_string,
156+
driver_concat_string,
145157
"-probesize",
146158
"100M",
147159
"-r",
148160
"20",
149161
"-i",
150-
driver_concat_string,
162+
wide_concat_string,
151163
"-t",
152164
str(length_seconds),
153165
"-ss",
154166
str(start_seconds_relative),
155167
"-filter_complex",
156-
f"[0:v][1:v]hstack=inputs=2[v];[v]v360=dfisheye:equirect:ih_fov=195:iv_fov=122[vout]",
168+
f"[0:v]pad=iw:ih+290:0:290:color=#160000,crop=iw:1208[driver];[driver][1:v]hstack=inputs=2[v];[v]v360=dfisheye:equirect:ih_fov=195:iv_fov=122[vout]",
157169
"-map",
158170
"[vout]",
159171
]
@@ -183,6 +195,9 @@ def make_ffmpeg_clip(
183195
process.kill()
184196
raise
185197

198+
# Debug return to not do the spherical projection
199+
# return
200+
186201
# Add spherical projection to the output
187202
# Move the old output to a temp file
188203
# Print type(output)

0 commit comments

Comments
 (0)