Raspberry pi Raspberry Pi 4是否保存损坏的h264文件?

Raspberry pi Raspberry Pi 4是否保存损坏的h264文件?,raspberry-pi,h.264,raspberry-pi4,mp4box,Raspberry Pi,H.264,Raspberry Pi4,Mp4box,我已经能够毫无问题地录制.h264文件,无论是使用raspivid还是通过Python,但是无论我做什么尝试,我都无法将它们转换为.mp4、.mkv或.avi文件 我尝试过使用MP4box(在几个地方建议)和mkvmerge进行转换,但没有效果 当我使用MP4box(MP4box-add)时,我得到: 然后我尝试用VLC播放这个文件,它没有给出错误,但显示的是乱码数据 为了清楚起见,相机工作正常(使用Python代码显示完美的视频,raspistill输出完美的jpg文件)。我也试了一台不同的相

我已经能够毫无问题地录制.h264文件,无论是使用raspivid还是通过Python,但是无论我做什么尝试,我都无法将它们转换为.mp4、.mkv或.avi文件

我尝试过使用MP4box(在几个地方建议)和mkvmerge进行转换,但没有效果

当我使用MP4box(MP4box-add)时,我得到:

然后我尝试用VLC播放这个文件,它没有给出错误,但显示的是乱码数据

为了清楚起见,相机工作正常(使用Python代码显示完美的视频,raspistill输出完美的jpg文件)。我也试了一台不同的相机

尝试使用mkvmerge:

pi@raspberrypi:~/cam $ raspivid -o test.h264 -fps 30 -t 15000 -w 1920 -h 1080
pi@raspberrypi:~/cam $ mkvmerge --default-duration 0:30p -o video.mkv test.h264
mkvmerge v31.0.0 ('Dolores In A Shoestand') 32-bit
'test.h264': Using the demultiplexer for the format 'AVC/h.264'.
'test.h264' track 0: Using the output module for the format 'AVC/h.264 (unframed)'.
The file 'video.mkv' has been opened for writing.
Error: 'test.h264' track 0: mkvmerge encountered broken or unparsable data in this AVC/h.264 video track. Either your file is damaged (which mkvmerge cannot cope with yet) or this is a bug in mkvmerge itself. The error message was:
Success
pi@raspberrypi:~/cam $
这是在覆盆子皮4上

可以在此处找到示例文件:
创建时使用:raspivid-t 30000-w 640-h 480-fps 25-b 1200000-p 0,0640480-o pivideo.h264

我将自己对此做出回应。执行“apt get升级”后,问题消失了

如果有人想找出根本原因,apt get就是这么做的:

The following packages will be upgraded:
  bind9-host bluez-firmware firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek libbind9-161 libdns-export1104 libdns1104 libgs9 libgs9-common libisc-export1100 libisc1100 libisccc161
  libisccfg163 liblwres161 libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel raspberrypi-kernel-headers raspi-config rpd-plym-splash
The following packages will be DOWNGRADED:
  python3-pgzero
27 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.

我一直使用
ffmpeg
对内容进行重新编码,尽管不是这种特殊情况(这就是为什么它是注释而不是答案)。奇怪的是,它报告了一个错误,但没有给出文本。您确定输入是h264吗?鉴于您尝试使用的
mp4box
与相同,它可能是录制端的内容。您可以共享您的h.264文件吗?可以在此处找到示例文件:
The following packages will be upgraded:
  bind9-host bluez-firmware firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek libbind9-161 libdns-export1104 libdns1104 libgs9 libgs9-common libisc-export1100 libisc1100 libisccc161
  libisccfg163 liblwres161 libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel raspberrypi-kernel-headers raspi-config rpd-plym-splash
The following packages will be DOWNGRADED:
  python3-pgzero
27 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.