FAQ for home exam 2

Extracting from a video

To extract several seconds from a video using ffmpeg:
ffmpeg -ss 00:00:10 -to 00:00:22 -vc copy -i input.mp4 output.mp4

This creates a file output.mp4 containing 12 seconds from input.mp4 starting at second 10. It is also possible to use -t and specify the duration of the extracted video clip.

Adding required 360 metadata to a video

After processing with ffmpeg, output.mp4 will have lost some metadata that is needed to tell vlc and other players that this is a 360 video in equirectangular format. To add it, you must have python installed and download a helpful tool (once), like this

git clone https://github.com/Vargol/spatial-media.git

After that, you can use spatial-media/spatialmedia to add the required information. You add it to output.mp4 like this:

python3 spatial-media/spatialmedia/ -i -s none -m equirectangular output.mp4 final.mp4

This last command write metadata that tells you player that this is a not a stereoscopic video, but just a normal one, but that it uses the equirectangular projection for a 360 degree video. This is required because there are a lot of different shapes that a 360 video can have, such as cubemap and equi-angular cubemap.