Go to the documentation of this file.
29 fprintf(stderr,
"%s [-b bytespersec] [-d duration] [-oi <options>] [-oo <options>] input_url output_url\n", argv0);
30 fprintf(stderr,
"<options>: AVOptions expressed as key=value, :-separated\n");
34 int main(
int argc,
char **argv)
37 const char *input_url =
NULL, *output_url =
NULL;
38 int64_t stream_pos = 0;
47 for (
i = 1;
i < argc;
i++) {
48 if (!strcmp(argv[
i],
"-b") &&
i + 1 < argc) {
49 bps = atoi(argv[
i + 1]);
51 }
else if (!strcmp(argv[
i],
"-d") &&
i + 1 < argc) {
54 }
else if (!strcmp(argv[
i],
"-oi") &&
i + 1 < argc) {
56 fprintf(stderr,
"Cannot parse option string %s\n",
58 return usage(argv[0], 1);
61 }
else if (!strcmp(argv[
i],
"-oo") &&
i + 1 < argc) {
63 fprintf(stderr,
"Cannot parse option string %s\n",
65 return usage(argv[0], 1);
68 }
else if (!input_url) {
70 }
else if (!output_url) {
73 return usage(argv[0], 1);
77 return usage(argv[0], 1);
82 fprintf(stderr,
"Unable to open %s: %s\n", input_url, errbuf);
89 fprintf(stderr,
"Unable to get size of %s: %s\n", input_url, errbuf);
97 fprintf(stderr,
"Unable to open %s: %s\n", output_url, errbuf);
111 fprintf(stderr,
"Unable to write %s: %s\n", output_url, errbuf);
int64_t av_gettime_relative(void)
Get the current time in microseconds since some unspecified starting point.
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
int main(int argc, char **argv)
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
int64_t avio_size(AVIOContext *s)
Get the filesize.
int avio_open2(AVIOContext **s, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
Create and initialize a AVIOContext for accessing the resource indicated by url.
int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
Put a description of the AVERROR code errnum in errbuf.
int avformat_network_init(void)
Do global initialization of network libraries.
#define AVIO_FLAG_WRITE
write-only
int av_usleep(unsigned usec)
Sleep for a period of time.
static int usage(const char *argv0, int ret)
static int64_t start_time
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
#define i(width, name, range_min, range_max)
#define AV_TIME_BASE
Internal time base represented as integer.
int avformat_network_deinit(void)
Undo the initialization done by avformat_network_init.
int av_dict_parse_string(AVDictionary **pm, const char *str, const char *key_val_sep, const char *pairs_sep, int flags)
Parse the key/value pairs list and add the parsed entries to a dictionary.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AVIO_FLAG_READ
read-only
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.