ffmpeg - one input, two outputs - separate instances I've been struggling with a ffmpeg-related issue for a few days now.
What I am trying to accomplish is to grab AV signal from a single input (/dev/video0), then save it into two files simultaneously.

Output no. 1: raw AVI file, for further editing
Output no. 2: preview mp4 file, to work as a preview within an embedded VideoJS player on an webapp.

Here's my command:
ffmpeg -f v4l2 -standard PAL -i /dev/video0 -f alsa -thread_queue_size 512 -i hw:0,0 -preset superfast -crf 25 -r 25 -aspect 4:3 -acodec libmp3lame -b:v 6M -b:a 128k -channels 2 -ar 48000 /vids/vid1.avi | -acodec libmp3lame  -b:v 500k -b:a 128k -channels 2 -ar 48000 -y /opt/lampp/htdocs/preview.mp4

The command above doesn't seem to work for me. Where have I gone wrong?
Remove the pipe character.
ffmpeg -f v4l2 -standard PAL -i /dev/video0 -f alsa -thread_queue_size 512 -i hw:0,0 -preset superfast -crf 25 -r 25 -aspect 4:3 -acodec libmp3lame -b:v 6M -b:a 128k -ac 2 -ar 48000 /vids/vid1.avi -b:v 500k -b:a 128k -ac 2 -ar 48000 -y /opt/lampp/htdocs/preview.mp4
(mp3 is not standard in MP4 so let ffmpeg pick the default audio codec)