Jump to content

HDK/FFMPEG


up4

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...