You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
Roman Arzumanyan edited this page Dec 7, 2021
·
2 revisions
Nvenc produces elementary video stream which can be either opened with video player like VLC or it can be put into containers like *.avi, *.mkv and such.
Process of putting elementary video stream into container is called muxing.
VPF doesn't support muxing but it can be done with other Python libraries, e. g. with PyAV.
Thanks to @wykvictor for the snippet below:
# 1. initdstFile=av.open(dstFilePath, 'w')
out_stream=dstFile.add_stream('h264', rate=25)
out_stream.width=wout_stream.height=h# 2. muxencByteArray=bytearray(encFrame) # encFrame from EncodeSingleSurfacepkt=av.packet.Packet(encByteArray)
pkt.pts=pts_timepkt.dts=pts_timepkt.stream=out_stream# attach pkt to the streamdstFile.mux(pkt)