Using MPEG-4 Files with SOS
Playing MPEG-4 (mp4) files is a recent addition to the SOS system, and is pretty limited at present. Not all mp4 files will play on our system, but we have had good luck creating ours with either ffmpeg on Linux or QuickTime Pro on the Mac. If you have an mp4 from another source, you might try converting it with QuickTime Pro, using output settings similar to those below. Here’s a couple examples of the settings we have successfully used to create a playable mp4 from a directory of cylindrical image files.
Creation Using QuickTime ProPermalink to Creation Using QuickTime Pro
We have QuickTime Pro only on the Mac at present. We have no experience using it on a Windows platform, but I would expect the output files to be compatible. Here’s the procedure we use on the Mac.
- From the File menu, select item Open Image Sequence…
- From the resulting Open dialog box:
- Navigate to the input file directory
- Select the first file in the directory
- Wait while the files load. This may take a while
- When prompted, select frame rate of 30 frames per second.
- From the File menu, select item Export…
- From the resulting Save exported file as… dialog
- Navigate to target directory and specify file name
- Make sure the file extension is mp4
- From Export: menu, pick Movie to MPEG-4
- Click Options…
- From the resulting MPEG-4 Export Settings dialog
box: select Video Tab and set:
- Video Format: MPEG-4 Improved
- Data Rate: 25000 kbits/sec
- Optimized for: Download
- Image Size: Custom
- w: 2048 x h: 1024
- Frame Rate: 30
- Key Frame: Every 24
- Click OK
- Click Save
Creation using ffmpegPermalink to Creation using ffmpeg
ffmpeg is an open source, command line driven program. This example assumes the input image files are in a directory (folder) named indir and the files within are named file0001.jpg, file0002.jpg, etc.
ffmpeg -framerate 30 -i indir/file%4d.jpg -b:v 25M -c:v libxvid -pix_fmt yuv420p outfile.mp4
FlagsPermalink to Flags
- -framerate 30
- the framerate to assign the incoming files
- -b:v 25M
- constant bitrate of 25Mbit/s
- -c:v libxvid
- the codec to use. If libxvid is not available on your computer, change this value to mpeg4. Both codecs produce compatible files, but libxvid can produce slightly better results
- -pix_fmt yuv420p
- the pixel format, which can assist some playback software
For more help with ffmpeg, see the ffmpeg documentation.
Playing an MPEG-4 File on SOSPermalink to Playing an MPEG-4 File on SOS
The mp4 files must be stored somewhere in the /shared/sos/media directory tree, so they are accessible from the server on all the projector hosts. The mp4 file names must end with extension .mp4 currently. They can be played directly from the SOS user interface program sos_stream_gui without a playlist, by selecting Open MPEG-4 File… from the File menu, then navigating to and selecting the file you wish to play.
To play an mp4 from a playlist, just add it as a clip, with the
datadir parameter being
the mp4 file itself.
Here again, the filename must be stored somewhere in /shared, and has to end with the .mp4 extension.
There is a GUI script can be run with Linux to make a mp4 movie.