简体   繁体   English

如何在C#窗体应用程序中播放MDVR中的.264格式原始视频文件

[英]How to play .264 format raw video file from MDVR in C# form application

I'm trying to run a .264 video recorded from MDVR, in a C# application, VLC player is not able to play it, it also has GPS, and data from other sensors embedded in it. 我正在尝试运行从MDVR录制的.264视频,在C#应用程序中,VLC播放器无法播放它,它还具有GPS以及来自其他传感器的数据。 I want to decode the stream from file and be able to play the video. 我想从文件中解码流并能够播放视频。 Is there any SDK to help me out with this? 有没有SDK可以帮助我解决这个问题?

ffmpeg fails to play it, vlc fails to play it, MPC-HC fails to play it, AVC can't convert it. ffmpeg无法播放,vlc无法播放,MPC-HC无法播放,AVC无法转换。 and I've never worked on videos before. 我以前从没做过视频 Thank you. 谢谢。

"FFmpeg fails to play it, VLC fails to play it, MPC-HC fails to play it, AVC can't convert it... “ FFmpeg无法播放,VLC无法播放,MPC-HC无法播放,AVC无法转换...

"I've never worked on videos before" “我以前从未研究过视频”

Your actual video data begins at byte position: 4198424 . 您的实际视频数据开始于字节位置: 4198424

See the section " H.264 video frame bytes in AVI " of this Answer to know what your video bytes mean. 请参阅此答案的AVI中的H.264视频帧字节 ”部分,以了解您的视频字节的含义。 For example... in your file at byte position 4198424 : 例如...在文件中字节位置4198424

Starting bytes 00 00 00 01 67 (is the SPS ), and 00 00 00 01 68 (is PPS ), and 00 00 00 01 06 (is SEI ). 起始字节00 00 00 01 67 (是SPS ), 00 00 00 01 68 (是PPS )和00 00 00 01 06 (是SEI )。 All these bytes provide data to setup the decoder ( eg: notify of the video's frame rate and its width/height etc). 所有这些字节提供了用于设置解码器的数据( 例如:通知视频的帧速率及其宽度/高度等)。 Then following bytes 00 00 00 01 65 means "beginning of keyframe data". 然后,后面的字节00 00 00 01 65表示“关键帧数据开始”。

Solution: 解:
Get to byte position 4198424 and extract everything from those bytes onwards (up to ending of file). 到达字节位置4198424,然后从这些字节开始提取所有内容(直到文件结尾)。 This data is in MPEG's H.264 video format so you could save to disk as testfile.h264 and then test in a media player (I used the MPC-HC player to display). 此数据采用MPEG的H.264视频格式,因此您可以将文件另存为testfile.h264 ,然后在媒体播放器中进行测试(我使用MPC-HC播放器进行显示)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM