diff third_party/ffmpeg/ffmpeg_cli.h @ 242:543df0fe7168

[tools] Add full HLS player support
author MrJuneJune <me@mrjunejune.com>
date Mon, 03 Aug 2026 13:14:41 -0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/third_party/ffmpeg/ffmpeg_cli.h	Mon Aug 03 13:14:41 2026 -0700
@@ -0,0 +1,41 @@
+#ifndef FFMPEG_CLI_H
+#define FFMPEG_CLI_H
+
+#include <stdbool.h>
+
+typedef enum {
+  FFMPEG_OK = 0,
+  FFMPEG_ERR_INPUT_NOT_FOUND = 1,
+  FFMPEG_ERR_OUTPUT_FAILED = 2,
+  FFMPEG_ERR_INVALID_ARGS = 3,
+  FFMPEG_ERR_PROCESS_FAILED = 4,
+} FfmpegResult;
+
+typedef enum {
+  FFMPEG_HLS_VP9_OPUS = 0,
+  FFMPEG_HLS_H264_AAC = 1,
+} Fmp4HlsCodec;
+
+typedef struct {
+  int segment_duration;
+  int video_bitrate;
+  int audio_bitrate;
+  int max_width;
+  int max_height;
+  bool include_audio;
+  bool use_mpeg_ts;
+  Fmp4HlsCodec codec;
+} Fmp4HlsOpts;
+
+Fmp4HlsOpts ffmpeg_fmp4_hls_opts_default(void);
+
+FfmpegResult ffmpeg_video_to_fmp4_hls(
+    const char *input_path,
+    const char *output_dir,
+    const char *name,
+    const Fmp4HlsOpts *opts);
+
+bool ffmpeg_is_available(void);
+const char *ffmpeg_last_error(void);
+
+#endif