AVPacket pkt; av_init_packet(&pkt);
void write_audio_frame(AVFormatContext *oc, AVStream *st){    int out_size;    AVCodecContext *c;    c = &st->codec;    get_audio_frame(samples, audio_input_frame_size, c->channels);    out_size = avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples);    /* write the compressed frame in the media file */    if (av_write_frame(oc, st->index, audio_outbuf, out_size) != 0) {        fprintf(stderr, "Error while writing audio frame\n");        exit(1);    }}