<p>Last time I checked, Youtube requires an audio stream even if there is no input audio, so supply a dummy one.</p>

<pre><code>ffmpeg -re -f mjpeg -i "http://192.168.0.101" -f lavfi -i anullsrc -c:v libx264 -g 60 -c:a aac -ar 44100 -ac 2 -f flv "rtmp://a.rtmp.youtube.com/live2/&lt;key&gt;"
</code></pre>

CC BY-SA 4.0
2019-07-10T16:07:18.333Z
almost worked, but there is a resolution problem, even though the resolution of my IP Cam is set to 1024x768 , youtube says the resolution 600x800, any default settings of ffmpeg causing this ?
Mi Ubi
CC BY-SA 4.0
2019-07-10T16:23:20.177Z
No, your input resolution is 800x600. See the properties for Input #0 in your image.
Gyan
CC BY-SA 4.0
2019-12-20T22:32:12.247Z
You were right, YouTube does require an audio stream. I removed the `-an` from my pipeline, to restore audio, and it started working properly.
Trevor Sullivan
CC BY-SA 4.0
2019-07-10T15:41:52.777Z
2019-07-10T15:41:52.777Z
Gyan
<p>My Objective : To Transcode mjpeg stream from ip camera to youtube using ffmpeg</p>

<p>My Command : </p>

<pre><code>ffmpeg -re -f mjpeg -i "http://192.168.0.101" -c copy -movflags +faststart  -vcodec libx264 -f flv "rtmp://a.rtmp.youtube.com/live2/&lt;key&gt;"
</code></pre>

<p>My Reference for above effort : <a href="https://trac.ffmpeg.org/wiki/StreamingGuide#HTTPLiveStreamingandStreamingwithmultiplebitrates" rel="nofollow noreferrer">Streaming Guide</a></p>

<p>But when i try to run the command, it seems something is being transcoded and transmitted but youtube live i am not able to see anything, below is the screenshot of command output</p>

<p><a href="https://i.sstatic.net/4KivS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4KivS.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2019-07-10T20:11:42.833Z
`-c copy` and -vcodec libx264` conflict with each other and `-movflags +faststart` only applies to mp4s, which you are not using. I recommend you take some time to know what these flags do.
SlimSCSI
<ffmpeg>
Live Streaming IP Camera Stream to Youtube Using ffmpeg
Mi Ubi
# Live Streaming IP Camera Stream to Youtube Using ffmpeg

(Asked by: username_0 on 2019-07-10)

My Objective : To Transcode mjpeg stream from ip camera to youtube using ffmpeg
My Command : 
ffmpeg -re -f mjpeg -i "http://192.168.0.101" -c copy -movflags +faststart  -vcodec libx264 -f flv "rtmp://a.rtmp.youtube.com/live2/"

My Reference for above effort : Streaming Guide
But when i try to run the command, it seems something is being transcoded and transmitted but youtube live i am not able to see anything, below is the screenshot of command output

**Tags:** ffmpeg

> **Comments:**
> **username_1**: `-c copy` and -vcodec libx264` conflict with each other and `-movflags +faststart` only applies to mp4s, which you are not using. I recommend you take some time to know what these flags do.  

---

## 1 answers

### Answer by username_2 on 2019-07-10. Score: 5

Last time I checked, Youtube requires an audio stream even if there is no input audio, so supply a dummy one.
ffmpeg -re -f mjpeg -i "http://192.168.0.101" -f lavfi -i anullsrc -c:v libx264 -g 60 -c:a aac -ar 44100 -ac 2 -f flv "rtmp://a.rtmp.youtube.com/live2/"

> **Comments:**
> **username_0**: almost worked, but there is a resolution problem, even though the resolution of my IP Cam is set to 1024x768 , youtube says the resolution 600x800, any default settings of ffmpeg causing this ?  
> **username_2**: No, your input resolution is 800x600. See the properties for Input #0 in your image.  
> **username_3**: You were right, YouTube does require an audio stream. I removed the `-an` from my pipeline, to restore audio, and it started working properly.  

---

