Skip to content

CodecContext.parse does not assign duration etc to av packet #1919

Closed

Description

Hello and thank you for the great library!

Is it possible to provide more information as per packet returned by Context.parse? Today packets offer no information except for parsed frames themselves.. Some codecs can contain frames with duration which varies (i.e raw opus input with multiple frames per packet).

example of ffmpeg code doing this: https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/demux.c
function: static int parse_packet(AVFormatContext *s, AVPacket *pkt,
int stream_index, int flush)

as opposed to:
https://github.com/PyAV-Org/PyAV/blob/main/av/codec/context.pyx
function: def parse(self, raw_input=None):

Best Regards,

Igor

Activity

  1. ghost changed the title [-]Context.parse does not assign duration etc to av packet[/-] [+]CodecContext.parse does not assign duration etc to av packet[/+] on Jun 15, 2025
  2. calllivecn commented on Jan 13, 2026

    @calllivecn

    I also encountered this problem when parsing Annex-B frames output from the Android MediaCodec API.

    1. Check if the pts and dts from ffmpeg's int av_parser_parse2() are provided.
    2. Also, the setting for codec.context.extradata seems to be ineffective.
  3. added a commit that references this issue on Jun 4, 2026
    ce05544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions