File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -81,14 +81,17 @@ def _start(self):
8181 if self .profile is not None :
8282 if not isinstance (self .profile , str ):
8383 raise RuntimeError ("Profile should be a string value" )
84- # Much more helpful to compare profile names case insensitively!
85- available_profiles = {k .lower (): v for k , v in self ._stream .codec .profiles .items ()}
86- profile = self .profile .lower ()
87- if profile not in available_profiles :
84+ # Find the right profile name, ignoring case.
85+ profile = None
86+ for available_profile in self ._stream .profiles :
87+ if self .profile .lower () == available_profile .lower ():
88+ profile = available_profile
89+ break
90+ if not profile :
8891 raise RuntimeError ("Profile " + self .profile + " not recognised" )
89- self ._stream .codec_context . profile = available_profiles [ profile ]
92+ self ._stream .profile = profile
9093 # The "ultrafast" preset always produces baseline, so:
91- if "baseline" not in profile :
94+ if "baseline" not in profile . lower () :
9295 preset = "superfast"
9396
9497 if self .bitrate is not None :
You can’t perform that action at this time.
0 commit comments