<p>Remove the pipe character.</p>
<p><code>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</code></p>
<p>(mp3 is not standard in MP4 so let ffmpeg pick the default audio codec)</p>

CC BY-SA 4.0
2021-02-09T17:28:38.123Z
2021-02-09T17:28:38.123Z
Gyan
<p>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.</p>
<ul>
<li>Output no. 1: raw AVI file, for further editing</li>
<li>Output no. 2: preview mp4 file, to work as a preview within an embedded VideoJS player on an webapp.</li>
</ul>
<p>Here's my command:</p>
<pre><code>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
</code></pre>
<p>The command above doesn't seem to work for me. Where have I gone wrong?</p>

CC BY-SA 4.0
2021-02-09T15:20:22.677Z
*doesn't seem to work * --> what's wrong?
Gyan
CC BY-SA 4.0
2021-02-09T15:34:54.070Z
Using this command makes output 1 generate nice and smooth, while output 2 doesn't generate at all.
Radek
<ffmpeg>
ffmpeg - one input, two outputs - separate instances
Radek
# ffmpeg - one input, two outputs - separate instances

(Asked by: username_0 on 2021-02-09)

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?

**Tags:** ffmpeg

> **Comments:**
> **username_1**: *doesn't seem to work * --> what's wrong?  
> **username_0**: Using this command makes output 1 generate nice and smooth, while output 2 doesn't generate at all.  

---

## 1 answers

### Answer by username_1 on 2021-02-09. Score: 1

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)


---

