Is there a way to pipe output files from FFPEG directly into MAGICK CONVERT?
I want to take the output frames then average them without making hundreds of intermediate files.
(working on a PC)
This example fails ERROR MESSAGE: Unable to find a suitable output format for 'pipe:1'
ffmpeg -i MDI_3434.avi -vf fps=1 pipe:1 | magick convert - -average test3.png
Thanks for your help
pipe ffmpeg output to magick
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: pipe ffmpeg output to magick
"-average" is deprecated. You should use "-evaluate-sequence mean". For example:
Code: Select all
ffmpeg -r 1 -i 2.avi -r 1 -c:v pam -f image2pipe pipe:1 | magick - -evaluate-sequence mean x1_%06d.png
snibgo's IM pages: im.snibgo.com
Re: pipe ffmpeg output to magick
The suggested code only pipes the first image. I need to pipe all images in order to compute the mean.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: pipe ffmpeg output to magick
I get all the frames. To demonstrate this, insert "+write info:" after the "-" for magick's input:
This creates text output from magick that starts:
The result of "-evaluate-sequence mean" is only one image, of course. If you remove "-evaluate-sequence mean" you will get all frames as PNG files.
Code: Select all
ffmpeg -r 1 -i 2.avi -r 1 -c:v pam -f image2pipe pipe:1 | magick - +write info: -evaluate-sequence mean x1_%06d.png
Code: Select all
-[0] PAM 960x540 960x540+0+0 8-bit TrueColor sRGB 0.016u 0:00.016
-[1] PAM 960x540 960x540+0+0 8-bit TrueColor sRGB 0.016u 0:00.031
-[2] PAM 960x540 960x540+0+0 8-bit TrueColor sRGB 0.016u 0:00.031
-[3] PAM 960x540 960x540+0+0 8-bit TrueColor sRGB 0.016u 0:00.047
-[4] PAM 960x540 960x540+0+0 8-bit TrueColor sRGB 0.016u 0:00.062
-[5] PAM 960x540 960x540+0+0 8-bit TrueColor sRGB 0.016u 0:00.062
snibgo's IM pages: im.snibgo.com