This is an old revision of the document!
FFmpeg is a free software project that produces libraries and programs for handling multimedia data. FFmpeg is developed mostly on Linux, but can be compiled under most operating systems, including Mac OS X, Microsoft Windows, Android, iOS, as well as AmigaOS and MorphOS. Most computing platforms and microprocessor instruction set architectures are also supported, like x86 (IA-32 and x86-64), PPC (PowerPC), ARM, DEC Alpha, SPARC, and MIPS.[8]
ffmpeg -help
U ovim primjerima koristimo dvije identične kamere. Zbog načina na koji Windows/FFmpeg pristupa kamerama kod djeluje pomalo zastrašujuće. Upute za capturing na drugim operativnim sustavima nalaze se ovdje: https://trac.ffmpeg.org/wiki/Capture/Webcam.
Example to list dshow input devices:
ffmpeg -list_devices true -f dshow -i dummy
Example to print a list of options from a selected device:
ffmpeg -f dshow -list_options true -i video="Icatch(X) KV Series Null Device"
Preview obiju komara (za kalibraciju). Dva cam ulaza i overlay (checkerboard) za provjeru prekpapanja.
ffmpeg -y -f dshow -video_size 640x480 -framerate 30 -pixel_format yuyv422 -video_device_number 0 -i video="Icatch(X) KV Series Null Device" -f dshow -video_size 640x480 -framerate 30 -pixel_format yuyv422 -video_device_number 1 -i video="Icatch(X) KV Series Null Device" -filter_complex blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)' -vcodec rawvideo -pix_fmt yuyv422 -f sdl "SDL output"
Paralelno spremanje dvaju video inputa u dva file-a. Svakako prije treba utvrditi koja je desna, a koja lijeva kamera.
ffmpeg -y -f dshow -video_size 640x480 -framerate 30 -pixel_format yuyv422 -video_device_number 0 -i video="Icatch(X) KV Series Null Device" LEFT.mp4 | ffmpeg -y -f dshow -video_size 640x480 -framerate 30 -pixel_format yuyv422 -video_device_number 1 -i video="Icatch(X) KV Series Null Device" RIGHT.mp4
direktan stream, bez rekompresije (veća rezolucija i bez lag-a)
ffmpeg -y -f dshow -video_size 1280x720 -framerate 30 -vcodec mjpeg -video_device_number 0 -i video="Icatch(X) KV Series Null Device" -vcodec copy RIGHT.mp4 | ffmpeg -y -f dshow -video_size 1280x720 -framerate 30 -vcodec mjpeg -video_device_number 1 -i video="Icatch(X) KV Series Null Device" -vcodec copy LEFT.mp4
Konvertiranje left i right videa u SBS video (framepacking)
ffmpeg -i LEFT.mp4 -i RIGHT.mp4 -filter_complex framepack=sbs OUTPUT.mp4
Framepacking možda neće raditi sa falovima snimljenim s direktnim streamom, pa treba prije rekomprimirati forsirajući framerate.
ffmpeg.exe -i LEFT.mp4 -r 30 -vcodec libx264 -preset ultrafast -qp 0 LEFT_2.mp4 ffmpeg.exe -i RIGHT.mp4 -r 30 -vcodec libx264 -preset ultrafast -qp 0 RIGHT_2.mp4
Konvertanje SBS (full res) u anaglyph red/cyan
ffmpeg -i OUTPUT.mp4 -vf stereo3d=sbsl:arcd OUTPUT_ANAGLYPH.mp4
stereo SBS image capture from cams
ffmpeg.exe -y -f dshow -video_size 1600x1200 -vcodec mjpeg -video_device_number 0 -i video="Icatch(X) KV Series Null Device" -f dshow -video_size 1600x1200 -vcodec mjpeg -video_device_number 1 -i video="Icatch(X) KV Series Null Device" -filter_complex framepack=sbs -vframes 1 STEREO_SBS.jpeg
stereo SBS image to ANAGLYPH image
ffmpeg -i STEREO_SBS.jpeg -vf stereo3d=sbsl:arcd -vframes 1 STEREO_ANAGLYPH.jpeg