@ -1859,7 +1859,7 @@ def write_string(s, out=None, encoding=None):
from . compat import WINDOWS_VT_MODE # Must be imported locally
from . compat import WINDOWS_VT_MODE # Must be imported locally
if WINDOWS_VT_MODE :
if WINDOWS_VT_MODE :
s = s. replace ( ' \n ' , ' \n ' )
s = re. sub ( r ' ([ \ r \ n]+) ' , r ' \ 1 ' , s )
if ' b ' in getattr ( out , ' mode ' , ' ' ) :
if ' b ' in getattr ( out , ' mode ' , ' ' ) :
byt = s . encode ( encoding or preferredencoding ( ) , ' ignore ' )
byt = s . encode ( encoding or preferredencoding ( ) , ' ignore ' )
@ -3177,7 +3177,7 @@ def parse_codecs(codecs_str):
return { }
return { }
split_codecs = list ( filter ( None , map (
split_codecs = list ( filter ( None , map (
str . strip , codecs_str . strip ( ) . strip ( ' , ' ) . split ( ' , ' ) ) ) )
str . strip , codecs_str . strip ( ) . strip ( ' , ' ) . split ( ' , ' ) ) ) )
vcodec , acodec , t codec, hdr = None , None , None , None
vcodec , acodec , s codec, hdr = None , None , None , None
for full_codec in split_codecs :
for full_codec in split_codecs :
parts = full_codec . split ( ' . ' )
parts = full_codec . split ( ' . ' )
codec = parts [ 0 ] . replace ( ' 0 ' , ' ' )
codec = parts [ 0 ] . replace ( ' 0 ' , ' ' )
@ -3195,16 +3195,16 @@ def parse_codecs(codecs_str):
if not acodec :
if not acodec :
acodec = full_codec
acodec = full_codec
elif codec in ( ' stpp ' , ' wvtt ' , ) :
elif codec in ( ' stpp ' , ' wvtt ' , ) :
if not t codec:
if not s codec:
t codec = full_codec
s codec = full_codec
else :
else :
write_string ( f ' WARNING: Unknown codec { full_codec } \n ' )
write_string ( f ' WARNING: Unknown codec { full_codec } \n ' )
if vcodec or acodec or t codec:
if vcodec or acodec or s codec:
return {
return {
' vcodec ' : vcodec or ' none ' ,
' vcodec ' : vcodec or ' none ' ,
' acodec ' : acodec or ' none ' ,
' acodec ' : acodec or ' none ' ,
' dynamic_range ' : hdr ,
' dynamic_range ' : hdr ,
* * ( { ' tcodec' : tcodec } if t codec is not None else { } ) ,
* * ( { ' scodec' : scodec } if s codec is not None else { } ) ,
}
}
elif len ( split_codecs ) == 2 :
elif len ( split_codecs ) == 2 :
return {
return {