This article introduces how to create natural-looking thumbnail images from 360-degree content (equirectangular format) captured with cameras like Insta360.
The Problem: Simple Resizing Causes Distortion# 360-degree videos and photos are stored in equirectangular (equidistant cylindrical projection) format. This format unfolds a sphere onto a flat surface, and the closer to the top and bottom edges, the more the image is stretched horizontally.
Simply resizing this to create a thumbnail results in a distorted, unnatural image.
# f f S m i p m e p g l e - i r e 3 s 6 i 0 z v e i d ( e r o e . s m u p l 4 t s - s i s n 0 a 0 : d 0 i 0 s : t 0 o 5 r t e v d f r t a h m u e m s b n 1 a i l v ) f " s c a l e = 6 4 0 : - 1 " t h u m b . j p g Solution: Convert to Flat Projection Using the v360 Filter# By using ffmpeg’s v360 filter to convert from equirectangular format to flat (rectilinear/perspective projection) format, you can extract images that look natural as seen by the human eye.
ffmpeg is used. On macOS, it can be installed via Homebrew.
b r e w i n s t a l l f f m p e g
Check that the v360 filter is included:
f # f m O p u e t g p u - t f : i l . t S e C r s v 3 2 6 > 0 / d V e - v > / V n u C l o l n v | e r g t r e 3 p 6 0 v 3 p 6 r 0 o j e c t i o n o f v i d e o .
Basic Commands# Creating Thumbnails from Video# f f m t p v h e f u g m " b - v n i 3 a 6 i 3 0 l 6 = . 0 e j v : p i f g d l e a - o t y . : m h p _ 4 f o - v s = s 1 2 0 0 0 : : v 0 _ 0 f : o 0 v 5 = 9 0 v : f y r a a w m = e 0 s : p 1 i t \ c h = 0 , s c a l e = 6 4 0 : - 1 " \ Creating Thumbnails from Photos# f f m t p v h e f u g m " b - v n i 3 a 6 i 3 0 l 6 = . 0 e j p : p h f g o l t a - o t y . : j h p _ g f o \ v = 1 2 0 : v _ f o v = 9 0 : y a w = 0 : p i t c h = 0 , s c a l e = 6 4 0 : - 1 " \ v360 Filter Parameter Explanation# Parameter Description eInput format: equirectangular flatOutput format: flat (perspective projection) h_fov=120Horizontal field of view (degrees) v_fov=90Vertical field of view (degrees) yaw=0Horizontal rotation (-180 to 180) pitch=0Vertical rotation (-90 to 90)
Adjusting the Field of View# The field of view can be adjusted depending on the use case.
# # # v v v W f S f T f i t e d " a " l " e v n v e v 3 d 3 p 3 a 6 a 6 h 6 n 0 r 0 o 0 g = d = t = l e e o e e : ( : - : f 9 f l f ( l 0 l i l 1 a ° a k a 2 t t e t 0 : x : : ° h h ( h _ 6 _ 6 _ x f 0 f 0 f o ° o ° o 9 v ) v v 0 = = x = ° 1 - 9 6 ) 2 0 4 0 0 N : 5 : - : a v ° v v t _ ) _ S _ u f f h f r o - o o o a v v w v l = C = s = 6 l 4 9 a 0 o 5 a 0 p " s " " p e w e - i a u d r p e a n o a c f r e e a a n a r r o w a r e a Changing the Viewpoint# The direction of the extracted view can be changed using yaw and pitch.
# # # # # v v v v v F f R f R f L f L f r i e o o o " g " a " o " o " n v h v r v k v k v t 3 t 3 3 i 3 i 3 6 6 6 n 6 n 6 ( 0 9 0 0 g 0 g 0 d = 0 = = = = e e e e u e d e f : d : : p : o : a f e f f f w f u l g l l l n l l a r a a a a t t e t t t t ) : e : : : : h s h h h h _ _ _ _ _ f f f f f o o o o o v v v v v = = = = = 1 1 1 1 1 2 2 2 2 2 0 0 0 0 0 : : : : : v v v v v _ _ _ _ _ f f f f f o o o o o v v v v v = = = = = 9 9 9 9 9 0 0 0 0 0 : : : : : y y y y y a a a a a w w w w w = = = = = 0 9 1 0 0 : 0 8 : : p : 0 p p i p : i i t i p t t c t i c c h c t h h = h c = = 0 = h 4 - " 0 = 5 4 " 0 " 5 " " Batch Processing Multiple Files# Script for Video Files# # I O m f d e ! N U k o o c / P T d r n h b U P i e o i T U r f f f e n _ T i f c " / D _ - i l m " h D b I D p n e p v $ o o a R I n e f O n s = R " " a g U " e h " = $ $ m " T C " / " O I e - v P r p / U N = i 3 U e a p T P $ 6 T a t a P U ( " 0 _ t h t U T b $ = D e / h T _ a f e I d t _ D s " : R : t D I e f / o I R n - l $ $ v / R " a s a { { i t " / m s t f f d h * e : i i e u . 0 h l l o m m " 0 _ e e s b p $ : f n n " n 4 f 0 o a a a ; " 0 v m m i : = e e l d . 0 1 } } s o m 5 2 _ _ " p 0 t t 4 : h h ) v v u u f _ m m r f b b a o . . m v j j e = p p s 9 g g 0 " " 1 : y - \ a y w = 0 : p i t c h = 0 , s c a l e = 6 4 0 : - 1 " \ Script for Image Files# # I O m f d e ! N U k o o c / P T d r n h b U P i e o i T U r f f f e n _ T i f c " / D _ - i l m " h D b I D p n e p v $ o o a R I n e f O n s = R " " a g U " e h " = $ $ m " T C " / " O I e - v P r p / U N = i 3 U e a p T P $ 6 T a t a P U ( " 0 _ t h t U T b $ = D e / h T _ a f e I d t _ D s " : R : t D I e f / / o I R n \ l $ $ p / R " a a { { h t " / m t f f o h * e : i i t u . h l l o m j " _ e e s b p $ f n n " n g f o a a a ; " v m m i = e e l d . 1 } } s o j 2 _ _ " p 0 t t g : h h ) v u u _ m m f b b o . . v j j = p p 9 g g 0 " " : y - a y w = 0 : p i t c h = 0 , s c a l e = 6 4 0 : - 1 " \ Creating Thumbnails from 4 Directions# Here is a script for creating thumbnails from 4 directions to get an overview of the entire 360-degree content.
# I O B m # f # f # f # f e ! N U A k f f f f c / P T S d F m " R m " R m " L m " h b U P E i r p v $ i p v $ e p v $ e p v $ o i T U N r o e f O g e f O a e f O f e f O n = T A n g U h g U r g U t g U " / " _ M - t " T t " T " T " T C b $ D E p - v P - v P - v P - v P r a 1 I = i 3 U i 3 U i 3 U i 3 U e s " R $ " 6 T 6 T 6 T 6 T a h = ( $ " 0 _ " 0 _ " 0 _ " 0 _ t " b O $ = D $ = D $ = D $ = D e $ a U I e I I e I I e I I e I d 2 s T N : R N : R N : R N : R " e P P f / P f / P f / P f / t n U U l $ U l $ U l $ U l $ h a T T a { T a { T a { T a { u m _ " t B " t B " t B " t B m e D : A : A : A : A b I - h S - h S - h S - h S n " R s _ E s _ E s _ E s _ E a $ " s f N s f N s f N s f N i I o A o A o A o A l N 0 v M 0 v M 0 v M 0 v M s P 0 = E 0 = E 0 = E 0 = E U : 9 } : 9 } : 9 } : 9 } f T 0 0 _ 0 0 _ 0 0 _ 0 0 _ r " 0 : f 0 : r 0 : b 0 : l o : v r : v i : v a : v e m | 0 _ o 0 _ g 0 _ c 0 _ f 5 f n 5 f h 5 f k 5 f t 4 s o t o t o . o . e v . v . v j v j d d v = j v = j v = p v = p i f 6 p f 6 p f 6 g f 6 g r ' r 0 g r 0 g r 0 " r 0 " e s a : " a : " a : a : c / m y m y m y - m y - t \ e a - e a - e a y e a y i . s w y s w y s w s w o [ = = = = n ^ 1 0 1 9 1 1 1 - s . : 0 8 9 " ] \ p \ : \ 0 \ 0 * i p : : $ t i p p / c t i i / h c t t ' = h c c ) 0 = h h , 0 = = s , 0 0 c s , , a c s s l a c c e l a a = e l l 4 = e e 8 4 = = 0 8 4 4 : 0 8 8 - : 0 0 1 - : : " 1 - - " 1 1 \ " " \ \ \ Usage example:
b r e w i n s t a l l f f m p e g
0
Summary# 360-degree content is stored in equirectangular format, and simple resizing causes distortion By converting to flat (perspective projection) using ffmpeg’s v360 filter, natural thumbnails can be created The field of view can be adjusted with h_fov/v_fov, and the viewpoint direction with yaw/pitch References#