[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

ffmpeg - piped input (from dvgrab) problem




Hi,

I need to capture analog video and convert to mpeg 'on the fly'.  I am trying to use hardware that I currently have, which includes a canopus ADCV-100 capture device, and a PC running debian linux (sid).  I need a command line interface (or something that can be easily scripted, and I discovered dvgrab and ffmpeg in my googling.   Seemed like this should be do-able, so I installed a 1394 capture card in the PC and began.  Initially, I installed the 2.6.10 kernel (a debian build), but found (googling) that there were some problems with that (which I was experiencing as well), so I reverted to a 2.4 kernel.


To date, I have been able to capture the video and store to a file:

dvgrab foo- (which stores .avi files in the default format (.avi) and the default size (1GB) ...

I can view them (using vlc or xine) as well as convert these files to mpg files without problems, as in:

ffmpeg -i foo-001.avi -target vcd foo-001.mpg

Again checking that the results are viewable from vlc and xine.

My final step (for now; before the next final step : ) ) is to pipe the output of the dvgrab to ffmpeg to generate the mpg file.  I was thinking something along the lines of:

dvgrab - | ffmpeg -i - -target vcd foo-001.mpg

realizing I may have to adjust durations, etc. (I'm not sure how ffmpeg will name the files, or for that matter, if dvgrab will split the files if it is piping to stdout.  It's a detail I'll have to work.)

However, this did not work.  I get:

pipe:: Unknown format
Capture Started

(looks like the canopus starts to capture for 3 or 4 seconds, then everything quits, and I'm back to a command prompt.

So, I try specifying the format:

dvgrab - | ffmpeg -f avi -i - -target vcd foo-001.mpg

but now, I get:

pipe:  Error while opening file
Capture started

(same behavior from the canopus and command shell).



I then backed up and tried piping the output of the avi file I captured to ffmpeg (again, from a command line, specifying '-i filename', all is well).

cat foo-001.avi | ffmpeg -i - -target vcd foo-001.mpg

This command starts and finishes very quickly (too quickly).  foo-001.mpg is an empty file.  No change if I specify the format (-f option) as above.

Just to check my syntax and procedure, I took the file I converted to mpg (ffmpeg -i foo-001.avi -target vcd foo-001.mpg) and pipe it back through ffmpeg:

cat foo-001.mpg | ffmpeg -i - -target dvd foo-001a.mpg

and find that this works fine.


I have tried other formats from dvgrab (dv1, dv2, raw, ...), and then indicating that format for ffmpeg, but thusfar without success.



(Grasping for straws), I've also tried using a named pipe, not knowing exactly how, but this is what I tried:

mkfifo vidbuff.avi
cat foo-001.avi > vidbuff.avi | ffmpeg -i - -target vcd foo-001.mpg

This just sits, as if it's waiting for input somewhere.  There is probably something wrong with my syntax here, but I'm not even sure it should be needed.  




(Potentially) Relevant additional information -

ffmpeg installation - from debian cvs20050121
dvgrab - debian package (1.7-1)

Here is an output from ffmpeg which indicates build information.  

jlb@elm:~/capture/geo_20-21$ ffmpeg -i geo_2021-001.dv -target vcd geo_2021-001.mpg
ffmpeg version 0.4.9-pre1, build 4738, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --build i386-linux --enable-gpl --enable-pp --enable-zlib --enable-vorbis --enable-a52 --enable-dts --disable-mmx --disable-debug --prefix=/usr
  built on Jan 21 2005 19:24:19, gcc: 3.3.5 (Debian 1:3.3.5-6)


Any help you can provide would be greatly appreciated.  From the posts I have read, it seems like this should be a do-able thing.  Initially I was afraid the processor would not keep up, but it seems that ffmpeg is very fast, as indicated in the posts, and confirmed by my tests (converting a file is completed in less than real time (75% or so)), so it seems reasonable.  I know I may be able to use a hardware mpeg encoder, but I like the flexibility the canopus device gives me.

Thanks in advance.
Jerry
Reply to: