<p><code>sine</code> is a source <em>filter</em>, so the input format needs to be set as a filter using <code>-f lavfi</code>.</p>

<p>Use</p>

<pre><code>ffmpeg -re -loop 1 -i smpte-color-bars-1080p.png -re -f lavfi -i sine=frequency=1000 -r 25 -vcodec libx264 -tune zerolatency -acodec aac -f mpegts udp://0.0.0.0:1234
</code></pre>

CC BY-SA 4.0
2019-01-03T15:39:37.340Z
2019-01-03T15:39:37.340Z
Gyan
<p>I'm generating an MPEG transport stream from a PNG file with <code>ffmpeg</code> succesfully with the following command:</p>

<pre><code>ffmpeg -re -loop 1 -i smpte-color-bars-1080p.png -r 25 -vcodec libx264 -tune zerolatency -f mpegts udp://0.0.0.0:1234
</code></pre>

<p>I'd like to add an audio track to this usingthe sine function but am falling at the first hurdle.</p>

<p>I've tried:</p>

<pre><code>ffmpeg -re -loop 1 -i smpte-color-bars-1080p.png -r 25 -vcodec libx264 -tune zerolatency -i sine=frequency=1000 -f mpegts udp://0.0.0.0:1234
</code></pre>

<p>and get the error:</p>

<pre><code>Unknown decoder 'libx264'
</code></pre>

<p>Which implies that my arguments order is wrong.</p>

<p>So I then tried:</p>

<pre><code>ffmpeg -re -loop 1 -i sine=frequency=1000 -i smpte-color-bars-1080p.png -r 25 -vcodec libx264 -tune zerolatency -f mpegts udp://0.0.0.0:1234
</code></pre>

<p>and get the error:</p>

<pre><code>sine=frequency=1000: No such file or directory
</code></pre>

<p>What is the correct syntax for adding a sine generated audio in this case?</p>

<video><ffmpeg><audio>
Adding a sine generated audio track to a video stream with ffmepg
Fat Monk
# Adding a sine generated audio track to a video stream with ffmepg

(Asked by: username_0 on 2019-01-03)

I'm generating an MPEG transport stream from a PNG file with ffmpeg succesfully with the following command:
ffmpeg -re -loop 1 -i smpte-color-bars-1080p.png -r 25 -vcodec libx264 -tune zerolatency -f mpegts udp://0.0.0.0:1234

I'd like to add an audio track to this usingthe sine function but am falling at the first hurdle.
I've tried:
ffmpeg -re -loop 1 -i smpte-color-bars-1080p.png -r 25 -vcodec libx264 -tune zerolatency -i sine=frequency=1000 -f mpegts udp://0.0.0.0:1234

and get the error:
Unknown decoder 'libx264'

Which implies that my arguments order is wrong.
So I then tried:
ffmpeg -re -loop 1 -i sine=frequency=1000 -i smpte-color-bars-1080p.png -r 25 -vcodec libx264 -tune zerolatency -f mpegts udp://0.0.0.0:1234

and get the error:
sine=frequency=1000: No such file or directory

What is the correct syntax for adding a sine generated audio in this case?

**Tags:** video, ffmpeg, audio


---

## 1 answers

### Answer by username_1 on 2019-01-03. Score: 0 | Accepted answer

sine is a source filter, so the input format needs to be set as a filter using -f lavfi.
Use
ffmpeg -re -loop 1 -i smpte-color-bars-1080p.png -re -f lavfi -i sine=frequency=1000 -r 25 -vcodec libx264 -tune zerolatency -acodec aac -f mpegts udp://0.0.0.0:1234


---

