纠正MJPEG流量记录

编程入门 行业动态 更新时间:2024-10-09 22:16:57
本文介绍了纠正MJPEG流量记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好。我得到一个字节流,我使用查询。接下来,我想将此流保存为文件作为视频。我使用File.WriteAllBytes,其中bytes [] - 这是我从流中得到的,但是当我打开视频时,只显示第一帧。重新编码后,视频将正常播放。我应该将哪些信息添加到文件中,以便我可以在录制后立即观看视频?

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?

推荐答案

嗨lgorGalimski,

Hi lgorGalimski,

感谢您在此发帖。

如果您有任何问题,请尝试以下代码。

For your question, please try the code below.

我使用的是windows media播放器从字节播放mp4视频。

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

右键单击所有Windows窗体>选择项目。选择Windows Media Player,单击"确定"。

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

之后,您可以在工具箱中添加Windows Media控件。

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

这是代码。

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; }

最好的问候,

Wendy

更多推荐

纠正MJPEG流量记录

本文发布于:2023-11-25 10:13:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629345.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:流量   MJPEG

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!