Re: format after SimpleBlock Header?

117 views
Skip to first unread message

Frank Galligan

unread,
Sep 9, 2011, 9:36:16 AM9/9/11
to webm-d...@webmproject.org
Hi J.J.

On Fri, Sep 9, 2011 at 1:26 AM, J. J. Lee <jjlee3...@gmail.com> wrote:
I am working for online transcoding from (Wowza RTMP) flv format to
webm.

I put a Cluster and a Timecode ahead of every video keyframe which is
put into a SimpleBlock (no lacing).
In the very beginning of the live streaming flv there are a lot of 0
length video frames, so there are all transcoded to
SimpleBlocks - A3 84 81 ?? ?? (Timecode of SimpleBlock in two bytes)
80(keyframe or 00 non-keyframe) in my program.
Why even transcode 0 length video frames? This is not a frame rate based container. But if you must I'm not sure making them key-frames is a great idea.



The avcodec.dll (of ffmpeg) is called for transcoding from flv (x264/
AAC) to webm. I tried to decode from the x264/AAC frames.
Then I tried to encode to Vorbis/Vp8 frames and put those encoded
frames after different SimpleBlock Headers.
But it can not work! Is it correct to put Vorbis/Vp8 encoded frames
data after SimpleBlock Header?
Yes, as long as the simpleblock header describes the data correctly.
 

The transcoded (incorrected) webm file (131 KB) is at
https://docs.google.com/leaf?id=0B5pthuvVJq9dMTI0YjE2NDAtMzI5MS00NTBlLTgxZDgtZjEzM2E5ZDAwOTU2&hl=en_US
The first non-0 length video frame (SimpleBlock) of this webm file is
at offset 0x2828.

Is there anything wrong with above test.webm?
Yes your first TRACK element (video) has the wrong size. I'm not sure how demuxers should or will handle this file. The size for the video track element should only include the video track element data not both track elements.

Again the 0 length frames might be an issue too. You will have to test that out on different players to see what happens.

Also your first >0 length video frame is not a key-frame so some players might have an issue with that. The frame looks like it is a key-frame as the size is 10675 bytes but it is not marked as a key-frame. (I could check if it is actually a key-frame if the header data wasn't messed up)


I would suggest not muxing 0 length frames. If you need the place holder for some reason (???) why not encode a black frame or maybe a poster frame. Also I would suggest your first real frame be transcoded as a key-frame (though I think it is in your file, just muxed incorrectly).


If I tried to convert a flv file to webm by ffmpeg.exe, I found a 0
length video frame should be converted A3 85 81 ?? ?? 80(or 00) "00".
Why "00" is there?
Not sure. Maybe a bug because of 0 length frames. You should look into the FFmpeg code.

Is there any information for frame data of no lacing SimpleBlock?
I don't understand the question.
 
Where is the reference code sample for how to generating frame data
after SimpleBlock Header?
There is code in project libwebm, smaple_muxer application. Or project libvpx, vpxenc application. Or FFmpeg in the matroska_enc.c file.

Frank



Thanks in advance
   J. J. Lee

--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To post to this group, send email to webm-d...@webmproject.org.
To unsubscribe from this group, send email to webm-discuss...@webmproject.org.
For more options, visit this group at http://groups.google.com/a/webmproject.org/group/webm-discuss/?hl=en.


J. J. Lee

unread,
Sep 9, 2011, 11:16:57 AM9/9/11
to WebM Discussion
Thanks for help. Thanks for pointing out my error.

You are right, the "TrackEntry" of my test.webm is not corrected.

Those 0 length frames are directly come from Wowza RTMP flv live
streaming, I think I should change it for webm.

As I check the Wowza RTMP flv, the first non-0 length frame
is not a key frame. Again this one should be changed as your
suggestion.

Thanks again
J. J. Lee

On 9月9日, 下午9時36分, Frank Galligan <fgalli...@google.com> wrote:
> Hi J.J.
>
> On Fri, Sep 9, 2011 at 1:26 AM, J. J. Lee <jjlee3.jjl...@gmail.com> wrote:
>
> > I am working for online transcoding from (Wowza RTMP) flv format to
> > webm.
>
> > I put a Cluster and a Timecode ahead of every video keyframe which is
> > put into a SimpleBlock (no lacing).
> > In the very beginning of the live streaming flv there are a lot of 0
> > length video frames, so there are all transcoded to
> > SimpleBlocks - A3 84 81 ?? ?? (Timecode of SimpleBlock in two bytes)
> > 80(keyframe or 00 non-keyframe) in my program.
>
> Why even transcode 0 length video frames? This is not a frame rate based
> container. But if you must I'm not sure making them key-frames is a great
> idea.
>
> > The avcodec.dll (of ffmpeg) is called for transcoding from flv (x264/
> > AAC) to webm. I tried to decode from the x264/AAC frames.
> > Then I tried to encode to Vorbis/Vp8 frames and put those encoded
> > frames after different SimpleBlock Headers.
> > But it can not work! Is it correct to put Vorbis/Vp8 encoded frames
> > data after SimpleBlock Header?
>
> Yes, as long as the simpleblock header describes the data correctly.
>
>
>
> > The transcoded (incorrected) webm file (131 KB) is at
>
> >https://docs.google.com/leaf?id=0B5pthuvVJq9dMTI0YjE2NDAtMzI5MS00NTBl...
> > To post to this group, send email to webm-disc...@webmproject.org.
> > To unsubscribe from this group, send email to
> > webm-discuss+unsubscr...@webmproject.org.
Reply all
Reply to author
Forward
0 new messages