Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
Elias Steurer
ScreenPlay
Commits
f49fa0dc
Commit
f49fa0dc
authored
Jan 07, 2021
by
Elias Steurer
🇪🇺
Browse files
Fix missing m_length for webm import
parent
74db71d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
ScreenPlay/src/createimportvideo.cpp
View file @
f49fa0dc
...
...
@@ -244,7 +244,8 @@ bool CreateImportVideo::analyzeWebmReadFrames(const QJsonObject& obj)
// If the video is to short
m_smallVideo
=
m_numberOfFrames
<
(
m_framerate
*
5
);
qInfo
()
<<
m_numberOfFrames
<<
m_framerate
<<
m_smallVideo
;
m_length
=
std
::
ceil
(
m_numberOfFrames
/
m_framerate
);
;
qInfo
()
<<
m_numberOfFrames
<<
m_framerate
<<
m_smallVideo
<<
m_length
;
return
true
;
}
...
...
@@ -386,24 +387,6 @@ bool CreateImportVideo::createWallpaperVideoPreview()
args
.
append
(
m_exportPath
+
"/preview.webm"
);
emit
processOutput
(
"ffmpeg "
+
Util
::
toString
(
args
));
connect
(
m_process
.
get
(),
&
QProcess
::
readyReadStandardOutput
,
this
,
[
&
]()
{
QString
tmpOut
=
m_process
->
readAllStandardOutput
();
const
auto
tmpList
=
tmpOut
.
split
(
QRegExp
(
"
\\
s+"
),
Qt
::
SplitBehaviorFlags
::
SkipEmptyParts
);
if
(
tmpList
.
length
()
>
2
)
{
bool
ok
=
false
;
const
float
currentFrame
=
QString
(
tmpList
.
at
(
1
)).
toFloat
(
&
ok
);
if
(
!
ok
)
return
;
const
float
progress
=
currentFrame
/
static_cast
<
float
>
((
m_framerate
*
5
));
this
->
setProgress
(
progress
);
}
emit
processOutput
(
tmpOut
);
});
const
QString
ffmpegOut
=
waitForFinished
(
args
);
const
QFile
previewVideo
(
m_exportPath
+
"/preview.webm"
);
if
(
!
previewVideo
.
exists
()
||
!
(
previewVideo
.
size
()
>
0
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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