Question in regards to adding another codec.

Archive of historical development discussions
Discussions / Development has moved to GitHub
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
omicrondelta
Posts: 3
Joined: Thu Aug 26, 2010 6:47 pm

Question in regards to adding another codec.

Post by omicrondelta »

Greetings, HandBrake developers. First off, I'd like to say that I find HandBrake to be one of the best video encoders available. Second, I'd be interested in seeing VP8 included in the list of codecs that HandBrake encodes to. Now I don't expect you to add it just because I asked, so I'd like to try adding it myself (CLI version only). If this endeavor is successful for me, I'd contribute the patches for you to potentially add to the main branch.

My question is thus: rather than reading through the source in every file, could the devs maybe point me in the right direction as to where about in the tree that I should be focusing on to add in the proper hooks to have VP8 a part of HandBrake? It would be much appreciated if someone could take the time to explain, but, if I have to, I'll go through the code line by line to figure it out myself.


-OmicronDelta
Deleted User 11865

Re: Question in regards to adding another codec.

Post by Deleted User 11865 »

It's probably easiest to use VP8 through Libav/FFmpeg. This would be in libhb/encavcodec.c, like the MPEG-2 and MPEG-4 encoders.

See https://trac.handbrake.fr/changeset/3853

The hard part would be to add libvpx as a contrib (see any of the folders in /contrib for an example of how our build system works), then you'd configure Libav so that it builds with libvpx support (see /contrib/ffmpeg/module.defs), and then finally you'd wire it in encavcodec.c.
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Question in regards to adding another codec.

Post by s55 »

For what it's worth, I spend some time on the ffmpeg approach and kept running into issues with unresolved symbols. I think it's down to a rather weird setup they have with their build system. (Not my area of expertise unfortunately)
This however, would be be the easier approach if it works as it's a common API.

I had more luck creating my own encavvp8.c and linking it in directly to Handbrake but I kept getting garbage output. (I'm not familiar with C so didn't waste a lot of time on it)
omicrondelta
Posts: 3
Joined: Thu Aug 26, 2010 6:47 pm

Re: Question in regards to adding another codec.

Post by omicrondelta »

Thank you, gentlemen. I've browsed over both the HandBrake files you've mentioned and am busy with trying to understand the nuances of the VP8 SDK. If I do successfully patch HandBrake to output WebM video, don't expect that patch any time soon. ;)

Happy coding.
Post Reply