Jump to content
  • Advertisement
Sign in to follow this  
amtri

How to encode h264 video

This topic is 1137 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

 

I have been asked to take a series of images defined as simple bitmaps and encode them into a h264 file. I did manage to download and build the h264 libraries, but I'm having a tough time sorting through the documentation or examples to come up with a simple way of doing this through their API (I am required to use the h264 API directly).

 

Can somebody point me to some simple examples on how to do this?

 

Thanks.

Share this post


Link to post
Share on other sites
Advertisement

I don't have the code to hand, but I used Cuda.

 

Have a dig around in the online docs for it, but for me it was a single line of code to generate h264

Share this post


Link to post
Share on other sites

Stainless,

 

Isn't CUDA specific to NVIDIA graphics? Or am I missing something here? I'm supposed to assume that the only library I have is the original h264 library. Having to rely on CUDA would restrict usage to those using NVIDA graphics.

 

Am I correct?

Share this post


Link to post
Share on other sites

This stackoverflow thread seems fairly straightforward:

1. Configure h264.
2. Alloc a picture.
3. Convert frame from RGB to YUV.
4. Send YUV frame to h264.
5. ...
6. Profit!

 

I did exactly this using what is now libav for MPEG/H.264 encoding 5+ years ago. What encoder are you using, @amtri, x264?

Share this post


Link to post
Share on other sites




Am I correct?

 

The list of supported graphics cards is here ...    https://developer.nvidia.com/cuda-gpus

 

If you have a compatible card, use CUDA. Not only is it very easy to use, it's very fast. I had real time video compositing working a few years ago using CUDA.

 

Your original post implied it was a one off job. If so you don't have to worry about compatibility. You either have a CUDA card and can use it, or you don't and you can't.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!