title: Looping an MP4 video
body: <p>I need to interface with a piece of hardware that is expecting an MPEG-4 RTP stream from a camera (actually multiple streams from multiple different cameras). What we'd like to do is supply that video from a set of small .mp4 files, looped endlessly.<sup>1</sup> </p>
  
  <p>What I'm trying right now is to use libVLC in server mode, with the "--loop" argument. The code for this looks like the following:</p>
  
  <pre><code>    libvlc_vlm_add_broadcast(vlc, "test", ("file:///" + video).c_str(),
                              "#rtp{dst=localhost,port=1234,sdp=rtsp://localhost:8080/test.sdp}",
                              1, broadcast_options, true, true);
      const auto play_result = libvlc_vlm_play_media(vlc, "test");
  </code></pre>
  
  <p>This seems to be working on my desktop, with one issue: I have to put the player on loop too. If I just ask the player to play the stream once, it stops when the end of the file from the server is reached.</p>
  
  <p>Is there any way to get this to look to the client like one continuous (never-ending) stream? VLC isn't a requirement, but an RTP MP4 stream is.</p>
  
  <p><sup>1 - No, I'm not trying to rob a museum. This is for a simulator.</sup></p>