Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

How to get the encoded video keyframe field #367

@Iamlearn

Description

@Iamlearn

I used this code from wiki and found no keyframe information:

1. init

dstFile = av.open(dstFilePath, 'w')
out_stream = dstFile.add_stream('h264', rate = 25)
out_stream.width = w
out_stream.height = h

2. mux

encByteArray = bytearray(encFrame) # encFrame from EncodeSingleSurface
pkt = av.packet.Packet(encByteArray)
pkt.pts = pts_time
pkt.dts = pts_time
pkt.stream = out_stream # attach pkt to the stream
dstFile.mux(pkt)

If there is key frame information, the video saved by VPF can directly read the frame of interest。

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