File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -238,3 +238,26 @@ def test_hardware_decode(self) -> None:
238238 frame_count += 1
239239
240240 assert frame_count == video_stream .frames
241+
242+ def test_libsvtav1 (self ) -> None :
243+ if not "libsvtav1" in av .codecs_available :
244+ pytest .skip ()
245+
246+ output = av .open ("output.mp4" , "w" )
247+ stream = output .add_stream ("libsvtav1" )
248+
249+ for i in range (24 ):
250+ frame = av .VideoFrame (200 , 100 , "rgb24" )
251+ frame .pts = i * 2000
252+ frame .time_base = Fraction (1 , 48000 )
253+ for packet in stream .encode (frame ):
254+ assert packet .time_base == Fraction (1 , 24 )
255+ output .mux (packet )
256+
257+ for packet in stream .encode (None ):
258+ assert packet .time_base == Fraction (1 , 24 )
259+ output .mux (packet )
260+
261+ assert output .streams [0 ].codec .name == "libsvtav1"
262+ assert output .streams [0 ].codec .is_encoder is True
263+ assert output .streams [0 ].frames == 24
You can’t perform that action at this time.
0 commit comments