Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김혁우
/
design_project-automatic_video_editing_program
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
유희평
2020-12-17 00:48:08 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
112a9322c36f3da136c554cbc14af83a1a0b7212
112a9322
2 parents
80e402db
34cff6b0
initial commit
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
1 deletions
README.md
aditor3.5.py
initial
README.md
0 → 100644
View file @
112a932
Automatic video editing program
\ No newline at end of file
aditor3.5.py
View file @
112a932
...
...
@@ -445,8 +445,11 @@ class WindowClass(QMainWindow, Ui_MainWindow): # Ui_MainWindow를 받음
self
.
horizontalSlider
.
setMaximum
(
self
.
endframe
-
self
.
stframe
)
self
.
horizontalSlider
.
setValue
(
self
.
stframe
)
self
.
isdata
=
False
<<<<<<<
HEAD
self
.
ax1
.
clear
()
self
.
ax2
.
clear
()
=======
>>>>>>>
34
cff6b09a8d3e1117437cc9ed79eb6ae8313c1f
def
updateFrame
(
self
):
self
.
frameID
+=
1
...
...
@@ -495,6 +498,40 @@ class WindowClass(QMainWindow, Ui_MainWindow): # Ui_MainWindow를 받음
self
.
statusbar
.
showMessage
(
"Time: "
+
str
(
tmin
)
.
zfill
(
2
)
+
":"
+
str
(
ttsec
)
.
zfill
(
2
)
+
":"
+
str
(
int
(
ksec
*
100
)))
self
.
sliderbusy2
=
False
<<<<<<<
HEAD
=======
"""
def lineSliderSet(self, cnt): #그래프상 수직선 위치 업데이트
if cnt + 1 - self.stframe > self.horizontalSlider.maximum():
return
self.linebusy = True
pdraw = self.drawmin
self.drawmin -= 20
if self.drawmin < 1:
self.drawmin = 1
while (cnt + 1) / self.fps > self.data.values[self.drawmin, 1]:
self.drawmin += 1
if not self.drawmin == pdraw or pdraw == 1:
wr = ref(self.ax1.lines[5])
self.ax1.lines.remove(wr())
self.ui.bottomImage.canvas.draw()
self.ax1.plot([self.data.values[self.drawmin, 1], self.data.values[self.drawmin, 1]], [0, 3.4], 'k',
linewidth=2.0)
self.ui.bottomImage.canvas.draw()
tsec = cnt / self.fps
tmin = int(tsec / 60)
ttsec = int(tsec - 60 * tmin)
ksec = tsec - 60 * tmin - ttsec
self.ui.statusbar.showMessage(
"Frame Time: " + str(tmin).zfill(2) + ":" + str(ttsec).zfill(2) + ":" + str(int(ksec * 100)))
self.linebusy = False
"""
>>>>>>>
34
cff6b09a8d3e1117437cc9ed79eb6ae8313c1f
def
horizontalSliderPressed
(
self
):
self
.
sliderbusy
=
True
...
...
@@ -752,7 +789,11 @@ class Clip:
window_length
=
max_slice
*
sr
#한 구간에 해당하는 샘플의 개수
energy
=
np
.
array
([
sum
(
abs
(
x
[
i
:
i
+
window_length
]
**
2
))
#windwo_length구간 안에있는 모든 샘플들의 진폭의 제곱의 합->소리의 크기
for
i
in
range
(
0
,
len
(
x
),
window_length
)])
#len(x)는 sr*영상길이인데 이것을 window_length만큼 끊음 i = 0, winlength, winlength*2, winlength*3, ...
<<<<<<<
HEAD
=======
#print(energy)
>>>>>>>
34
cff6b09a8d3e1117437cc9ed79eb6ae8313c1f
#energy data를 dataframe으로 만듦
df
=
pd
.
DataFrame
(
columns
=
[
'energy'
,
'start'
,
'end'
])
row_index
=
0
...
...
@@ -763,9 +804,42 @@ class Clip:
df
.
loc
[
row_index
,
'start'
]
=
i
[
0
]
*
max_slice
df
.
loc
[
row_index
,
'end'
]
=
(
i
[
0
]
+
1
)
*
max_slice
row_index
=
row_index
+
1
<<<<<<<
HEAD
#연속구간으로 나타내기
=======
#print(df)
"""
if value >= threshold:
i = np.where(energy == value)[0]
df.loc[row_index, 'energy'] = value
df.loc[row_index, 'start'] = i[0] * max_slice
df.loc[row_index, 'end'] = (i[0] + 1) * max_slice
row_index = row_index + 1
print(df) #threshold를 넘은 구간이 저장됨
"""
#연속구간으로 나타내기
"""
temp = []
i = 0
j = 0
n = len(df) - 2
m = len(df) - 1
while (i <= n):
j = i + 1
while (j <= m):
if (df['end'][i] == df['start'][j]):
df.loc[i, 'end'] = df.loc[j, 'end']
temp.append(j)
j = j + 1
else:
i = j
break
df.drop(temp, axis=0, inplace=True)
print(df)
"""
>>>>>>>
34
cff6b09a8d3e1117437cc9ed79eb6ae8313c1f
return
df
...
...
@@ -912,7 +986,26 @@ def get_video_duration(service, **kwargs):
def
_js_parseInt
(
string
):
return
int
(
''
.
join
([
x
for
x
in
string
if
x
.
isdigit
()]))
<<<<<<<
HEAD
=======
"""
if __name__ == '__main__':
# When running locally, disable OAuthlib's HTTPs verification. When
# running in production *do not* leave this option enabled.
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
service = get_authenticated_service()
video_id = input('Enter a video_id: ')
comments = get_video_comments(
service, part='snippet', videoId=video_id, textFormat='plainText')
video_duration = get_video_duration(
service, part='contentDetails', id=video_id)
# print(video_duration)
# print(comments)
commentdata = make_video_timeline(comments, video_duration)
print(commentdata)
"""
>>>>>>>
34
cff6b09a8d3e1117437cc9ed79eb6ae8313c1f
if
__name__
==
"__main__"
:
app
=
QApplication
(
sys
.
argv
)
...
...
initial
0 → 100644
View file @
112a932
File mode changed
Please
register
or
login
to post a comment