[libav-api] Packaging Raw H264/AAC frames into FLV/RTMP Stream

Evgeny Yakimov john.yakimov at gmail.com
Sun Oct 2 22:18:42 CEST 2011


Hello Andrey

I have compiled libavformat with rtmp support ( --enable-librtmp ), I am
simply passing the rtmp:// URL as my output file and including the file
format as flv. In my earlier code extract:

fmt = av_guess_format(argv[4],argv[3],NULL);
oc = avformat_alloc_context();
oc->oformat = fmt;
snprintf(oc->filename, sizeof(oc->filename), "%s", argv[3]);

argv[4] would be my rtmp:// URL and my argv[3] would be "flv"


The reason that I think there is something missing in my code (most likely
in the headers) is because I can use avconv which reads the raw.h264 file
(all the same frames stored sequentially) and correctly stream them using
the following command:
avconv -i /mnt/videos/raw.h264 -re -vcodec copy -f flv rtmp://
192.168.0.4/live/live3

(note that avconv and libavformat/avcodec were compiled from the same
configuration).


I have just noticed that wowza gives me these errors when I attempt to
stream,

ERROR server comment - H264CodecConfigInfo.decodeAVCC:
java.lang.ArrayIndexOutOfBoundsException: 11
java.lang.ArrayIndexOutOfBoundsException: 11ERROR server comment -
CupertinoTSPacketizer.audioPacketsToTS:
java.lang.ArrayIndexOutOfBoundsException: 2

        at com.wowza.util.BufferUtils.byteArrayToInt(Unknown Source)
        at com.wowza.util.BufferUtils.byteArrayToInt(Unknown Source)
        at com.wowza.wms.media.h264.H264Utils.decodeAVCC(Unknown Source)
        at
com.wowza.wms.httpstreamer.smoothstreaming.livestreampacketizer.SmoothStreamingPacketHandler.handlePacket(Unknown
Source)
        at
com.wowza.wms.httpstreamer.smoothstreaming.livestreampacketizer.LiveStreamPacketizerSmoothStreaming.internalHandlePacket(Unknown
Source)
        at
com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase.run(Unknown
Source)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
ERROR server comment - LiveStreamPacketizerSmoothStreaming.handlePacket:
java.lang.ArrayIndexOutOfBoundsException: 2
java.lang.ArrayIndexOutOfBoundsException: 2
        at com.wowza.wms.media.aac.AACUtils.decodeAACCodecConfig(Unknown
Source)
        at
com.wowza.wms.httpstreamer.smoothstreaming.livestreampacketizer.SmoothStreamingPacketHandler.handlePacket(Unknown
Source)
        at
com.wowza.wms.httpstreamer.smoothstreaming.livestreampacketizer.LiveStreamPacketizerSmoothStreaming.internalHandlePacket(Unknown
Source)
        at
com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase.run(Unknown
Source)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

I haven't been able to find any more information regarding what these errors
mean, but I think it may have something to do with me not supplying the
correct information in the headers.

Regards,
Evgeny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libav.org/pipermail/libav-api/attachments/20111002/7209dc12/attachment.html>


More information about the libav-api mailing list