File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import copy
21import weakref
32from enum import IntEnum
43
Original file line number Diff line number Diff line change 33
44import av
55import av .datasets
6+ from av .codec .hwaccel import HWAccel , hwdevices_available
67
78# What accelerator to use.
89# Recommendations:
3031 )
3132
3233if HW_DEVICE is None :
33- print (
34- f"Please set HW_DEVICE. Options are: { str (av .codec .hwaccel .hwdevices_available ())} "
35- )
34+ print (f"Please set HW_DEVICE. Options are: { hwdevices_available ()} " )
3635 exit ()
3736
38- assert (
39- HW_DEVICE in av .codec .hwaccel .hwdevices_available ()
40- ), f"{ HW_DEVICE } not available."
37+ assert HW_DEVICE in hwdevices_available (), f"{ HW_DEVICE } not available."
4138
4239print ("Decoding in software (auto threading)..." )
4340
5653assert frame_count == container .streams .video [0 ].frames
5754container .close ()
5855
59- print (f"Decoded with software in { sw_time :.2f} s ({ sw_fps :.2f} fps)." )
60-
61- print (f"Decoding with { HW_DEVICE } " )
56+ print (
57+ f"Decoded with software in { sw_time :.2f} s ({ sw_fps :.2f} fps).\n "
58+ f"Decoding with { HW_DEVICE } "
59+ )
6260
63- hwaccel = av . codec . hwaccel . HWAccel (device_type = HW_DEVICE , allow_software_fallback = False )
61+ hwaccel = HWAccel (device_type = HW_DEVICE , allow_software_fallback = False )
6462
6563# Note the additional argument here.
6664container = av .open (test_file_path , hwaccel = hwaccel )
Original file line number Diff line number Diff line change 88
99import av
1010
11- # This import is needed to make the test_decoded_time_base test pass when we run only this test file.
12- # Not sure why.
13- from av .subtitles import subtitle
14-
1511from .common import TestCase , fate_suite
1612
1713
You can’t perform that action at this time.
0 commit comments