Blogs: January 24, 2012 (21:30) - Help PLEASE with Red5 and H.264 - Posted by damackster
Suffering from Red5 blues (
I designed an app that I've wasted cash on offshore developers (I have extremely limited funds)that has a component that delivers a web conferencing e-learning facility. It offers live and pre-recorded A/V delivery with screen capture/record. The application 'works' except the quality of the streamed screen capture is 'poor' to put it kindly (think Atari circa 1983). The issue it seems is when dealing with H.264 codecs. Its either High quality with too high bandwidth or its Useless quality with minimal bandwidth.
* We are working on replacement of ScreenCodec2 with H.264
* We are using Red5 (yes, not the greatest of choices but cost is an issue for now)
* As you know, in java there is no proper implementation of H.264
* The x264 library is the best optimised library for H.264 , but its coded in c and c++
* Unfortunately we don't have this library in java
* ffmpeg is also an open source tool which we need installed on the machine
* This tool can convert the rtmp stream on the fly from one type to another
* We also used xuggler java api to encode our stream, but this api is not working properly and the quality is not much improved
* Weirdly, using xuggler we got fantastic quality but found a painful 30-40 seconds delay when it starts to send packets
* We have the sourcecode for xuggler
* We debugged the code and found that ffmpeg presets are creating this delay
* As you know, there are many presets for H.264 such as normal, default, HD etc
* When we set the codec type to H.264 in xuggler, we need to load a ffmpeg preset file
* Using this file xuggler encodes the bufferedimage into iPacket
* Using xuggler we can write the video in FLV container only however, Xuggler doesn't write the video in F4V container, which is the mp4 container
* Unfortunately, also Red5 don't support the F4v container
* Using Xuggler H.264, we can write the video in FLV format thus its xuggler's limitation
* We tried to write the video in F4V container using xuggler but it won't play that video
All sense tells me that the issue is highly likely to be a configuration issue within the settings as opposed to something coding-related. Probably a blindingly obvious little thing but its causing me a serious pain in the rear.
Any pearls of wisdom, dudes??
Should I be looking at another H.264 Java API, other than xuggler, which is compatible with Red5??
Perhaps the developers are lost in detail and not looking at this methodically. I feel like I'm banging my head against a wall.