π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
pprobe
Manav Rathief6e4ebbcd05
diff --git a/desktop/src/main/services/ffmpeg.ts b/desktop/src/main/services/ffmpeg.tsindex 556943f8da..7171ba4eab 100644--- a/desktop/src/main/services/ffmpeg.ts+++ b/desktop/src/main/services/ffmpeg.ts@@ -158,6 +158,10 @@ export const ffmpegGenerateHLSPlaylistAndSegments = async (inputFilePath: string,outputPathPrefix: string,): Promise<FFmpegGenerateHLSPlaylistAndSegmentsResult> => {+ // Determine the input colorspace.+ const test = await pseudoFFProbeVideo(inputFilePath);+ console.log(test);+// We want the generated playlist to refer to the chunks as "output.ts".//// So we arrange things accordingly: We use the `outputPathPrefix` as our@@ -291,3 +295,36 @@ export const ffmpegGenerateHLSPlaylistAndSegments = async (return { playlistPath, videoPath };};++/**+ * We don't have the ffprobe binary at hand, so we make do by grepping the log+ * output of ffmpeg.+ *+ * > [ffmpeg update caution]+ * >+ * > Needless to say, while this works currently, this is liable to break in the+ * > future. So if something stops working after updating ffmpeg, look here!+ *+ * @returns the stderr of ffmpeg after running it on the input file. The exact+ * command we run is:+ *+ * ffmpeg -i in.mov -an -frames:v 0 -f null - 2>info.txt+ *+ * And the returned string is the contents of the `info.txt` thus produced.+ */+const pseudoFFProbeVideo = async (videoPath: string) => {+ const command = [+ ffmpegPathPlaceholder,+ ["-i", inputPathPlaceholder],+ "-an",+ ["-frames:v", "0"],+ ["-f", "null"],+ "-",+ ].flat();++ const cmd = substitutePlaceholders(command, videoPath, /* NA */ "");++ const { stderr } = await execAsync(cmd);++ return stderr;+};diff --git a/desktop/src/main/utils/temp.ts b/desktop/src/main/utils/temp.tsindex 0e2deba8cc..ab9b602aac 100644--- a/desktop/src/main/utils/temp.ts+++ b/desktop/src/main/utils/temp.ts@@ -25,12 +25,16 @@ const randomPrefix = () => {};/**- * Return the path to a temporary file with the given {@link suffix}.+ * Return the path to a temporary file with an optional {@link extension}.** The function returns the path to a file in the system temp directory (in an* Ente specific folder therin) with a random prefix and an (optional)* {@link extension}. The parent directory is guaranteed to exist.*+ * @param extension A string, if provided, is used as the extension for the+ * generated path. It will be automatically prefixed by a dot, so don't include+ * the dot in the provided string.+ ** It ensures that there is no existing item with the same name already.** Use {@link deleteTempFile} to remove this file when you're done.