up4 Posted September 21, 2014 Share Posted September 21, 2014 Hi, I'm new to HDK and I would like to know where to look if I want to write a plugin that will use FFMPEG to import movie files into Houdini to use as textures. I found the notion of "frames" in the TIL_* package, but I don't know how to go from the TIL classes to the IMG_* package or if I even should. Regards, Vincent Quote Link to comment Share on other sites More sharing options...
edward Posted September 21, 2014 Share Posted September 21, 2014 There's an internal MV (short for movie) library that Houdini uses for video but I'm not sure if it's not currently exposed in the HDK. It does have a video input interface as well but I don't know if that's being used either. So in lieu of anything better, one hack might be to write is an regular image format (see http://www.sidefx.com/docs/hdk13.0/_h_d_k__image__extend.html). The hack would be understand the filename of something like myvid.123.mp4 and then retrieve frame 123 of myvid.mp4. Quote Link to comment Share on other sites More sharing options...
up4 Posted September 21, 2014 Author Share Posted September 21, 2014 Thanks! I looked at the IMG lib, but there's something bothering me: why is the jumpToFrame method deprecated? And what has it been replaced with? How do I declare the number of frames contained in the movie file, or is that necessary? Do I just need to have the extension I want handled by my plugin and add the frame number to the path of the file? Won't houdini check the validity of the file first? Does this also mean I won't be able to use a file picker UI? Thanks again, Vincent Quote Link to comment Share on other sites More sharing options...
edward Posted September 21, 2014 Share Posted September 21, 2014 IMG_File::jumpToFrame() is more than just deprecated, it's not even called anymore as far as I can tell. I think this method was only for the mcp command line utility which has some primitive transcoding abilities. Since then, it's been replaced by this internal MV library. So basically, there's never been a way for Houdini to use read movies in the way that you care about. As for your other concerns, yeah, I'm not sure that the hack will work. You might have varying degrees of success depending on where you want to get the images from the movie in Houdini (eg. some places might check for the existence of the file first, some places might not). On the other hand, it might not be that much work to hack the example IMG_Raw.C plugin just to observe the behaviour first. As for frames outside the valid range, the plugin could probably just fail to open. But yeah, you won't be able to treat as a real image sequence in the File COP. Summary: I just tried to brainstorm an idea. It probably won't work. Quote Link to comment Share on other sites More sharing options...
up4 Posted September 22, 2014 Author Share Posted September 22, 2014 I will let it simmer for a couple of days, do some further reading (maybe it's better to just convert every frame upstream to rat/tx files) and try to come up with the least destructive pipeline possible (the goal was to use material straight out of the camera directly into the renderer). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.