Hello all,
I'm wondering if it's possible to use libav* to directly read data from
a DV (a Sony HDV, not IIDC) camera connected over FireWire. Or if not,
what would be the right library to use. I'm essentially trying to get
rgb arrays into my app.
Here's what I've tried:
1. At the moment, I already have everything set up to read a raw .dv
file output from dvgrab, which works marvelously:
$ dvgrab -frames 24 foo-
^C
$ ./myapp foo-
And it starts reading the files and works great.
2. I tried piping the data from dvgrab to stdout and reading it:
$ dvgrab - | mplayer - -demuxer lavf -lavfdopts format=dv
and
$ dvgrab - | xine -D stdin://#demux:rawdv
Both work marvelously. As far as I understand, both mplayer and xine
use ffmpeg/libav* as their backends, so I should be able to replicate
the functionality.
3. I tried using the code from Martin Boehme's webpage to directly read
/dev/dv1394 but didn't have any luck:
// ...
int retVal;
AVFormatContext* pFormatContext;
AVCodecContext* pCodecContext;
AVFormatParameters formatParams;
AVInputFormat* inputFormat;
formatParams.device = "/dev/dv1394";
formatParams.channel = 0;
formatParams.standard = "ntsc";
formatParams.width = 720;
formatParams.height = 480;
filename = "";
printf( "calling av_find_input_format\n" );
inputFormat = av_find_input_format( "dv1394" );
printf( "about to open file" );
retVal = av_open_input_file
(
&pFormatContext,
"",
inputFormat, 0, &formatParams
);
// ...
And I get an error message:
calling av_find_input_format
about to open file
Failed to open DV interface: No such file or directory
Am I on the right track?
4. Finally, I also tried using ffmpeg from the command line and I'm
getting a similar error. I'm following the commands from this
discussion:
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2007-July/032594.html
And am using the ffmpeg that's bundled with Ubuntu 8.04
$ sudo ffmpeg -f dv1394 -i /dev/dv1394/0 -f dv -acodec copy -vcodec copy
-y t1.avi
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler
--enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg
--enable-libgsm --enable-dc1394 --disable-debug --enable-shared
--prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Mar 12 2008 14:31:53, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu4)
Failed to initialize DV interface: Invalid argument
/dev/dv1394/0: I/O error occured
Usually that means that input file is truncated and/or corrupted.
$
Thanks,
Jiawen
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user