Aegwyn11
15th April 2014, 16:43
Hi all, I'm trying to use ScriptClip to read a series of SGI files directly into AVISynth and having some issues.
SGI files have the image information stored as "channels" after a 512 byte file header. This is a little different than normal, as instead of having the R, then G, then B value for each pixel, you have the whole frame for R, then the whole frame for G, then the whole frame for B. In this example, the SGI files are 3840x2160 with 16bpc, so the offsets are R=512, B=16589312, and G=33178112.
Reading each "channel" in is simple enough (three instances of ScriptClip/Sashimi, with the increasing filehead offsets for the G and B channels). I can then use MergeRGB to get a regular RGB video.
These SGI files can be downloaded from:ftp://vqeg.its.bldrdoc.gov/HDTV/SVT_MultiFormat/2160p50_CgrLevels_Master_SVTdec05_/1_CrowdRun_2160p50_CgrLevels_MASTER_SVTdec05_
My problem is that this only works on the first frame. For each frame after that, the channels converge on the B channel for some reason. If I start with just the line to read in the R channel:
BlankClip(491, 3840, 2160, pixel_type="YV12").KillAudio()
ScriptClip("""RawReader(String(current_frame, "C:\Holding\1_CrowdRun_2160p50_CgrLevels_MASTER_SVTdec05_\CrowdRun_%05.0f.sgi"),
\ "Y8", 3840, 2160, packing="16:0:8", filehead=512)""")
The first frame is correct, then the second frame seems to read the G channel of the second frame, the third frame seems to read the B channel of the third frame, and all the remaining frames read the B channels. If you change the script to read in the G channel (changing filehead), the first frame will show the G channel, second will show the B channel, and B from there on. If you change the script to read in the B channel, it always shows the B channel.
I can easily skip this by using FFmpeg to concatenate the SGI file sequence into a raw RGB48 file, but I'm trying to save that step (for long sequences, the RGB48 files obviously get HUGE).
Does anyone have any clue why my issue is happening? Thanks in advance.
SGI files have the image information stored as "channels" after a 512 byte file header. This is a little different than normal, as instead of having the R, then G, then B value for each pixel, you have the whole frame for R, then the whole frame for G, then the whole frame for B. In this example, the SGI files are 3840x2160 with 16bpc, so the offsets are R=512, B=16589312, and G=33178112.
Reading each "channel" in is simple enough (three instances of ScriptClip/Sashimi, with the increasing filehead offsets for the G and B channels). I can then use MergeRGB to get a regular RGB video.
These SGI files can be downloaded from:ftp://vqeg.its.bldrdoc.gov/HDTV/SVT_MultiFormat/2160p50_CgrLevels_Master_SVTdec05_/1_CrowdRun_2160p50_CgrLevels_MASTER_SVTdec05_
My problem is that this only works on the first frame. For each frame after that, the channels converge on the B channel for some reason. If I start with just the line to read in the R channel:
BlankClip(491, 3840, 2160, pixel_type="YV12").KillAudio()
ScriptClip("""RawReader(String(current_frame, "C:\Holding\1_CrowdRun_2160p50_CgrLevels_MASTER_SVTdec05_\CrowdRun_%05.0f.sgi"),
\ "Y8", 3840, 2160, packing="16:0:8", filehead=512)""")
The first frame is correct, then the second frame seems to read the G channel of the second frame, the third frame seems to read the B channel of the third frame, and all the remaining frames read the B channels. If you change the script to read in the G channel (changing filehead), the first frame will show the G channel, second will show the B channel, and B from there on. If you change the script to read in the B channel, it always shows the B channel.
I can easily skip this by using FFmpeg to concatenate the SGI file sequence into a raw RGB48 file, but I'm trying to save that step (for long sequences, the RGB48 files obviously get HUGE).
Does anyone have any clue why my issue is happening? Thanks in advance.