Creating Animated GIFs and MP4s |
Top Previous Next |
The Multi-Camera Animator utility can be used to automatically create animated GIFs of photos taken by a mutli-camera rig. If provides the following features:
The Multi-Camera Animator can be run by selecting "Run Multi-Camera Animator" from the File menu in Multi-Camera.
Multi-Camera Settings
Select "Setup for Multi-Camera Animator..." from the File menu in Multi-Camera to check the settings and automatically set them to default settings to work with the Multi-Camera Animator. This will set the download folder, the filename prefix and the grid overlay settings. These can also be set manually as described below.
Select File->Preferences in Multi-Camera and select "Sort cameras by Author", set the "Filename prefix:" to {author}_, the "Directory in which to save images" to C:\multi-camera\{comment} and uncheck the Year, Month and Day checkboxes as shown below:
Next, set the author string for each camera to identify its position in the camera array e.g. by setting the author string for the first camera in the array to 001. This can be done using the controls on each camera or by selecting the camera in the "Camera:" dropdown list in Multi-Camera and then selecting Camera->Edit id... The author string can also be set using the camera's controls when it is not connected to a computer. To do this click on the camera's "Menu" button and step through the menus until you find "Copyright information" in one of the tool menus. Select "Copyright information" then select "Enter author's name" to view or edit the author's name. It's a good idea to turn the camera off using the camera's power switch after editing the author's name to ensure that changes are saved properly. Some camera models may lose the changes if they are externally powered and the power is cut instead of turning the camera off using its power switch.
Tip: Set "Suppress image display" in the "View" menu in Multi-Camera to reduce the time it takes to download the photos from the cameras
The default place to save the photos downloaded from the cameras is C:\Multi-Camera\{comment} The Multi-Camera animator will set the comment field to the current date in the form YYYYMMDD followed by a sequence number e.g. 20170620_001 for June 20, 2017. It is also possible to save the photos in date based folders to make it easier to keep all the photos from an event together. This can be done using the {year}, {month} and {day} tokens e.g. C:\Multi-Camera\{year}-{month}-{day}\{comment}
If the event is likely to continue after midnight use the {yearLess8h}, {monthLess8h} and {dayLess8h} tokens instead e.g. C:\Multi-Camera\{yearLess8h}-{monthLess8h}-{dayLess8h}\{commentLess8h}
The {yearLess8h}, {monthLess8h} and {dayLess8h} use the current time less 8 hours when generating the date e.g. if an event starts at 9pm on June 20, 2017 the {day} token will give 20 before midnight and 21 after midnight but the {dayLess8h} token will give 20 after midnight (up until 8am the next morning).
Multi-Camera Animator Setup
Run the Multi-Camera Animator utility by selecting "Run Multi-Camera Animator" from the File menu in Multi-Camera and then click on "Settings..." button to set it up:
Set the "Number of cameras:" to the number of cameras in the array.
Set the "Image rotation:" dropdown list to the camera orientation. If the cameras are in normal landscape orientation this should be set to "none".
Select "Link to Multi-Camera" if you want the Multi-Camera Animator to automatically update the download folder in Multi-Camera after each set of photos has been downloaded. If two copies of the Multi-Camera are running (e.g. one copy to create small animated GIFs and one copy to create larger MP4 files) only one copy should have "Link to Multi-Camera" enabled.
Select "Only process filenames ending in 1" to provide protection against cameras being triggered twice in quick succession which results in additional images being downloaded to the current folder and can cause strange out of sequence GIFs and MP4s. When this setting is selected only the first image downloaded from each camera (with a filename ending in 1) will be processed.
The "Save calibration settings with photos" setting will save a copy of the current calibration settings in the folder with the photos downloaded from the camera when creating the animated GIF. This is useful if you need to recreate the animated GIFs at a later date. The calibration settings file is named using the date and time in the form YYYYMMDD_hhmmss_calibration.xml and can be loaded into the calibration settings screen (which is displayed when you click on the "Calibrate..." button). The calibration settings XML file also includes the filenames of the downloaded photos and the GIF or MP4 files. Select "Run command" and click on the "Command..." button to run a command after saving the calibration settings XML file. This is useful if you need to automate the work flow e.g. by copying the GIF file to a folder where it can be shared.
Select "Startup in 'run' mode" to select run mode automatically when the Multi-Camera Animator is launched.
Select the "Save GIFs/MP4s with UID filenames" option to use hard to guess filenames when saving GIFs and MP4s. This improves privacy when sharing files on a microsite because users won't be able to guess the filenames of other guests' images. When this option is selected the filenames will consist of 5 letters followed by 3 digits e.g. ABCDEF123.GIF. The filename is generated from the computer name and download folder and should be unique when using multiple systems provided the computers have different names.
Select the "Startup in 'Run' mode" option if you want the Multi-Camera Animator to start up in run mode when it is launched.
Set the "Folder to monitor:" to the monitor the same folder as the "Download directory in which to save images:" set up in Multi-Camera but without the {comment} token. e.g. If Multi-Camera is set to C:\Multi-Camera\{comment} set the folder in the Multi-Camera Animator to C:\Multi-Camera If Multi-Camera is set to C:\Multi-Camera\{year}-{month}-{day}\{comment} set the folder in the Multi-Camera Animator to C:\Multi-Camera\{year}-{month}-{day}
Next set the "GIF and MP4 output folder" to where you want the GIFs and MP4s to be saved. Then click on the "Animated GIF and MP4 Settings..." button to specify how the animated GIFs and/or MP4 movies should be created:
The "Photo width (pixels):" setting specifies the width of each photo to be added to the animated GIF (after stabilizing and cropping).
Set the "Frame width" and "Frame height" to the required size if the animated GIF or MP4 is a different size to the individual photos. Use the "Photo left offset" and "Photo right offset" setting to specify where the photo should be placed within the frame. The offsets are specified in pixels.
The "Frames per photo" setting controls how many animation frames are displayed for each photo. This provides a way to display an overlay animation that has a higher frame rate than photo animation e.g. if "frames per photo" is set to 2 for a boomerang sequence from 5 cameras the animation frames would be: Frame 1: photo from camera 1 + frame_overlay_1.png Frame 2: photo from camera 1 + frame_overlay_2.png Frame 3: photo from camera 2 + frame_overlay_3.png Frame 4: photo from camera 2 + frame_overlay_4.png Frame 5: photo from camera 3 + frame_overlay_5.png Frame 6: photo from camera 3 + frame_overlay_6.png Frame 7: photo from camera 4 + frame_overlay_7.png Frame 8: photo from camera 4 + frame_overlay_8.png Frame 9: photo from camera 5 + frame_overlay_9.png Frame 10: photo from camera 5 + frame_overlay_10.png Frame 11: photo from camera 4 + frame_overlay_11.png Frame 12: photo from camera 4 + frame_overlay_12.png Frame 13: photo from camera 3 + frame_overlay_13.png Frame 14: photo from camera 3 + frame_overlay_14.png Frame 15: photo from camera 2 + frame_overlay_15.png Frame 16: photo from camera 2 + frame_overlay_16.png Frame 17: photo from camera 1 + frame_overlay_17.png Frame 18: photo from camera 1 + frame_overlay_18.png
Use the "Number of times to display seq" to add multiple copies of the photo sequence to the animation when using title pages. For example if there is a title page and 5 photos the sequence will be title, 1, 2, 3, 4, 5 when this is set to 1 and title, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5 when it is set to 2. This setting is ignored if no title pages are defined. The default setting is 1.
Specify how long each frame should be displayed using the "Image interval (1/100 sec)" setting and how long each title page should be displayed using the "Title display time (1/100 sec)" setting.
Normally title pages are added to the end of the sequence so that when animated GIFs are viewed in a browser or kiosk (e.g. Breeze Kiosk) the first photo in the sequence is displayed not the title page (which would be the same for all the animated GIFs being viewed). Uncheck "Display title at end of animation" to display the title pages at the start.
Select the "Ping-pong forwards/backwards display" option to add the photos in reverse order to the animation. This setting is useful if the camera array doesn't form a full circle and will display an animation that plays the photos forwards then backwards in a loop instead of jumping back to the start each time. e.g. the photos from a 5 camera rig will be displayed in the order 1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3... when this option is selected or as 1, 2, 3, 4, 5, 1, 2, 3... when it is not selected.
Overlays can be added to the photos by placing PNG overlay files in the overlays and titles folder. A single overlay can be used for all the photos by placing a PNG image named photo_overlay.png in the folder. Different overlays for each photo can be added by naming the PNG images photo_overlay_1.png, photo_overlay_2.png, photo_overlay_3.png etc. The PNG overlay files should be created with transparency information in the alpha channel. If the overlays are wider than the resized photos they are resized to the same width. If the overlay is smaller than the photo its placement is bottom right justified. This means a small logo can be placed in the bottom right corner of each photo simply by creating a small PNG image and naming it photo_overlay.png.
Titles can be added to the animated GIF by placing one or more JPEG title images in the overlays and titles folder. A single title image can be added by placing a JPEG image named title.jpg in the folder. A sequence of title images can be added by naming them title_1.jpg, title_2.jpg, title_3.jpg etc. If the title images are wider than the animated GIF they are resized to the same width and then placed centered in a frame with a white background.
An optional soundtrack can be added to the MP4 copy of the animated GIF by placing a MP3 file named soundtrack.mp3 or a WAV file named soundtrack.wav in the overlays and titles folder. Please note that animated GIFs do not support sound and so the soundtrack will only be added to the MP4 video.
After creating the frames for the animation (including the reverse display if "ping-pong" is selected) an optional overlay can be added to each frame by placing PNG overlay files in the overlays and titles folder. A single overlay can be used for all the frames by placing a PNG image named frame_overlay.png in the folder. Different overlays for each frame can be added by naming the PNG images frame_overlay_1.png, frame_overlay_2.png, frame_overlay_3_png etc. The PNG overlay files should be created with transparency information in the alpha channel. If the overlays are wider than the GIF width they are resized to the same width.
Select "Create GIF" to create an animated GIF of the sequence and/or "Create MP4" to create an MP4 movie of the sequence. Set the minimum duration of the movie in secs or set this to 0 to make the movie as short as possible. This option is useful if the movie file is to be uploaded to a site which has a minimum length requirement (e.g. videos posted to Instagram must be at least 3 seconds long). If the movie file will be shorter than the minimum length the GIF frames, but not the title frames, will be repeated until the movie is long enough.
The Multi-Camera Animator can either use the Microsoft MediaWriter libraries or the open source ffmpeg command line tools (https://ffmpeg.org/) to create MP4 files. Advanced users can edit the settings used to create MP4 files by clicking on the "Advanced settings..." button:
Using MediaWriter to create MP4 videos The Microsoft MediaWriter libraries are much faster than the ffmpeg option but don't offer as many configuration options. The "Video bit rate" setting affects the quality of the video, the size of the MP4 file and the speed of processing. Increasing this setting will increase the quality of the video output. MP4 videos created using the MediaWriter libraries must have a width which is a multiple of 4 and a height which is an even number. If the width is not a multiple of 4 the video will be automatically trimmed by removing pixels from the left and right to make the width a multiple of 4. If the height is not an even number the bottom row of pixels will be discarded.
The default setting is to use the MediaWriter libraries to create MP4 files with the video bit rate set to 2000000.
Using ffmpeg to create MP4 videos Unselect "Use MediaWriter to create MP4s" to use the ffmpeg command line tools to create MP4 videos. This is the method used to create MP4 videos in older releases of the Multi-Camera Animator and offers more options for controlling the quality of the output. MP4 videos created using the ffmpeg option must have a width and a height which are even numbers. If the width is not an event number the right most pixel on each row will be discarded. If the height is not an even number the bottom row of pixels will be discarded.
Click on the "Very slow", "Slow", "Fast", "Very fast (default)" or "Ultra fast" buttons to select different presets for ffmpeg. The "Very fast" and "Ultra fast" options are considerably faster than the slow options but may result in a small reduction in quality or larger file sizes. Please experiment with different settings to find the one that gives the best balance between speed, quality and file size for your application.
Select the "Create PNG copies of stabilized photos" if you want to use another application such as Adobe After Effects to post process the photos. This will save a copy of each frame after it has been stabilized, chromakeyed (if selected) and cropped. The PNG images will be the same size as the original photos. Each PNG copy of the stabilized photos will be saved in the same folder as the JPEG images downloaded from the cameras and will have the same filenames but with a PNG file extension.
Select the "Create PNG copies of each frame" if you want to be able to use a script or other application to post process the frames (e.g. to create a MP4 movie of the sequence). This option differs from the "Create PNG copies of stabilized photos" option because it is a copy of the frame that is added to the GIF and may display the photo within a larger image and have an optional frame_overlay.png added. Also, if the "ping-pong" option is enabled in the animated GIF settings frames will be saved for the reverse display.
Select the copy photo from middle camera to save a stabilized (and optionally chromakeyed) copy of the the photo from the middle camera in a separate folder. The photo is saved as a JPEG using the current folder name e.g. if the photos are downloaded into the folder C:\Multi-camera\20160801_001 the photo will be named 20160801_001.jpg. This option is useful if you want to be able to give users a print. Our Hotfolder Prints software can be used to automatically format and print the photo and include additional information such as branding or a QR code linking to a website where the animated GIF can be viewed.
Select the "Create anaglyph stereo photo from middle cameras" to create a stereo image which can be viewed using red/cyan glasses to give a 3D effect. The photo is saved as a JPEG using the current folder name followed by _anaglyphe.g. if the photos are downloaded into the folder C:\Multi-camera\20160801_001 the anaglyph stereo photo will be named 20160801_001_anaglyph.jpg. For best results the cameras should be spaced approximately the same distance apart as your eyes (approximately 65mm to 70mm). It is still possible to get a good 3D effect with the cameras considerably wider apart than an average person's eyes, but if they are too far apart it will be difficult to view the photos in 3D stereo.
The settings can be saved to file by clicking on the "Save..." button. The saved settings can be loaded by clicking on the "Load..." button or by dragging and dropping the settings file on the main Multi-Camera Animator window or by adding the path of the settings file to the command line used to run the Multi-Camera animator.
Animated GIFs can only display 256 different colors per frame which causes a problem when trying to display photos which typically have many more colors. There are two ways to handle this limitation: 1) Dithered color where the color of each pixel is represented by several pixels 2) Indexed color where the 256 most common colors in the photo are used
Dithered images can give a better representation of the colors in the original photo but will provide less detail for a given image size. Indexed colors give better detail and usually give adequate colors but may show some contouring or shimmering with some photos, particularly if there are areas of graduated color in the original photo.
Indexed color is recommended for most applications for animated GIFs and so the "Dither GIFs to give better color" option should normally be left unchecked. This setting does not affect the colors in MP4 movie files.
Chromakeying (aka green screen)
Select the "Chromakey photos" option and select the folder where backgrounds and optional overlay images are stored. There needs to be a background image for the photos from each camera and these should be named chromakey_background_1.jpg, chromakey_background_2.jpg, chromakey_background_3.jpg etc. Optional overlays can be added to the images from each camera by naming them chromakey_overlay_1.png, chromakey_overlay_2.png, chromakey_overlay_3.png etc. Take a test set of photos and then click on the "Chromakey settings..." button to adjust the settings. This will open a window with controls for adjusting the chromakeying and previews from each camera showing the effect.
Start by setting the "Hue variation" slider to a low value such as 5 and the "Saturation threshold" to 15. Then move the "Hue" slider until the maximum amount of background is replaced by the chromakey_background JPEG images. Then adjust the "Hue variation" until the all the background is replaced in each photo. If the photos are very noisy (e.g. because they were shot with a high ISO setting) there may be colored speckles in the background. This can be reduced by increasing the "Saturation threshold" setting.
Calibration Photos
Place a vertical pole or a pole with a plumb line at the center of the circle in front of the camera array. Mark the mid point of the pole or plumb line with tape or some other reference marker to provide a target for aligning and focusing the cameras. Add a second marker near the bottom of the pole to provide a reference for scaling the photos.
Align and focus each camera in turn by selecting the camera from the "Camera:" dropdown list and selecting live view. Right click on the live view display and select "Grid settings": Set the number of horizontal and vertical divisions to 2 and enable the grid display so that a crosshair is displayed in live view. Select "Display area for print size" and set the print aspect ratio to 27 x 16. This two horizontal lines on the live view: one near the top of the frame and one near the bottom. Move the bottom marker on the pole or plumb line so that it lines up where the bottom line crosses the center line of the crosshair. This will provide a useful reference point when adjusting the zoom setting when stabilizing the images:
Live view display with crosshair and crop overlay to aid alignment
Click the "Next Camera" or "Previous Camera" buttons to select the middle camera of the array. If the cameras have zoom lenses make sure they are all set to the same zoom setting (normally this is the widest setting when using a standard 18-55mm kit lens). Align the camera so that the center of the cross hair is over the middle reference on the pole or plumb line. Also adjust the camera so that the vertical line of the cross hair lines up with the vertical pole or plumb line reference. Adjust the position of the lower reference marker so that it lines up with the lower crosshair. Set the camera to manual focus, zoom the live view and adjust the focus by turning the focus ring on the camera lens.
Don't worry about getting perfect camera alignment as small errors can be compensated for in Multi-Camera Animator. Take care to focus the camera accurately as this will affect the quality of the final results. Repeat the above procedure for all the cameras in the array.
Click on the "Calibration folder" button in the Multi-Camera Animator main window to setup Multi-Camera to save the calibration photos in a new folder. This will set the "Comment:" field in Multi-Camera's main window to "Calibration" followed by the date and a sequence number e.g. Calibrate_170613_1 for calibration photos taken on June 13, 2017. Then trigger the cameras to take a set of test shots.If the photos need to be re-taken (e.g. because the exposure settings were wrong) press the "Calibration folder" button in the Multi-Camera Animator to create a new calibration folder e.g. Calibrate_170613_2
Cameras in portrait orientation Select "Portrait (90 degrees CW)" or "Portrait (90 degrees CCW)" from the View menu in the main Multi-Camera window if the cameras are in portrait orientation. This will display them with the correct orientation when taking tests photos and when using live view. Set the grid aspect ratio to 27 x 17 when the cameras are mounted in portrait orientation.
Software Alignment
The Multi-Camera Animator offers both automatic and manual alignment options. It is worth trying both methods to see which works best for you. Our current favorite method is manual alignment.
1) Manual Camera Alignment
Run the Multi-camera Animator, click on the "Calibrate..." and select the folder containing the calibration photos (by default it will use the last folder created by clicking on the "Calibration folder" button):
The top left corner lists the cameras with a preview of the stabilized photo from the currently selected camera shown below. The right hand side of the window shows top, middle and bottom portions of the photo together with cross hairs for aligning them. The suggested alignment procedure is as follows:
Use the cursor up/down keys or press the "Play" button to step through the cameras to check the alignment. The image in the bottom left corner of the display shows the photo from the currently selected photo.
The photos can also be zoomed in or out to compensate for differences in the camera lenses or minor errors in the zoom setting. To do this you need to make sure the calibration photos have a suitable reference point which is close to the cross hair in the top or bottom previews. If necessary, move the reference marker and re-take the calibration photos. Then right click the mouse to rotate and scale the image to line up with the bottom cross hairs e.g. right click on the center of the target in the screenshot above. The scaling can be fine tuned by holding down the Ctrl key and pressing cursor up or cursor down keys.
Check the alignment by pressing the "Play" button and fine tune the settings if required.
2) Auto Camera Alignment
The cameras can be automatically aligned if the calibration photos are taken with bright lights or high contrast markers placed at the center and lower reference points. For best results use bright LED lights and adjust the camera exposure settings so that the calibration photos are dark except for the reference lights. To do this turn off the studio strobes and reduce the ambient lighting if possible and then set the camera ISO to 100, the aperture to f/5.6 and the shutter speed to 1/250 sec. Take a test photo by clicking on the "Preview" button in Multi-Camera. If the background in the test shot is bright try selecting a faster shutter speed and taking another test shot. If the reference lights are not visible try selecting a slower shutter speed and taking another test shot. Tip: It is better to use a wide aperture as this will give better results for auto alignment. Using a very small aperture (e.g. f/22) may result in star bursts from the point light sources which will make auto alignment more difficult. Ideally the test photo should have a dark background with the reference lights visible as white spots in the center and bottom of the photo similar to the calibration photo below:
When the exposure is set correctly take a set of calibration photos by clicking on the "Release" button or by triggering the cameras using the camera trigger system.
Run the Multi-camera Animator, click on the "Calibrate..." and select the folder containing the calibration photos (by default it will use the last folder created by clicking on the "Calibration folder" button). The press the "Auto align" button to align the photos. If auto alignment succeeds it will display a message saying "All images successfully aligned. Press the "Play" button to cycle through the images to check the alignment using the photo in the bottom left corner of the window. If the auto alignment fails click on the "..." button to the right of the "Auto align" button to adjust the settings:
The size of the target area setting defines the size of the area that is scanned. This setting only needs to be changed if the cameras are poorly aligned when the calibration photos were taken. Setting the area to "Large" may cause auto alignment to run slower and increase the likelihood of detecting unwanted areas.
The intensity threshold sets the brightness level used to detect the reference areas. If bright LEDs are used for the reference lights this setting can be increased. Try setting it to 0.9 or 0.95 to improve the accuracy of the auto alignment. If high contrast markers (e.g. small white circular pieces of paper) are used it may be necessary to reduce the intensity threshold to allow less bright pixels in the reference areas to be detected.
The saturation threshold controls the range of saturations used to detect the reference areas. If bright white LEDs are used the target areas should be highly saturated and the saturation threshold can be reduced. If high contrast markers (e.g. small white circular pieces of paper) are used it may be necessary to increase the saturation threshold to allow pixels that aren't pure white to be detected.
The auto alignment process detects clusters of pixels within the target area. If the background is too bright the auto alignment process may detect a large number of clusters and could take a long time to run. The "Maximum cluster count" sets the maximum number of clusters allowable before the auto alignment process is abandoned. It isn't normally necessary to change this setting.
The smallest allowable cluster size setting controls how big a cluster of pixels needs to be to be detected by the auto alignment process. This setting can be increased to reduce the number of spurious areas that are detected when there is a bright background.
Type Shift+Ctrl+1 to turn on the debugging display. This will show the target areas as white rectangles and the detected clusters as colored areas. Ideally the reference lights should appear as a single cluster of pixels in the same color. If this is not the case try clicking on the "..." button and adjusting the intensity and saturation thresholds. The debugging display can be turned off by typing Shift+Ctrl+1 again.
If auto alignment doesn't give perfect alignment the alignment it can be fine tuned using the manual alignment settings described in the "Manual camera alignment" section above.
Cameras in portrait orientation Set "Image rotation:" in the Multi-Camera Animator's setting to 90 degrees or 270 degrees if the cameras are mounted in portrait orientation.
Cropping
If the alignment has been adjusted the margins of the previews displayed in the bottom left corner of the calibration screen may show yellow borders to indicate areas outside the frame captured by the camera. Select "Crop images" to crop the frames to remove the borders. Adjust the "Sides" setting to crop equal amounts from the left and right of each frame: vertical yellow dashed lines either side of the image will show the cropped area. Use the "Top" and "Bottom" settings to crop portions from the top or bottom of the frames. When the "Play" button is pressed the sequence will be displayed with the cropped areas masked off in black. The crop settings can also be used to crop unwanted portions from the photos.
Creating Animated GIFs and MP4 files
When the cameras are correctly aligned click on the "Save..." button to save the calibration settings to file for future reference.
Then click on the "Run..." button. The Multi-Camera Animator will automatically set the "Comment:" field in Multi-Camera to the date followed by a three digit sequence number e.g. 20160630_001. This is where the next set of photos taken by the camera array will be stored. When the photos are taken the Multi-Camera Animator will create an animated GIF of the photos using the calibration settings set up earlier and will automatically increment the sequence number in the "Comment:" field ready for the next set of photos.
How it Works
When a set of photos are taken Multi-Camera automatically downloads the photos from each camera into the current folder and names them according to which camera took each photo: 01_01.JPG, 02_01.JPG, 03_01.JPG etc. Multi-Camera Animator monitors the download folder and when it detects the photos it updates the comments field in Multi-Camera so that the next set of photos are saved into a new folder. The folders are named sequentially using the date in the form YYYYMMDD e.g. 20160801_001, 20160801_002, 20160801_003 etc.
Multi-Camera Animator processes the images as follows:
|