title: Stream esp-32 camera to RTMP server like YouTube
body: <p>I am doing research for a project in which I need to play with camera streams. After multiple hit and trails and googling I am not getting even close to the solution for streaming ESP-32 Camera stream to my own RMTP server directly.</p>
  
  <p>Already tried solutions:</p>
  
  <p>1) I have tried re-streaming of ESP-32-cam with Raspberry pi, that works well but not something I am looking for {discarded because do not want to use Raspberrypi for restreaming purposes}
  <a href="https://i.stack.imgur.com/cPMnZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cPMnZ.png" alt="enter image description here"></a></p>
  
  <p>2) ESP-32-cam: Record and FTP transfer with time triggers (Not tried but believed that it is not a good approach). {discarded because it is not realtime}</p>
  
  <p>3) <a href="https://stackoverflow.com/questions/53264373/esp32-try-to-send-image-file-to-php-with-httpclient#comment107759513_53264373">ESP32 Try to send image file to php with HTTPClient</a> I have tried but it works for images only and secondly the code is executed in loop function so ther is a long delay due to saving and posting operations.</p>
  
  <p>Please note: I am not looking at the solution in which ESP-32 cam acts as stream server and browser can connect to it like : <a href="https://www.hackster.io/BnBe_Club/9-rtsp-video-streamer-using-the-esp32-cam-board-8832b4" rel="noreferrer">https://www.hackster.io/BnBe_Club/9-rtsp-video-streamer-using-the-esp32-cam-board-8832b4</a>
  <a href="https://i.stack.imgur.com/0iFvI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0iFvI.png" alt="enter image description here"></a></p>
  
  <p>I have already tried it and it works well but not for the usecase which involves streaming to RTMP server without restreaming.</p>
  
  <p>**</p>
  
  <blockquote>
    <p>I want to achieve ESP-32 CAM can post / stream directly to the RTMP
    cloud hosted server, technically it seems to be possible because
    ESP-32 cam has support for connecting to wifi and access the cloud
    server</p>
  </blockquote>
  
  <p>**
  <a href="https://i.stack.imgur.com/zrdoy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zrdoy.png" alt="enter image description here"></a></p>
  
  <p>On google, I found a similar thread : <a href="https://forum.arduino.cc/index.php?topic=634605.0" rel="noreferrer">https://forum.arduino.cc/index.php?topic=634605.0</a> The guy with solution is not interested in sharing it.</p>
  
  <p>may be some modification required in below code MAY BE ref: <a href="https://github.com/espressif/esp32-camera" rel="noreferrer">https://github.com/espressif/esp32-camera</a></p>