diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2003-01-23 18:44:26 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-01-23 18:44:26 +0000 |
commit | a5df11ab1e0e2c4bc4218a6543f6dfaf7169d4e4 (patch) | |
tree | dca1f67007c2d39e22797537144681190ee7e77a | |
parent | 7f172339fdcdeb0393c1a296da95acb6fc57d3b8 (diff) | |
download | ffmpeg-streaming-a5df11ab1e0e2c4bc4218a6543f6dfaf7169d4e4.zip ffmpeg-streaming-a5df11ab1e0e2c4bc4218a6543f6dfaf7169d4e4.tar.gz |
dv1394 channel selection by Max Krasnyansky - modified channel number to be in base 10 by default
Originally committed as revision 1500 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | ffmpeg.c | 11 | ||||
-rw-r--r-- | libavformat/dv1394.c | 6 |
2 files changed, 14 insertions, 3 deletions
@@ -160,6 +160,7 @@ static int video_stream_copy = 0; static char *video_grab_format = "video4linux"; static char *video_device = NULL; +static int video_channel = 0; static char *audio_grab_format = "audio_device"; static char *audio_device = NULL; @@ -1872,6 +1873,11 @@ void opt_video_device(const char *arg) video_device = strdup(arg); } +void opt_video_channel(const char *arg) +{ + video_channel = strtol(arg, NULL, 0); +} + void opt_audio_device(const char *arg) { audio_device = strdup(arg); @@ -2463,8 +2469,8 @@ void prepare_grab(void) if (has_video) { AVInputFormat *fmt1; fmt1 = av_find_input_format(video_grab_format); - vp->device = video_device; - /* XXX: set DV video channel ? */ + vp->device = video_device; + vp->channel = video_channel; if (av_open_input_file(&ic, "", fmt1, 0, vp) < 0) { fprintf(stderr, "Could not find video grab device\n"); exit(1); @@ -2723,6 +2729,7 @@ const OptionDef options[] = { { "minrate", HAS_ARG, {(void*)opt_video_bitrate_min}, "set min video bitrate tolerance (in kbit/s)", "bitrate" }, { "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" }, { "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", diff --git a/libavformat/dv1394.c b/libavformat/dv1394.c index f0b5e8d..2c70827 100644 --- a/libavformat/dv1394.c +++ b/libavformat/dv1394.c @@ -84,7 +84,11 @@ static int dv1394_read_header(AVFormatContext * context, AVFormatParameters * ap dv->width = DV1394_WIDTH; dv->height = DV1394_HEIGHT; - dv->channel = ap->channel; + + if (ap->channel) + dv->channel = ap->channel; + else + dv->channel = DV1394_DEFAULT_CHANNEL; dv->frame_rate = 30; |