mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-22 10:42:29 +01:00
e8fbe8e565
Update to qdoc Qt 6.1 Add module for every project
177 lines
15 KiB
HTML
177 lines
15 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<!-- createimportvideo.cpp -->
|
|
<title>CreateImportVideo Class | ScreenPlay</title>
|
|
<link rel="stylesheet" type="text/css" href="../css/style.css"/> <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"/>
|
|
</head>
|
|
<body>
|
|
<div class="container-fullwidth nav sticky-top"><div class="container navWrapper"><a href="../index.html"><span class="logo">ScreenPlay Generated Docs </span></a><span class="navHome"><a href="../index.html">Home</a></span></div></div> <div id= mainWrapper class="wrapper container ">
|
|
<li>CreateImportVideo</li>
|
|
<div class="sidebar">
|
|
<div class="toc">
|
|
<h3><a name="toc">Contents</a></h3>
|
|
<ul>
|
|
<li class="level1"><a href="#public-functions">Public Functions</a></li>
|
|
<li class="level1"><a href="#public-slots">Public Slots</a></li>
|
|
<li class="level1"><a href="#signals">Signals</a></li>
|
|
<li class="level1"><a href="#details">Detailed Description</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="sidebar-content" id="sidebar-content"></div></div>
|
|
<h1 class="title">CreateImportVideo Class</h1>
|
|
<span class="small-subtitle">class <a href="screenplay-module.html">ScreenPlay</a>::CreateImportVideo</span>
|
|
<!-- $$$CreateImportVideo-brief -->
|
|
<p>This class imports (copies) and creates wallaper previews. <a href="#details">More...</a></p>
|
|
<!-- @@@CreateImportVideo -->
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <CreateImportVideo></span>
|
|
</td></tr></table></div><ul>
|
|
<li><a href="screenplay-createimportvideo-members.html">List of all members, including inherited members</a></li>
|
|
</ul>
|
|
<a name="public-functions"></a>
|
|
<h2 id="public-functions">Public Functions</h2>
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#CreateImportVideo-2">CreateImportVideo</a></b>(const QString &<i>videoPath</i>, const QString &<i>exportPath</i>, const QString &<i>codec</i>, const int <i>quality</i>, QObject *<i>parent</i> = nullptr)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#CreateImportVideo-1">CreateImportVideo</a></b>(QObject *<i>parent</i> = nullptr)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> float </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#progress-prop">progress</a></b>() const</td></tr>
|
|
</table></div>
|
|
<a name="public-slots"></a>
|
|
<h2 id="public-slots">Public Slots</h2>
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#createWallpaperGifPreview">createWallpaperGifPreview</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#createWallpaperImagePreview">createWallpaperImagePreview</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#createWallpaperImageThumbnailPreview">createWallpaperImageThumbnailPreview</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#createWallpaperInfo">createWallpaperInfo</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#createWallpaperVideo">createWallpaperVideo</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#createWallpaperVideoPreview">createWallpaperVideoPreview</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#extractWallpaperAudio">extractWallpaperAudio</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#process">process</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#progress-prop">setProgress</a></b>(float <i>progress</i>)</td></tr>
|
|
</table></div>
|
|
<a name="signals"></a>
|
|
<h2 id="signals">Signals</h2>
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-createimportvideo.html#progress-prop">progressChanged</a></b>(float <i>progress</i>)</td></tr>
|
|
</table></div>
|
|
<a name="details"></a>
|
|
<!-- $$$CreateImportVideo-description -->
|
|
<div class="descr">
|
|
<h2 id="details">Detailed Description</h2>
|
|
<p>This lass only exsits as long as the user creates a wallpaper and gets destroyed if the creation was successful or not. The state get propagated via createWallpaperStateChanged(ImportVideoState state);</p>
|
|
</div>
|
|
<!-- @@@CreateImportVideo -->
|
|
<div class="func">
|
|
<h2>Member Function Documentation</h2>
|
|
<!-- $$$CreateImportVideo$$$CreateImportVideoconstQString&constQString&constQString&constintQObject* -->
|
|
<h3 class="fn" id="CreateImportVideo-2"><a name="CreateImportVideo-2"></a>CreateImportVideo::<span class="name">CreateImportVideo</span>(const <span class="type">QString</span> &<i>videoPath</i>, const <span class="type">QString</span> &<i>exportPath</i>, const <span class="type">QString</span> &<i>codec</i>, const <span class="type">int</span> <i>quality</i>, <span class="type">QObject</span> *<i>parent</i> = nullptr)</h3>
|
|
<p>Creates a CreateImportVideo object to be used in a different thread. A <i>videoPath</i> and a <i>exportPath</i> are needed for convertion.</p>
|
|
<!-- @@@CreateImportVideo -->
|
|
<!-- $$$CreateImportVideo$$$CreateImportVideoQObject* -->
|
|
<h3 class="fn" id="CreateImportVideo-1"><a name="CreateImportVideo-1"></a>CreateImportVideo::<span class="name">CreateImportVideo</span>(<span class="type">QObject</span> *<i>parent</i> = nullptr)</h3>
|
|
<p>This constructor is only needed for calling qRegisterMetaType on CreateImportVideo to register the enums.</p>
|
|
<pre class="cpp">qRegisterMetaType<span class="operator"><</span>CreateImportVideo<span class="operator">::</span>ImportVideoState<span class="operator">></span>(<span class="string">"CreateImportVideo::ImportVideoState"</span>);</pre>
|
|
<!-- @@@CreateImportVideo -->
|
|
<!-- $$$createWallpaperGifPreview[overload1]$$$createWallpaperGifPreview -->
|
|
<h3 class="fn" id="createWallpaperGifPreview"><a name="createWallpaperGifPreview"></a><code>[slot] </code><span class="type">bool</span> CreateImportVideo::<span class="name">createWallpaperGifPreview</span>()</h3>
|
|
<p>Starts ffmpeg and tries to covert the given video to a 5 second preview gif.</p>
|
|
<pre class="cpp"><span class="comment">//[...]</span>
|
|
args<span class="operator">.</span>append(<span class="string">"-filter_complex"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"[0:v] fps=12,scale=w=480:h=-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1"</span>);
|
|
args<span class="operator">.</span>append(m_exportPath <span class="operator">+</span> <span class="string">"/preview.gif"</span>);</pre>
|
|
<p>Returns <code>false</code> if :</p>
|
|
<ul>
|
|
<li>Cannot convert the video</li>
|
|
<li>Generally broken.</li>
|
|
</ul>
|
|
<!-- @@@createWallpaperGifPreview -->
|
|
<!-- $$$createWallpaperImagePreview[overload1]$$$createWallpaperImagePreview -->
|
|
<h3 class="fn" id="createWallpaperImagePreview"><a name="createWallpaperImagePreview"></a><code>[slot] </code><span class="type">bool</span> CreateImportVideo::<span class="name">createWallpaperImagePreview</span>()</h3>
|
|
<p>.</p>
|
|
<!-- @@@createWallpaperImagePreview -->
|
|
<!-- $$$createWallpaperImageThumbnailPreview[overload1]$$$createWallpaperImageThumbnailPreview -->
|
|
<h3 class="fn" id="createWallpaperImageThumbnailPreview"><a name="createWallpaperImageThumbnailPreview"></a><code>[slot] </code><span class="type">bool</span> CreateImportVideo::<span class="name">createWallpaperImageThumbnailPreview</span>()</h3>
|
|
<p>Starts ffmpeg and tries to covert the given video to a image preview. Returns <code>false</code> if :</p>
|
|
<ul>
|
|
<li>Cannot convert the video</li>
|
|
<li>Generally broken.</li>
|
|
</ul>
|
|
<!-- @@@createWallpaperImageThumbnailPreview -->
|
|
<!-- $$$createWallpaperInfo[overload1]$$$createWallpaperInfo -->
|
|
<h3 class="fn" id="createWallpaperInfo"><a name="createWallpaperInfo"></a><code>[slot] </code><span class="type">bool</span> CreateImportVideo::<span class="name">createWallpaperInfo</span>()</h3>
|
|
<p>Starts ffprobe and tries to parse the resulting json. If the video is a container that not contains the video length like webm or mkv we need to count the frames ourself. We then call analyzeWebmReadFrames or analyzeVideo to parse the output. Returns <code>false</code> if :</p>
|
|
<ul>
|
|
<li>Parsing the output json of ffprobe fails.</li>
|
|
<li>Has no video.</li>
|
|
<li>Cannot parse number of frames.</li>
|
|
<li>Is a wrong file format or generally broken.</li>
|
|
</ul>
|
|
<!-- @@@createWallpaperInfo -->
|
|
<!-- $$$createWallpaperVideo[overload1]$$$createWallpaperVideo -->
|
|
<h3 class="fn" id="createWallpaperVideo"><a name="createWallpaperVideo"></a><code>[slot] </code><span class="type">bool</span> CreateImportVideo::<span class="name">createWallpaperVideo</span>()</h3>
|
|
<p>Starts ffmpeg and tries to covert the given video to a webm video.</p>
|
|
<pre class="cpp"><span class="comment">//[...]</span>
|
|
args<span class="operator">.</span>append(<span class="string">"-c:v"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"libvpx-vp8"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"-crf"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"30"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"-pix_fmt"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"yuv420p"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"-b:v"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"0"</span>);</pre>
|
|
<p>Returns <code>false</code> if :</p>
|
|
<ul>
|
|
<li>Cannot convert the video</li>
|
|
<li>Generally broken.</li>
|
|
</ul>
|
|
<!-- @@@createWallpaperVideo -->
|
|
<!-- $$$createWallpaperVideoPreview[overload1]$$$createWallpaperVideoPreview -->
|
|
<h3 class="fn" id="createWallpaperVideoPreview"><a name="createWallpaperVideoPreview"></a><code>[slot] </code><span class="type">bool</span> CreateImportVideo::<span class="name">createWallpaperVideoPreview</span>()</h3>
|
|
<p>Starts ffmpeg and tries to covert the given video to a five second preview.</p>
|
|
<pre class="cpp"><span class="comment">//[...]</span>
|
|
args<span class="operator">.</span>append(<span class="string">"-vf"</span>);
|
|
<span class="comment">// We allways want to have a 5 second clip via 24fps -> 120 frames</span>
|
|
<span class="comment">// Divided by the number of frames we can skip (timeInSeconds * Framrate)</span>
|
|
<span class="comment">// scale & crop parameter: https://unix.stackexchange.com/a/284731</span>
|
|
args<span class="operator">.</span>append(<span class="string">"select='not(mod(n,"</span> <span class="operator">+</span> <span class="type">QString</span><span class="operator">::</span>number((m_length <span class="operator">/</span> <span class="number">5</span>)) <span class="operator">+</span> <span class="string">"))',setpts=N/FRAME_RATE/TB,crop=in_h*16/9:in_h,scale=-2:400"</span>);
|
|
<span class="comment">// Disable audio</span>
|
|
args<span class="operator">.</span>append(<span class="string">"-an"</span>);
|
|
args<span class="operator">.</span>append(m_exportPath <span class="operator">+</span> <span class="string">"/preview.webm"</span>);</pre>
|
|
<p>Returns <code>false</code> if :</p>
|
|
<ul>
|
|
<li>Cannot convert the video</li>
|
|
<li>Generally broken.</li>
|
|
</ul>
|
|
<!-- @@@createWallpaperVideoPreview -->
|
|
<!-- $$$extractWallpaperAudio[overload1]$$$extractWallpaperAudio -->
|
|
<h3 class="fn" id="extractWallpaperAudio"><a name="extractWallpaperAudio"></a><code>[slot] </code><span class="type">bool</span> CreateImportVideo::<span class="name">extractWallpaperAudio</span>()</h3>
|
|
<p>Starts ffmpeg and tries to covert the given audio into a seperate mp3.</p>
|
|
<pre class="cpp"><span class="comment">//[...]</span>
|
|
args<span class="operator">.</span>append(<span class="string">"mp3"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"-ab"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"192000"</span>);
|
|
args<span class="operator">.</span>append(<span class="string">"-vn"</span>);
|
|
args<span class="operator">.</span>append(m_exportPath <span class="operator">+</span> <span class="string">"/audio.mp3"</span>);</pre>
|
|
<p>Returns <code>false</code> if :</p>
|
|
<ul>
|
|
<li>Cannot convert the audio</li>
|
|
<li>Generally broken.</li>
|
|
</ul>
|
|
<!-- @@@extractWallpaperAudio -->
|
|
<!-- $$$process[overload1]$$$process -->
|
|
<h3 class="fn" id="process"><a name="process"></a><code>[slot] </code><span class="type">void</span> CreateImportVideo::<span class="name">process</span>()</h3>
|
|
<p>Processes the multiple steps of creating a wallpaper.</p>
|
|
<ol class="1" type="1"><li><a href="screenplay-createimportvideo.html#createWallpaperInfo">createWallpaperInfo</a>()</li>
|
|
<li><a href="screenplay-createimportvideo.html#createWallpaperImagePreview">createWallpaperImagePreview</a>()</li>
|
|
<li><a href="screenplay-createimportvideo.html#createWallpaperVideoPreview">createWallpaperVideoPreview</a>()</li>
|
|
<li><a href="screenplay-createimportvideo.html#createWallpaperGifPreview">createWallpaperGifPreview</a>()</li>
|
|
<li><a href="screenplay-createimportvideo.html#createWallpaperVideo">createWallpaperVideo</a>() - skiped if already a webm</li>
|
|
<li><a href="screenplay-createimportvideo.html#extractWallpaperAudio">extractWallpaperAudio</a>() - skiped if no audio</li>
|
|
<li>emit createWallpaperStateChanged(ImportVideoState::Finished);</li>
|
|
</ol>
|
|
<!-- @@@process -->
|
|
</div>
|
|
<div id= license class="footer center"><p>This documentation is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</p></div> <script src="../js/bootstrap.bundle.min.js"></script> <script src="../js/mermaid.min.js"></script> <script>var config = {startOnLoad:true,flowchart:{useMaxWidth:true,htmlLabels:true}};mermaid.initialize(config);</script></body>
|
|
</html>
|