Correct MJPEG flow record RRS feed

  • Question

  • Hello. I get a stream of bytes, I use the query. Next, I want to save this stream to a file as a video. I use File.WriteAllBytes, where bytes[] - it's what i got from stream, but when I open the video, only the first frame is always displayed. After recoding, the video will be played normally. What information should I add to the file so that I can watch the video right after the recording?
    • Edited by IgorGalimski Saturday, February 17, 2018 6:18 PM
    Saturday, February 17, 2018 6:17 PM

All replies

  • Hi lgorGalimski,

    Thank you for posting here.

    For your question, please try the code below.

    I use windows media player to play the mp4 video from bytes.

    Right click All Windows Form> Choose Items. Select Windows Media Player, click OK.

    After that, you could add Windows Media control in Toolbox.

    Here is the code.

      private void button1_Click(object sender, EventArgs e)
                string filename = "sample.mp4";
                byte[] byteArray = Encoding.ASCII.GetBytes(filename);
                string file = Encoding.ASCII.GetString(byteArray);
                axWindowsMediaPlayer1.URL = file;

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Wednesday, February 21, 2018 7:11 AM