using new ffmpeg to converting a Samsung Note 3 video to SGI format to import into Flame/smoke/effect/Inferno/etc

gijoe77

New member
Feb 18, 2019
9
3
3
So previously when one wanted to import a video that was shot on a current cell phone into a discreet logic program (effect, spark, flint, flame, inferno, smoke, fire), one had to use a x86 computer with a recent version of ffmpeg to make a series of still images from the video, and then transfer those to the sgi and finally load them into a discreet product.

With Onre's recent ffmpeg port its now possible to do the entire process on the sgi!

here is the info regarding grabbing the new port:
it may require you to set LD_LIBRARYN32_PATH as I once again didn't put in rpaths
unpack at root
it'll create /opt/local/ffmpeg
once you get the ffmpeg 4.1.4 installed and get a video you want to play with transferred over, here are some useful commands:

to get info regarding the video:
ffmpeg -i blue_belt.mp4

to resize the video (please not the -qscale 0 perserves the quality of the source video and does not try to compress the output video - this is a key flag):
ffmpeg -i blue_belt.mp4 -s 720x480 -aspect 16:9 -qscale 0 blue_belt_ntsc.mp4

to create the rgb images (with .sgi extention!) that are easily read by the discreet logic software:
mkdir rgb
ffmpeg -i blue_belt_ntsc.mp4 -an -r 30 -pix_fmt rgb24 -vcodec sgi rgb/%06d.sgi


here is what the output looks like

-bash-5.0$ ls -lh blue_belt.mp4
-rw-r--r-- 1 user user 183M Jul 11 20:16 blue_belt.mp4

-bash-5.0$ ffmpeg -i blue_belt.mp4
ffmpeg version 4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.2.0 (GCC)
configuration: --prefix=/opt/local/ffmpeg --extra-cflags='-D_XOPEN_SOURCE=2019' --disable-static --enable-shared --disable-mipsdsp --disable-mipsdspr2 --cpu=mips3
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'blue_belt.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isom3gp4
creation_time : 2014-11-04T22:04:33.000000Z
Duration: 00:01:29.96, start: 0.000000, bitrate: 17083 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 16995 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2014-11-04T22:04:33.000000Z
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2014-11-04T22:04:33.000000Z
handler_name : SoundHandle
At least one output file must be specified
-bash-5.0$ ffmpeg -i blue_belt.mp4 -s 720x480 -aspect 16:9 -qscale 0 blue_belt_ntsc.mp4
ffmpeg version 4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.2.0 (GCC)
configuration: --prefix=/opt/local/ffmpeg --extra-cflags='-D_XOPEN_SOURCE=2019' --disable-static --enable-shared --disable-mipsdsp --disable-mipsdspr2 --cpu=mips3
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'blue_belt.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isom3gp4
creation_time : 2014-11-04T22:04:33.000000Z
Duration: 00:01:29.96, start: 0.000000, bitrate: 17083 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 16995 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2014-11-04T22:04:33.000000Z
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2014-11-04T22:04:33.000000Z
handler_name : SoundHandle
Please use -q:a or -q:v, -qscale is ambiguous
File 'blue_belt_ntsc.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mp4, to 'blue_belt_ntsc.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isom3gp4
encoder : Lavf58.20.100
Stream #0:0(eng): Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 720x480 [SAR 32:27 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 15360 tbn, 30 tbc (default)
Metadata:
creation_time : 2014-11-04T22:04:33.000000Z
handler_name : VideoHandle
encoder : Lavc58.35.100 mpeg4
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2014-11-04T22:04:33.000000Z
handler_name : SoundHandle
encoder : Lavc58.35.100 aac
frame= 2692 fps=0.9 q=0.0 Lsize= 145422kB time=00:01:30.11 bitrate=13219.8kbits/s speed=0.0296x
video:143936kB audio:1408kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.053562%
[aac @ 1015c100] Qavg: 396.287
-bash-5.0$
 
Last edited:
Reactions: Elf

gijoe77

New member
Feb 18, 2019
9
3
3
Please note this can take up a lot of disk space from a short video
-bash-5.0$ ls -lh blue_belt*
-rw-r--r-- 1 user user 183M Jul 11 20:16 blue_belt.mp4
-rw-r--r-- 1 sgidev user 142M Jul 11 22:04 blue_belt_ntsc.mp4
-bash-5.0$ gtar cf rgb.tar rgb/
-bash-5.0$ ls -lh rgb.tar
-rw-r--r-- 1 sgidev user 2.5G Jul 12 03:36 rgb.tar
-bash-5.0$
so a 142MB NTSC .mp4 turns into 2.5GB worth of images.

If I wanted to stay working with HD sized frames, that would mean the 183MB 1080 .mp4 turns into 13GB worth of frames!!

-bash-5.0$ ls -lh blue_belt*
-rw-r--r-- 1 sgidev user 183M Jul 11 20:16 blue_belt.mp4
-rw-r--r-- 1 sgidev user 142M Jul 11 22:04 blue_belt_ntsc.mp4

-bash-5.0$ gtar cf rgb.tar rgb/
-bash-5.0$ ls -lh rgb.tar
-rw-r--r-- 1 sgidev user 2.5G Jul 12 03:36 rgb.tar

