Skip to content

ManagedCodecs 0.4.0

Choose a tag to compare

@github-actions github-actions released this 30 Oct 21:41
160e81a

Each decoded frame's interlacing as FFmpeg reports it, and an MP4 demuxer that reads one track at a time and lists
packets without their data; CAVLC decoding is faster. New public API, hence a minor version; code built against 0.3
keeps working.

Added

  • Each decoded frame's interlacing as FFmpeg reports it: VideoFrame.IsInterlaced and IsTopFieldFirst (ffprobe's
    interlaced_frame and top_field_first), FieldOrder (the order FFmpeg's H.264 parser gives the picture, a new
    FieldOrder enum with AVFieldOrder's values) and IsCodedAsFields (two field pictures), and
    H264Decoder.FieldOrder, the stream's as ffprobe prints it for MP4. H.264 follows the picture timing SEI's
    pic_struct and ct_type where there is one, else MBAFF or field coding and the field order counts; MJPEG frames are
    not flagged, as in FFmpeg (#225).
  • Mp4Demuxer: a file's tracks can be read one at a time, new Mp4Demuxer(stream, MediaTypes.Video) (a new
    MediaTypes flags enum); the other track is left out as if the file had none, and builds no sample table and gives
    no packets. And ReadPacketInfo(), the packets ReadPackets gives without their data (a new PacketInfo: the
    size, flags and timestamps), from the sample tables alone, without reading the file or allocating an array a packet,
    for a duration pass, a packet list or a bitrate graph (#211). Mp4Demuxer(Stream, bool leaveOpen = false) becomes
    two constructors, (Stream) and (Stream, bool), so that the new one can take leaveOpen as an optional
    parameter; calls compile and run as before.

Changed

  • H.264 decodes CAVLC streams faster, bit for bit as before: 3.2% off the 720p benchmark stream's steady frame
    (h264-bench-720p.mp4, Constrained Baseline) on GitHub's x64 runner, 1.8% off h264-p-refs.mp4, the CABAC
    samples unchanged (compare.yml against main). The residual reader takes the trailing ones' signs in one read and
    run_before from one lookup.

Fixed

  • AviDemuxer: an empty video chunk (a dropped frame) now takes its frame's tick, as in FFmpeg, so the packets after
    it have FFmpeg's pts rather than coming a frame early; it still gives no packet (#226).