title: How to decode a live stream encoded using FFMPEG?
body: <p>I am not very proficient with C programming and working on live streaming using FFMPEG. Basically, I want to put a watermark on a live streaming video. </p>
  
  <p>Using FFMPEG, I have been able to record a video from webcam, encode it and send to some ip:port using UDP. Now, my receiver(written in Java) is receiving the data in packets but I don't know how to decode it for editing or play it. If I use ffplay, it plays it automatically. I referred some links: <br/>
  <a href="https://stackoverflow.com/questions/3172878/how-to-open-file-live-stream-with-ffmpeg-edit-each-frame-with-opencv-and-save-th">Similar Question</a> <br/>
  <a href="https://ffmpeg.org/doxygen/trunk/decoding__encoding_8c-source.html" rel="nofollow noreferrer">Decoding Encoding Example</a></p>
  
  <p>Could anyone please tell, how can I proceed for the solution. Any hints would be appreciable.</p>
  
  <ol>
  <li>How the data is encoded. Is it some FFMPEG format or generic format?</li>
  <li>If a live stream is coming, then what information does each packet contains? Whether it is a complete video itself or a portion of complete video file?</li>
  </ol>