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
video = av.open(url)
container = av.open(outpout_url, "w", format="rtsp", options={'rtsp_transport': 'tcp'})
stream = container.add_stream('h264')
stream.pix_fmt = 'yuv420p'
stream.options = {"preset": "ultrafast", "vcodec": "rawvideo"}
for packet in video.demux():
if packet.dts is None:
continue
for frame in packet.decode():
if packet.stream.type != 'video':
continue
print("frame = ", frame)
img = frame.to_ndarray(format='bgr24')
frame2 = av.VideoFrame.from_ndarray(img, format='bgr24')
for packet2 in stream.encode(frame2):
container.mux(packet2)
I get many noise like square
Expected behavior
the same as FFMPEG cmd
Versions
OS: Linux
PyAV runtime: 9.0.0
{{ Complete output of `python -m av --version`. If this command won't run, you are likely dealing with the build issue and should use the appropriate template. }}
PyAV build:
{{ Complete output of `python setup.py config --verbose`. }}
Activity