-bash-5.0$ mkdir rgbHD
-bash-5.0$ ffmpeg -i blue_belt.mp4 -an -r 30 -pix_fmt rgb24 -vcodec sgi rgbHD/%06d.sgi
ffmpeg version 4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.2.0 (GCC)
configuration: --prefix=/opt/local/ffmpeg --extra-cflags='-D_XOPEN_SOURCE=2019' --disable-static --enable-shared --disable-mipsdsp --disable-mipsdspr2 --cpu=mips3
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'blue_belt.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isom3gp4
creation_time : 2014-11-04T22:04:33.000000Z
Duration: 00:01:29.96, start: 0.000000, bitrate: 17083 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 16995 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2014-11-04T22:04:33.000000Z
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2014-11-04T22:04:33.000000Z
handler_name : SoundHandle
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> sgi (native))
Press [q] to stop, [?] for help
[swscaler @ 102e3af0] No accelerated colorspace conversion found from yuv420p to rgb24.
Output #0, image2, to 'rgbHD/%06d.sgi':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isom3gp4
encoder : Lavf58.20.100
Stream #0:0(eng): Video: sgi, rgb24, 1920x1080, q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
Metadata:
creation_time : 2014-11-04T22:04:33.000000Z
handler_name : VideoHandle
encoder : Lavc58.35.100 sgi
frame= 21 fps=0.5 q=-0.0 size=N/A time=00:00:00.70 bitrate=N/A speed=0.0174x

-bash-5.0$gtar cf rgbHD.tar rgbHD/
-bash-5.0$ ls -lh
total 34027712
-rw-r--r-- 1 sgidev user 183M Jul 12 07:45 blue_belt.mp4
-rw-r--r-- 1 sgidev user 142M Jul 12 07:45 blue_belt_ntsc.mp4
drwxr-xr-x 2 sgidev user 64K Jul 12 07:57 rgb
-rw-r--r-- 1 sgidev user 2.5G Jul 12 09:49 rgb.tar
drwxr-xr-x 2 sgidev user 64K Jul 12 11:28 rgbHD
-rw-r--r-- 1 sgidev user 13G Jul 12 21:13 rgbHD.tar
-bash-5.0$

Here is how you would go about importing these frames into a discreet product (in this example I am using Flame 7 on my o2):
1. once flame is loaded, go to Library -> Import Image and with the white cursor click on a reel
61




2. This should be step one (or step zero), but make sure your framestore is big enough. If you look at the picture above, my framestore only had 1482 Frames available. I dun 'goofed and had to redo my framestore for this demonstration.
Anyway - next the default should be "Sgi" format type with "sgi" file extension (bottom left of the screen) and on the top right you want to type in the path of where all the frames/stills are located. In this example its "/scratch/rgb":
62





3. select which frames you want to load into flame (in this example it's "002692" which contains 2692 frames. This is just how I named the output frames in the ffmpeg command above. You can of course be a bit more clever than me with the naming of the frames. When you select the frames the little right arrow turns green, then click "load":
63




4. Once its done, click "EXIT Import Image" and that's it! You are now ready to play with your content!
64
 
Last edited:

gijoe77

New member
Feb 18, 2019
9
3
3
here is a little cheat sheet I was playing with for other cool things to do with ffmpeg:

this has worked so far:
ffmpeg -i green_belt.mp4 -an -r 30 -pix_fmt rgb24 -vcodec sgi rgb/%06d.sgi


ffmpeg -i blue.mp4

ffmpeg -y -i blue.mp4 -an -r 24 -pix_fmt rgb24 -vcodec tiff tif/%06d.tif

ffmpeg -y -i blue.mp4 -an -r 30 -pix_fmt rgb8 -vcodec tiff tif/%06d.tif

#Getting info from a video file
ffmpeg -i blue.mp4

#Turn x images to a video sequence
ffmpeg -f image2 -i image%d.jpg video.mpg

#turn video into image sequence
ffmpeg -i video.mpg image%d.jpg

#Extracting sound from a video, and save it as Mp3
ffmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3

#Convert a wav file to Mp3

ffmpeg -i original.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 final.mp3

#Convert .avi video to .mpg

ffmpeg -i video_original.avi video_final.mpg

#Convert .mpg to .avi

ffmpeg -i video_original.mpg video_final.avi

#Convert .avi to animated gif(uncompressed)

ffmpeg -i video_original.avi gif_anime.gif

#Mix a video with a sound file

ffmpeg -i son.wav -i video_original.avi video_final.mpg

#Convert .avi to .flv

ffmpeg -i video_original.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv video_final.flv

#Convert .avi to dv

ffmpeg -i video_original.avi -s pal -r pal -aspect 4:3 -ar 48000 -ac 2 video_final.dv

Or:

ffmpeg -i video_original.avi -target pal-dv video_final.dv

#Convert .avi to mpeg for dvd players

ffmpeg -i source_video.avi -target pal-dvd -ps 2000000000 -aspect 16:9 final_video.mpeg

#Compress .avi to divx

ffmpeg -i video_original.avi -s 320x240 -vcodec msmpeg4v2 video_final.avi

#Compress Ogg Theora to Mpeg dvd

ffmpeg -i film_sortie_cinelerra.ogm -s 720x576 -vcodec mpeg2video -acodec mp3 film_terminée.mpg

#Compress .avi to SVCD mpeg2

NTSC format:

ffmpeg -i video_original.avi -target ntsc-svcd video_final.mpg

#Compress .avi to VCD mpeg2

NTSC format:

ffmpeg -i video_original.avi -target ntsc-vcd video_final.mpg

#Multi-pass encoding with ffmpeg

ffmpeg -i fichierentree -pass 2 -passlogfile ffmpeg2pass fichiersortie-2


#One thing I have wondered for some time: With this ffmpeg command, In what color space are the resulting TIFF images?
#Is it determined by the -pix_fmt argument or is it dependant on the source material?

It is determined by -vcodec and -pix_fmt. The call above converts to sRGB (8bpc). See
ffmpeg -pix_fmts

for a list of output formats (which imply target colorspace).
here are two sites with cool tips/tricks