92 printf(
"%s (%s, %s)\n", url, fmp4 ?
"fmp4" :
"mpegts",
93 single_file ?
"single file" :
"segments");
108 static const char *
const urls[] = {
109 "https://example.ffmpeg",
110 "https://example.ffmpeg/",
111 "https://user.name:password@example.ffmpeg:8443/dir.name/output",
112 "https://example.ffmpeg/dir.name/output.m3u8",
113 "https://example.ffmpeg/dir.name/output.m3u8?token=foo.bar",
114 "https://example.ffmpeg/dir.name/output.m3u8#foo.bar",
115 "https://example.ffmpeg/dir.name/output.m3u8?token=foo.bar#baz.qux",
117 "dir.name/output.m3u8",
124 "foo.m3u8?token=foo.bar",
125 "file:foo.m3u8?token=foo.bar",
126 "dir#tag/output.m3u8",
127 "dir?tag/output.m3u8",
128 "file:dir#tag/output.m3u8",
129 "file:dir?tag/output.m3u8",
131 static const char *
const file_urls[] = {
132 "capture_1:take#2/output.m3u8",
133 "capture_1:take?2/output.m3u8",
134 "my video:dir#tag/output.m3u8",
135 "my video:dir?tag/output.m3u8",
136 "file://[dir/output.m3u8",
137 "crypto:file:dir#tag/output.m3u8",
138 "crypto+file:dir?tag/output.m3u8",
139 "crypto:dir#tag/output.m3u8",
140 "crypto:dir?tag/output.m3u8",
141 "crypto:crypto+file:dir#tag/output.m3u8",
142 "crypto+crypto:file:dir?tag/output.m3u8",
143 "crypto:capture_1:take#2/output.m3u8",
144 "crypto+file://[dir/output.m3u8",
146 const char *
const *test_urls = urls;
150 if (argc == 2 && !strcmp(argv[1],
"file")) {
151 test_urls = file_urls;
153 }
else if (argc != 1) {
154 fprintf(stderr,
"Usage: %s [file]\n", argv[0]);
160 for (
int i = 0;
i < nb_urls;
i++) {
161 for (
int single_file = 0; single_file < 2; single_file++) {
162 for (
int fmp4 = 0; fmp4 < 2; fmp4++) {
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
__device__ int printf(const char *,...)
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
av_warn_unused_result int avformat_write_header(AVFormatContext *s, AVDictionary **options)
Allocate the stream private data and write the stream header to an output media file.
int av_write_trailer(AVFormatContext *s)
Write the stream trailer to an output media file and free the file private data.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_log_set_level(int level)
Set the log level.
#define FF_ARRAY_ELEMS(a)
int height
The height of the video frame in pixels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
char * url
input or output URL.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
VariantStream * var_streams
AVFormatContext * vtt_avf
static int io_open(AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options)
static int test_filename(const char *url, int single_file, int fmp4)
static int io_close(AVFormatContext *s, AVIOContext *pb)