fix 处理jpg图片的codec_name应为mjpg
This commit is contained in:
parent
9785cb45d7
commit
45bb33e67a
|
|
@ -128,15 +128,16 @@ class VideoMetadata(BaseModel):
|
|||
if isinstance(stream, Dict):
|
||||
logger.info(f"Parsing stream : {json.dumps(stream, ensure_ascii=False)}")
|
||||
if stream.get("codec_type") == 'audio':
|
||||
if stream.get("duration"):
|
||||
hls_audio = HLSMediaVideoStream.model_validate(stream)
|
||||
if stream.get("duration") is None:
|
||||
logger.info("Parsing audio stream")
|
||||
hls_audio = HLSMediaAudioStream.model_validate(stream)
|
||||
streams.append(hls_audio)
|
||||
else:
|
||||
logger.info("Parsing hls audio stream")
|
||||
audio = AudioStream.model_validate(stream)
|
||||
streams.append(audio)
|
||||
elif stream.get("codec_type") == 'video':
|
||||
if stream.get("codec_name") in ("gif", "png", "jpg", "jpeg", "webp"):
|
||||
if stream.get("codec_name") in ("gif", "png", "mjpg", "jpeg", "webp"):
|
||||
logger.info("Parsing image stream")
|
||||
image = ImageStream.model_validate(stream)
|
||||
streams.append(image)
|
||||
|
|
|
|||
Loading…
Reference in New Issue