<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/insteon.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/insteon.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/medialibrary.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/medialibrary.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1579853532996" duration="4655000" />
<workItem from="1580059999939" duration="6428000" />
<workItem from="1580372411103" duration="5070000" />
- <workItem from="1580457212034" duration="169000" />
- </task>
- <task id="LOCAL-00235" summary=".">
- <created>1571209734092</created>
- <option name="number" value="00235" />
- <option name="presentableId" value="LOCAL-00235" />
- <option name="project" value="LOCAL" />
- <updated>1571209734093</updated>
+ <workItem from="1580457212034" duration="849000" />
</task>
<task id="LOCAL-00236" summary=".">
<created>1571574019434</created>
<option name="project" value="LOCAL" />
<updated>1580377820163</updated>
</task>
- <option name="localTasksCounter" value="284" />
+ <task id="LOCAL-00284" summary=".">
+ <created>1580457418659</created>
+ <option name="number" value="00284" />
+ <option name="presentableId" value="LOCAL-00284" />
+ <option name="project" value="LOCAL" />
+ <updated>1580457418659</updated>
+ </task>
+ <option name="localTasksCounter" value="285" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
</state>
<state x="720" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577298128269" />
<state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1579773503974" />
- <state x="935" y="114" key="CommitChangelistDialog2" timestamp="1580377804997">
+ <state x="935" y="114" key="CommitChangelistDialog2" timestamp="1580458186654">
<screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="701" y="114" key="CommitChangelistDialog2/0.0.1920.1040@0.0.1920.1040" timestamp="1577381105204" />
<state x="701" y="127" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1575647157027" />
- <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1580377804997" />
+ <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1580458186654" />
<state x="92" y="92" width="2376" height="856" key="DiffContextDialog" timestamp="1580377344165">
<screen x="0" y="0" width="2560" height="1040" />
</state>
/** @var SplFileInfo $item */
$path = $item->getRealPath();
$to = preg_replace('/\.' . $item->getExtension() . '$/', '.x264.' . $item->getExtension(), $path);
- if (file_exists($to)) {
+ if (file_exists($to) && videosHaveSameDuration($path, $to)) {
continue;
}
echo 'no file to transcode';
}
+function videosHaveSameDuration($v1, $v2, $tolerance = 10)
+{
+ return abs(getVideoDuration($v1) - getVideoDuration($v2)) < $tolerance;
+}
+
function nasToAvion($path)
{
$path = str_replace('/volume1/Share/', 'Z:/', $path);
setState($cacheKey, $res);
}
return $res;
+}
+
+function getVideoDuration($path)
+{
+ $cacheKey = 'duration_4_' . md5($path . '-' . filemtime($path));
+ $res = getState($cacheKey, null);
+ if (null === $res) {
+ $res = `ffprobe -i "$path" -show_entries format=duration -v quiet -of csv="p=0"`;
+ setState($cacheKey, $res);
+ }
+ return $res;
}
\ No newline at end of file
['type' => 'ecomode', 'mode' => '0'],
['type' => 'insteon', 'command' => '0?1111=I=0=0'],
['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
- ['type' => 'hue', 'group' => $bureau, 'scene' => 'Ntv7DDEMGtuYA9L'],
- ['type' => 'scene', 'scene' => 'chambre/off/exceptcheminee'],
-
],
'salon/tamise' => [
['type' => 'ecomode', 'mode' => '0'],