Originally committed as revision 1987 to svn://svn.ffmpeg.org/ffmpeg/trunk
static char *video_grab_format = "video4linux";
static char *video_device = NULL;
static int video_channel = 0;
static char *video_grab_format = "video4linux";
static char *video_device = NULL;
static int video_channel = 0;
+static char *video_standard = "ntsc";
static char *audio_grab_format = "audio_device";
static char *audio_device = NULL;
static char *audio_grab_format = "audio_device";
static char *audio_device = NULL;
video_channel = strtol(arg, NULL, 0);
}
video_channel = strtol(arg, NULL, 0);
}
+static void opt_video_standard(const char *arg)
+{
+ video_standard = av_strdup(arg);
+}
+
static void opt_audio_device(const char *arg)
{
audio_device = av_strdup(arg);
static void opt_audio_device(const char *arg)
{
audio_device = av_strdup(arg);
fmt1 = av_find_input_format(video_grab_format);
vp->device = video_device;
vp->channel = video_channel;
fmt1 = av_find_input_format(video_grab_format);
vp->device = video_device;
vp->channel = video_channel;
+ vp->standard = video_standard;
if (av_open_input_file(&ic, "", fmt1, 0, vp) < 0) {
fprintf(stderr, "Could not find video grab device\n");
exit(1);
if (av_open_input_file(&ic, "", fmt1, 0, vp) < 0) {
fprintf(stderr, "Could not find video grab device\n");
exit(1);
{ "bufsize", HAS_ARG, {(void*)opt_video_buffer_size}, "set ratecontrol buffere size (in kbit)", "size" },
{ "vd", HAS_ARG | OPT_EXPERT, {(void*)opt_video_device}, "set video grab device", "device" },
{ "vc", HAS_ARG | OPT_EXPERT, {(void*)opt_video_channel}, "set video grab channel (DV1394 only)", "channel" },
{ "bufsize", HAS_ARG, {(void*)opt_video_buffer_size}, "set ratecontrol buffere size (in kbit)", "size" },
{ "vd", HAS_ARG | OPT_EXPERT, {(void*)opt_video_device}, "set video grab device", "device" },
{ "vc", HAS_ARG | OPT_EXPERT, {(void*)opt_video_channel}, "set video grab channel (DV1394 only)", "channel" },
+ { "tvstd", HAS_ARG | OPT_EXPERT, {(void*)opt_video_standard}, "set television standard (NTSC, PAL (SECAM))", "standard" },
{ "dv1394", OPT_EXPERT, {(void*)opt_dv1394}, "set DV1394 grab", "" },
{ "vcodec", HAS_ARG | OPT_EXPERT, {(void*)opt_video_codec}, "force video codec ('copy' to copy stream)", "codec" },
{ "me", HAS_ARG | OPT_EXPERT, {(void*)opt_motion_estimation}, "set motion estimation method",
{ "dv1394", OPT_EXPERT, {(void*)opt_dv1394}, "set DV1394 grab", "" },
{ "vcodec", HAS_ARG | OPT_EXPERT, {(void*)opt_video_codec}, "force video codec ('copy' to copy stream)", "codec" },
{ "me", HAS_ARG | OPT_EXPERT, {(void*)opt_motion_estimation}, "set motion estimation method",
struct AVImageFormat *image_format;
int channel; /* used to select dv channel */
const char *device; /* video4linux, audio or DV device */
struct AVImageFormat *image_format;
int channel; /* used to select dv channel */
const char *device; /* video4linux, audio or DV device */
+ const char *standard; /* tv standard, NTSC, PAL, SECAM */
} AVFormatParameters;
#define AVFMT_NOFILE 0x0001 /* no file should be opened */
} AVFormatParameters;
#define AVFMT_NOFILE 0x0001 /* no file should be opened */
- /* FIXME: Need a format change parameter */
- dv->format = DV1394_NTSC;
+ if (ap->standard && !strcasecmp(ap->standard, "pal"))
+ dv->format = DV1394_PAL;
+ else
+ dv->format = DV1394_NTSC;
if (ap->channel)
dv->channel = ap->channel;
if (ap->channel)
dv->channel = ap->channel;
int video_fd, frame_size;
int ret, frame_rate, frame_rate_base;
int desired_palette;
int video_fd, frame_size;
int ret, frame_rate, frame_rate_base;
int desired_palette;
+ struct video_tuner tuner;
struct video_audio audio;
const char *video_device;
struct video_audio audio;
const char *video_device;
} else if (st->codec.pix_fmt == PIX_FMT_BGR24) {
desired_palette = VIDEO_PALETTE_RGB24;
}
} else if (st->codec.pix_fmt == PIX_FMT_BGR24) {
desired_palette = VIDEO_PALETTE_RGB24;
}
+
+ /* set tv standard */
+ if (ap->standard && !ioctl(video_fd, VIDIOCGTUNER, &tuner)) {
+ if (!strcasecmp(ap->standard, "pal"))
+ tuner.mode = VIDEO_MODE_PAL;
+ else if (!strcasecmp(ap->standard, "secam"))
+ tuner.mode = VIDEO_MODE_SECAM;
+ else
+ tuner.mode = VIDEO_MODE_NTSC;
+ ioctl(video_fd, VIDIOCSTUNER, &tuner);
+ }
/* unmute audio */
audio.audio = 0;
/* unmute audio */
audio.audio = 0;