Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
xiaoqi
/
mp4giftconvert
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c3c8998c
authored
Apr 18, 2025
by
xiaoqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
脚本
parent
d3583746
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
20 deletions
convert_webp_2_mp4.py
convert_webp_2_mp4.py
View file @
c3c8998c
...
...
@@ -14,7 +14,7 @@ import numpy as np
from
PIL
import
Image
,
ImageEnhance
from
moviepy
import
*
from
moviepy
import
VideoFileClip
,
clips_array
import
traceback
# p_preset = "veryslow"
p_preset
=
"veryslow"
p_bitrate
=
"2000k"
...
...
@@ -349,27 +349,11 @@ def check_file_or_dir(userinput,output_file_path: str = None, output_name: str =
future
.
result
()
# 这里可以获取process_webp_file的返回值(如果有)
except
Exception
as
exc
:
print
(
f
'{file_path} 处理异常: {exc}'
)
print
(
"详细堆栈信息如下:"
)
traceback
.
print_exc
()
# def check_file_or_dir(userinput, output_name: str = None):
# # 检查路径是否存在
# if not os.path.exists(userinput):
# print(f"路径不存在:{userinput}")
# return
#
# # 如果是目录,递归处理目录中的所有文件
# if os.path.isdir(userinput):
# for dirpath, _, filenames in os.walk(userinput):
# for filename in filenames:
# full_path = os.path.join(dirpath, filename)
# process_webp_file(full_path, output_name=output_name)
#
# # 如果是文件,直接处理
# elif os.path.isfile(userinput):
# process_webp_file(userinput, output_name=output_name)
#
# else:
# print(f"路径既不是文件也不是目录:{userinput}")
def
process_webp_file
(
file_path
,
output_file_path
:
str
=
None
,
output_name
:
str
=
None
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment