While doing some more experimentation on this problem, I noticed
that libavformat is affected by what I place in the payload data.
Example:

    AVPacket pkt = { 0 };
    av_read_frame(fcx, &pkt);
    AVStream *input_st = fcx->streams[pkt.stream_index];
    if (input_st->codec->codec_type == CODEC_TYPE_AUDIO) {
        pkt.stream_index = audio_st->index;
        av_write_frame(oc, &pkt);
    } else if (input_st->codec->codec_type == CODEC_TYPE_VIDEO) {
        pkt.stream_index = video_st->index;
        av_write_frame(oc, &pkt);
    }

If I put

  memset(pkt.data, 0, pkt.size);

just before av_write_frame, I would expect that the container file
parses just like it would without the memset.  Not true.  What
happens when I parse the generated file with libavformat is that the
zeroed out audio frames are not returned by av_read_frame.  The
generated wile was exactly the same size as without the memset, so I
know the payloads are there, av_read_frame just doesn't want to
return them.

How can this happen?  Isn't the payload supposed to be an opaque
array of bytes from the container stream's perspective?

-- 
 Haakon
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to