Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-10T16:07:18.333Z
Answers.Text: 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 ?
Answers.UserDisplayName: Mi Ubi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-10T16:23:20.177Z
Answers.Text: No, your input resolution is 800x600. See the properties for Input #0 in your image.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-20T22:32:12.247Z
Answers.Text: You were right, YouTube does require an audio stream. I removed the `-an` from my pipeline, to restore audio, and it started working properly.
Answers.UserDisplayName: Trevor Sullivan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-10T15:41:52.777Z
Answers.LastActivityDate: 2019-07-10T15:41:52.777Z
Answers.UserDisplayName: Gyan
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-10T20:11:42.833Z
Comments.Text: `-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.
Comments.UserDisplayName: SlimSCSI
Tags: <ffmpeg>
Title: Live Streaming IP Camera Stream to Youtube Using ffmpeg
UserDisplayName: Mi Ubi
ThreadText: # 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/<key>"
  
  ```
  
  My Reference for above effort : [Streaming Guide](https://trac.ffmpeg.org/wiki/StreamingGuide#HTTPLiveStreamingandStreamingwithmultiplebitrates)
  
  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
  
  [![enter image description here](https://i.sstatic.net/4KivS.png)](https://i.sstatic.net/4KivS.png)
  
  **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/<key>"
  
  ```
  
  > **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.  
  
  ---
  
  