comparison 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
comparison
equal deleted inserted replaced
241:9c2eec61a152 242:543df0fe7168
1 #ifndef FFMPEG_CLI_H
2 #define FFMPEG_CLI_H
3
4 #include <stdbool.h>
5
6 typedef enum {
7 FFMPEG_OK = 0,
8 FFMPEG_ERR_INPUT_NOT_FOUND = 1,
9 FFMPEG_ERR_OUTPUT_FAILED = 2,
10 FFMPEG_ERR_INVALID_ARGS = 3,
11 FFMPEG_ERR_PROCESS_FAILED = 4,
12 } FfmpegResult;
13
14 typedef enum {
15 FFMPEG_HLS_VP9_OPUS = 0,
16 FFMPEG_HLS_H264_AAC = 1,
17 } Fmp4HlsCodec;
18
19 typedef struct {
20 int segment_duration;
21 int video_bitrate;
22 int audio_bitrate;
23 int max_width;
24 int max_height;
25 bool include_audio;
26 bool use_mpeg_ts;
27 Fmp4HlsCodec codec;
28 } Fmp4HlsOpts;
29
30 Fmp4HlsOpts ffmpeg_fmp4_hls_opts_default(void);
31
32 FfmpegResult ffmpeg_video_to_fmp4_hls(
33 const char *input_path,
34 const char *output_dir,
35 const char *name,
36 const Fmp4HlsOpts *opts);
37
38 bool ffmpeg_is_available(void);
39 const char *ffmpeg_last_error(void);
40
41 #endif