Notifications
Clear all

[Closed] Bitmap over network hangup?

Hi there,

Im having the following issue: I have a folder somewhere on the network with lots of .mov movies for which I want to create a thumbnail automaticly by maxscript. Sounds easy… in fact it is. The creation process is done in the following way:

get all filenames, then in a loop use openBitmap() to open the .mov, create a new bitmap reference and use copy() to paste the opened bitmap in the newly created one and eventually save the new fresh bitmap and use close() on the bitmap references.
And now the ugly part: this whole process works like a charm, except the fact that it wont create more than 6 thumbnails! When I pass 6 thumbs, VIZ will hangup… over and over again! I Even used freeSceneBitmaps() and gc() after every bitmap creation… but it doesnt pass more than 6 thumbs… ?!

Does anybody have any idea ?


progressStart "Generating thumbs"
                i=1
                for baseMov in missingThumbs do (
                    try (
                        movRef = openBitmap baseMov
                    ) catch (
                        alert("Failed opening "+getFilenameFile baseMov+"!
")
                        exit
                    )
                    movRef.frame     = 5
                    newBmp             = bitmap 200 150 color:black filename:("F:\\Stockpoint - 3D\\Video\\People\\"+getFilenameFile baseMov+".jpg")
                    copy movRef newBmp
                    save newBmp
                    
                    close newBmp
                    close movRef
                    
                    progressUpdate (100*i/missingThumbs.count)
                    i+=1
                    freeSceneBitmaps()
                    gc()
                )
                progressEnd()

6 Replies

not sure what it is but i’d have to ask what size the quickktime files are. Have you tried making a folder of dummy quicktime movies for testing ? – say 10 @ 5 frames long and small file size. that way, if it works past your 6 file fail point, you could point it towards a memory issue. i

Close() only closes bitmaps opened for SAVING. Input bitmap values (like your quicktimes) will not be closed by it. So it is a better idea to assign UNDEFINED to the variable containing the input stream and then call gc light:true to garbage collect.
See if this helps…

According to my coworker, for whom I posted this, setting the variable to undefined does not seem to work.

My first thougth was perhaps multiple network connections to the same computer whihch might fail after a certain amount … could that be something ?

Hi yves,

ive tried your code, without the suggestions bobo made on a folder with ten small quicktimes located on our NAS server. It worked perfectly. the 6 file limit must be something to do with filesize and the machine running out of ram from not releasing the mov. the network connections issue doesnt seem to be a problem here.

What i want to know is can this same principle be applied to extracting the viewport thumbnail from a maxfile?
I have been able to use windows activex thumbnail in the past, but as im still on max 8 im trying to write things without active x until i can get some time to look at dot net., just so they dont break when we upgrade.

apparently, our network server is a Mac G4 and that’s what’s causing the problem.
When the script is being run on a local machine it’s running without problems.

that’s because Macs deal with the “Fun Stuff” only