* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define HAVE_AV_CONFIG_H
+
#include <signal.h>
#include <limits.h>
#include "avformat.h"
static int rate_emu = 0;
static int video_channel = 0;
-static char *video_standard = "ntsc";
+static char *video_standard;
static int audio_volume = 256;
int opt_name_count=0;
AVCodecContext *avctx_opts[CODEC_TYPE_NB];
AVFormatContext *avformat_opts;
+struct SwsContext *sws_opts;
static int64_t timer_start = 0;
static AVBitStreamFilterContext *video_bitstream_filters=NULL;
fprintf(stderr, "Cannot allocate temp picture, check pix fmt\n");
exit(1);
}
+ if (ENABLE_SWSCALER)
+ sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
ost->img_resample_ctx = sws_getContext(
icodec->width - (frame_leftBand + frame_rightBand),
icodec->height - (frame_topBand + frame_bottomBand),
}
}
+void list_pix_fmts(void)
+{
+ int i;
+ char pix_fmt_str[128];
+ for (i=-1; i < PIX_FMT_NB; i++) {
+ avcodec_pix_fmt_string (pix_fmt_str, sizeof(pix_fmt_str), i);
+ fprintf(stdout, "%s\n", pix_fmt_str);
+ }
+}
static void opt_frame_pix_fmt(const char *arg)
{
- frame_pix_fmt = avcodec_get_pix_fmt(arg);
+ if (strcmp(arg, "list"))
+ frame_pix_fmt = avcodec_get_pix_fmt(arg);
+ else {
+ list_pix_fmts();
+ exit(0);
+ }
}
static void opt_frame_aspect_ratio(const char *arg)
}
printf("\n\n");
printf(
-"Note, the names of encoders and decoders dont always match, so there are\n"
+"Note, the names of encoders and decoders do not always match, so there are\n"
"several cases where the above table shows encoder only or decoder only entries\n"
-"even though both encoding and decoding are supported for example, the h263\n"
-"decoder corresponds to the h263 and h263p encoders, for file formats its even\n"
-"worse\n");
+"even though both encoding and decoding are supported. For example, the h263\n"
+"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
+"worse.\n");
exit(1);
}
}
if(!o)
o = av_set_string(avformat_opts, opt, arg);
+ if(ENABLE_SWSCALER && !o)
+ o = av_set_string(sws_opts, opt, arg);
if(!o){
if(opt[0] == 'a')
o = av_set_string(avctx_opts[CODEC_TYPE_AUDIO], opt+1, arg);
{ "r", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_rate}, "set frame rate (Hz value, fraction or abbreviation)", "rate" },
{ "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" },
{ "aspect", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_aspect_ratio}, "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)", "aspect" },
- { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_frame_pix_fmt}, "set pixel format", "format" },
+ { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_frame_pix_fmt}, "set pixel format, 'list' as argument shows all the pixel formats supported", "format" },
{ "croptop", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop_top}, "set top crop band size (in pixels)", "size" },
{ "cropbottom", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop_bottom}, "set bottom crop band size (in pixels)", "size" },
{ "cropleft", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop_left}, "set left crop band size (in pixels)", "size" },
exit(1);
}
+/**
+ * Trivial log callback.
+ * Only suitable for show_help and similar since it lacks prefix handling.
+ */
+static void log_callback_help(void* ptr, int level, const char* fmt, va_list vl)
+{
+ vfprintf(stdout, fmt, vl);
+}
+
static void show_help(void)
{
+ av_log_set_callback(log_callback_help);
show_banner();
printf("usage: ffmpeg [[infile options] -i infile]... {[outfile options] outfile}...\n"
"Hyper fast Audio and Video encoder\n");
OPT_EXPERT);
av_opt_show(avctx_opts[0], NULL);
av_opt_show(avformat_opts, NULL);
+ if (ENABLE_SWSCALER)
+ av_opt_show(sws_opts, NULL);
exit(1);
}
avctx_opts[i]= avcodec_alloc_context2(i);
}
avformat_opts = av_alloc_format_context();
+ if (ENABLE_SWSCALER)
+ sws_opts = sws_getContext(16,16,0, 16,16,0, sws_flags, NULL,NULL,NULL);
if (argc <= 1)
show_help();
av_free(opt_names);
+ av_free(video_standard);
+
#ifdef CONFIG_POWERPC_PERF
extern void powerpc_display_perf_report(void);
powerpc_display_perf_report();