Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
accessibility_movie_2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵心治
accessibility_movie_2
Commits
f384efda
Commit
f384efda
authored
May 17, 2024
by
陈晓勇(工程师)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto create aside
parent
6bca2a81
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
main_window.py
main_window.py
+25
-0
management.py
management.py
+1
-1
No files found.
main_window.py
View file @
f384efda
...
...
@@ -1451,6 +1451,13 @@ class MainWindow(QMainWindow, Ui_MainWindow):
col
=
len
(
elem_list
)
btn
.
clicked
.
connect
(
self
.
audio_preview_slot_all
)
table
.
setCellWidget
(
idx
,
col
,
btn
)
btn2
=
QPushButton
()
# btn.setText(f"预览{idx}")
btn2
.
setText
(
f
"生成旁白"
)
col
=
len
(
elem_list
)
+
1
btn2
.
clicked
.
connect
(
self
.
auto_create_aside
)
table
.
setCellWidget
(
idx
,
col
,
btn2
)
if
table
.
objectName
()
==
constant
.
Subtitle
.
ObjectName
:
elem_list
=
elem
.
to_subtitle_list
()
time_format_col_list
=
constant
.
Subtitle
.
TimeFormatColumns
...
...
@@ -1536,6 +1543,24 @@ class MainWindow(QMainWindow, Ui_MainWindow):
else
:
self
.
prompt_dialog
.
show_with_msg
(
"暂无音频可供预览,请重新生成"
)
def
auto_create_aside
(
self
):
btn
=
self
.
sender
()
idx
=
self
.
all_tableWidget
.
indexAt
(
btn
.
pos
())
pos_sec
=
float
(
utils
.
get_seconds
(
self
.
projectContext
.
all_elements
[
int
(
idx
.
row
())]
.
st_time_sec
))
video
=
cv2
.
VideoCapture
(
self
.
projectContext
.
video_path
)
fps
=
video
.
get
(
cv2
.
CAP_PROP_FPS
)
start
=
int
(
pos_sec
*
fps
)
video
.
set
(
cv2
.
CAP_PROP_POS_FRAMES
,
start
)
_
,
frame
=
video
.
read
()
#视频帧
item
=
self
.
all_tableWidget
.
item
(
idx
.
row
(),
4
)
#旁白td
item
.
setText
(
"ceshi1111"
)
print
(
f
">>>>>>>>>>>>>>auto create aside, row :{idx}, start:{start}"
)
# self.generate_audio_slot_all(item)
def
audio_preview_slot_all
(
self
):
"""字幕旁白界面音频预览,会同步播放视频,并更新视频信息相关组件
...
...
management.py
View file @
f384efda
...
...
@@ -133,7 +133,7 @@ class ProjectContext:
self
.
subtitle_header
=
[
"起始时间"
,
"终止时间"
,
"字幕"
]
# self.contentHeader = ["起始时间", "字幕", "解说脚本", "语速"]
self
.
contentHeader
=
[
"起始时间"
,
"结束时间"
,
"字幕"
,
"推荐字数"
,
"解说脚本"
,
"语速"
,
"预览音频"
]
self
.
contentHeader
=
[
"起始时间"
,
"结束时间"
,
"字幕"
,
"推荐字数"
,
"解说脚本"
,
"语速"
,
"预览音频"
,
"生成旁白"
]
self
.
excel_sheet_name
=
"旁白插入位置建议"
self
.
history_records
=
[]
self
.
records_pos
=
0
...
...
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