0

I am now engaged in ffmpeg / node.js 8.9.4. I am to write a js script which converts a video stream into a raw image file and keeps on overwriting it. At the same time I'd like to get the sequential number of the frame from the begining of the convert process.

This program keeps on overwriting an image file, and other process is called to get this image file and its sequential number.

The ffmpeg option I wrote is below.

const ffmpeg = child_process.spawn('ffmpeg',[
    "-i", stream_url,
    "-rtsp_transport", "http",
    "-pxm_fmt", 'rgb24',
    "foobar.bmp"
]);

I know output file name option like "%05d" but I don't want to produce many image files.

Is it possible to get the sequential number of this outputted "foobar.bmp" by ffmpeg?

additional

I also found "drawtext=text=%{n}" option. This seems what I would like to get but I don't want to draw in the picture. How can I get the value into a variable?

mogami74
  • 25
  • 6
  • I don't get, what your goal ist. Could you make an example of the output (filenames and what happens to them)? – Business Tomcat Mar 03 '18 at 08:21
  • What I would like to get is, - raw image data(or its file path) - corresponding frame number (0 at the frirst frame) – mogami74 Mar 04 '18 at 10:50
  • I found some more info and gave up this attempt to get frame number. [video \- Fetch frame count with ffmpeg \- Stack Overflow](https://stackoverflow.com/questions/2017843/fetch-frame-count-with-ffmpeg) [FFmpeg\-users \- How to output real frame number instead of sequentially added image numbers](http://www.ffmpeg-archive.org/How-to-output-real-frame-number-instead-of-sequentially-added-image-numbers-td4656645.html) – mogami74 Mar 20 '18 at 22:55

0 Answers0