0

I'm trying to convert a .mov file to an in-memory mp4, then to a final GIF output with a single ffmpeg command:

ffmpeg -t 22 -i "select image and zoom.mov" -f mp4 - | ffmpeg -vf "fps=10,scale=320:-1:flags=lanczos,setpts=0.7*PTS,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "select image and zoom.gif" 

but am running into:

muxer does not support non seekable output
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 -- 

This thread suggests mp4 cannot be piped like this. Is this still the case? Am I left with actually writing an intermediary file using bash's && option?

Martim Passos
  • 137
  • 1
  • 12

1 Answers1

0

Is there a reason you cannot just do this?

ffmpeg -t 22 -i "select image and zoom.mov" \
  -vf "fps=10,scale=320:-1:flags=lanczos,setpts=0.7*PTS,split[s0][s1];\
       [s0]palettegen[p];[s1][p]paletteuse" \
  -loop 0 "select image and zoom.gif"

But if you must pipe, no, you cannot use mp4 container, but you can use MKV

kesh
  • 4,515
  • 2
  • 12
  • 20
  • I don't know exactly why, but GIFs made from MOV files have a weird bitmap quality to them no matter how I fine tune the palette settings. I'll try MKV though! – Martim Passos Mar 15 '22 at 02:08