April 8, 2022 14:37:56
I have a tops tree that exports an image sequence (jpeg) perfectly, moves to another wedge value, and then exports another sequence, and so on. Then downstream I have an "ffmpeg encode video" which is kinda working -- meaning it generates a gif for each sequence which is what I was hoping for --- except some of the frames seem to be out of order, so the gif appears as if it's skipping or glitching, and it does this for each one of the sequences.
The image sequence is exported with frame padding ($F4) and the frame range never exceeds the 4th digit, in fact it easily stays safely within 3 digits. Does anyone have any suggestions on how I might be able to fix this? ss of ffmpeg settings is attached
April 8, 2022 17:03:20
Can you attach a .hip file that reproduces the issue you're seeing?
April 11, 2022 17:54:04
yup! I've attached a .hip that should replicate the issues, and the mp4 and the gif that they generate -- thank you for looking into this
April 11, 2022 18:24:39
There are a few issues with the TOP network in that file.
The first issue is that the Wedge node creates three wedges, with integer "seed" values of 0, 0, and 1. That means that the second set of 30 frames is a duplicate of the first set of 30. Since the Wait for All is configured to split by the "seed" attribute, the first partition in that node ends up with 60 work items in it. The partition will therefore contain two frame 1 work items, two frame 2s, etc. To fix that, either a) the Wedge should be changed to not create duplicate values for "seed" or b) the Wait for All should instead by configured to split by the "wedgeindex" attribute.
The second issue, which is also the main problem, is that your Wait for All has the "Sort Contents" parameter set to "None". That means the partitions in that node will be completely unsorted/in random order. The output files on the partition match the sort order of the work items in that partition, so the file order will also be jumbled. The FFMPEG node uses the files in the order that they're specified on the input, so that also affects the .gif. Setting "Sort Contents" back to the default "Work Item Index", along with the change mentioned in the previous paragraph, should fix your .gifs.
April 12, 2022 11:51:43
Thank you for taking a look at this and figuring it out. You exactly figured out what was going on and making those changes have fixed the issue I was having. Much appreciated!
"Sort contents: none" was a bit misleading to me -- friendly suggestion to change that to "random" -- for sidefx consideration. :S