无法播放从安全摄像头 NVR 下载的“mp4”视频

无法播放从安全摄像头 NVR 下载的“mp4”视频

我有一个 HeimVision 安全系统,我尝试将视频下载到我的 debian 系统中进行分析。

编辑:我上传了文件在线的:

我尝试使用 VLC 播放此视频,但没有显示视频,仅显示 VLC 徽标:VLC播放器

查看日志,我看到以下警告/错误:

█[debianx1e][crime][0]$ vlc download\ \(9\).mp4 
VLC media player 3.0.11 Vetinari (revision 3.0.11-0-gdc0c5ced72)
[000055d31a8c4570] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007fedc4c1a710] main decoder error: buffer deadlock prevented
[00007fedc4c04f60] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 11, expected 1) for PID 0
[hevc @ 0x7fedbc008000] Invalid NAL unit 4, skipping.
[00007fedd4015e30] main video output error: video output creation failed
[00007fedc4c1a710] main decoder error: failed to create video output
[00007fedd4170610] main video output error: video output creation failed
[00007fedc4c1a710] main decoder error: failed to create video output
[00007fedd4170610] main video output error: video output creation failed
[00007fedc4c1a710] main decoder error: failed to create video output
[hevc @ 0x7fedbc008000] get_buffer() failed
[hevc @ 0x7fedbc008000] thread_get_buffer() failed
[hevc @ 0x7fedbc0221c0] Invalid NAL unit 4, skipping.
[00007fede0c02560] main video output error: video output creation failed
[00007fedc4c1a710] main decoder error: failed to create video output
[hevc @ 0x7fedbc0221c0] get_buffer() failed
[hevc @ 0x7fedbc0221c0] thread_get_buffer() failed
[hevc @ 0x7fedbc03dd00] Invalid NAL unit 4, skipping.
[00007fedec0038d0] main video output error: video output creation failed
[00007fedc4c1a710] main decoder error: failed to create video output
[hevc @ 0x7fedbc03dd00] get_buffer() failed
[hevc @ 0x7fedbc03dd00] thread_get_buffer() failed
[hevc @ 0x7fedbc04e000] Invalid NAL unit 4, skipping.
[00007fedb8002bc0] main video output error: video output creation failed
[00007fedc4c1a710] main decoder error: failed to create video output
[hevc @ 0x7fedbc04e000] get_buffer() failed
[hevc @ 0x7fedbc04e000] thread_get_buffer() failed
[00007fedc4c1a710] avcodec decoder error: avcodec_send_packet critical error
[hevc @ 0x7fedbc05e4c0] Invalid NAL unit 4, skipping.
[00007fedac003110] main video output error: video output creation failed
[00007fedc4c1a710] main decoder error: failed to create video output
[hevc @ 0x7fedbc05e4c0] get_buffer() failed
[hevc @ 0x7fedbc05e4c0] thread_get_buffer() failed

我尝试使用 Chromium 浏览器打开文件,但播放按钮似乎未启用

没有播放按钮

回到VLC日志,我尝试谷歌搜索一些错误,例如“无效的NAL单元4,跳过。”,“libdvbpsi错误(PSI解码器):PID 0的TS不连续性(收到11,预期1)”,尝试了几个指针:

  1. VLC.org 论坛邮政建议安装 libdvdcss2,但在我的系统上:E: Package 'libdvdcss2' has no installation candidate.
  2. 尝试使用 ffmpeg 将视频转换为其他格式,尽管此命令似乎成功,但生成的mpeg文件仍然无法播放。该命令会生成许多与使用 VLC 进行复制时相同的警告:
█[my-hostname][crime][0]$ ffmpeg -i 'download (9).mp4' -c copy -an 'copy-9.mpeg'                                                  
ffmpeg version 4.1.9-0+deb10u1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --prefix=/usr --extra-version=0+deb10u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[hevc @ 0x55bae12878c0] Invalid NAL unit 4, skipping.
    Last message repeated 1 times
[AVBSFContext @ 0x55bae128a740] Invalid NAL unit 4, skipping.
    Last message repeated 1 times
[hevc @ 0x55bae12878c0] Invalid NAL unit 4, skipping.
    Last message repeated 73 times
[mpegts @ 0x55bae1282840] start time for stream 1 is not set in estimate_timings_from_pts
[mpegts @ 0x55bae1282840] Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels): unspecified sample format                                                 
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from '/home/USER/Downloads/crime/download (9).mp4':
  Duration: 00:00:50.72, start: 0.000000, bitrate: 44 kb/s
  Program 1 
    Stream #0:0[0x100]: Video: hevc (Main) ([36][0][0][0] / 0x0024), yuv420p(tv, bt470bg), 1920x1080 [SAR 1:1 DAR 16:9], 10 fps, 100 tbr, 90k tbn, 10 tbc
    Stream #0:1[0x101]: Audio: aac ([15][0][0][0] / 0x000F), 0 channels
File '/home/USER/Downloads/crime/copy-9.mpeg' already exists. Overwrite ? [y/N] y
[mpeg @ 0x55bae12bcac0] VBV buffer size not set, using default size of 230KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to '/home/USER/Downloads/crime/copy-9.mpeg':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: hevc (Main) ([36][0][0][0] / 0x0024), yuv420p(tv, bt470bg), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 10 fps, 100 tbr, 90k tbn, 10 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[NULL @ 0x55bae12878c0] Invalid NAL unit 4, skipping.
    Last message repeated 512 times
[NULL @ 0x55bae12878c0] Invalid NAL unit 5, skipping.
frame=  512 fps=0.0 q=-1.0 Lsize=     216kB time=00:00:50.61 bitrate=  35.0kbits/s speed=3.56e+03x    
video:214kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.990804%
[my-hostname][crime][0]$ 

查看 的输出mediainfo,该文件似乎是一个MPEG-TS文件:

█[my-hostname][crime][1]$ mediainfo "/home/USER/Downloads/crime/download (10).mp4"
General
ID                                       : 1 (0x1)
Complete name                            : /home/USER/Downloads/crime/download (10).mp4
Format                                   : MPEG-TS
File size                                : 547 KiB
Duration                                 : 5 min 5 s
Overall bit rate                         : 9 428 b/s
FileExtension_Invalid                    : ts m2t m2s m4t m4s tmf ts tp trp ty

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L4@Main
Codec ID                                 : 36
Duration                                 : 5 min 11 s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 10.000 FPS
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 0)
Bit depth                                : 8 bits
Color range                              : Limited
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.470 System B/G
Matrix coefficients                      : BT.470 System B/G

我尝试将文件扩展名重命名为tsor ,mp4但没有任何运气。

我怎样才能在Linux上播放这个mp4文件?

答案1

您的视频在我的 Linux Mint 21 Vanessa 赛璐珞上通过 Nvidia 加速播放时播放得很好:

在此输入图像描述

在任何情况下,正如 CAS 所指出的,您可以使用https://handbrake.fr/将此视频转换为您喜欢的格式。

我的猜测是,您的系统中缺少一些库,或者 VLC 不能很好地适应这种格式;无法反驳或证实。

相关内容