I have a Hikvision NVR that stores security camera footage that I need to display on a website. I know that Hikvision uses proprietary H.264 codec that makes it impossible to play (coherently) in popular video players, like VLC, unless you install that codec everywhere you play it.
My plan was to transcode the video using ffmpeg to regular H.264 codec and AAC for audio but the produced file has the same issues as the original - no audio when playing and very disruptive video. So the question is, does ffmpeg support encoding from Hikvision video/audio codecs? Or perhaps should try to convert to different web-capable codecs using ffmpeg? My ffmpeg command looks like this:
What's interesting is that ffplay.exe opens and plays the original video files with no problem whatsoever, even on a computer where Hikvision codecs are not isntalled, therefore I figured conversion should be possible as well?
Mediainfo output for the video file in question:
General
CompleteName : C:\DownLoad\1.mp4
Format : MPEG-PS
FileSize/String : 8.60 MiB
Duration/String : 2 h 7 min
OverallBitRate/String : 9 395 b/s
FileExtension_Invalid : mpeg mpg m2p vob pss evo
Video
ID/String : 224 (0xE0)
Format : AVC
Format/Info : Advanced Video Codec
Format_Profile : Baseline@L4
Format_Settings : 1 Ref Frames
Format_Settings_CABAC/String : No
Format_Settings_RefFrames/String : 1 frame
Format_Settings_GOP : M=1, N=30
Duration/String : 2 min 0 s
Width/String : 1 920 pixels
Height/String : 1 080 pixels
DisplayAspectRatio/String : 16:9
FrameRate_Mode/String : Variable
ColorSpace : YUV
ChromaSubsampling/String : 4:2:0
BitDepth/String : 8 bits
ScanType/String : Progressive
Audio
ID/String : 192 (0xC0)
Format : MPEG Audio
Duration/String : 2 h 7 min
Compression_Mode/String : Lossy
Video_Delay/String : -33 min 40 s
Note: the above video/audio duration is wrong, since the video is only 2 minutes in length. VLC shows the wrong duration as well
IP Camera settings on NVR:
Video sample: Dropbox - 1.zip
My plan was to transcode the video using ffmpeg to regular H.264 codec and AAC for audio but the produced file has the same issues as the original - no audio when playing and very disruptive video. So the question is, does ffmpeg support encoding from Hikvision video/audio codecs? Or perhaps should try to convert to different web-capable codecs using ffmpeg? My ffmpeg command looks like this:
Code:
ffmpeg -i C:\1.mp4 -c:v libx264 -preset fast -crf 30 -b:v 200k -c:a aac -strict experimental -movflags faststart -threads 0 C:\2.mp4
What's interesting is that ffplay.exe opens and plays the original video files with no problem whatsoever, even on a computer where Hikvision codecs are not isntalled, therefore I figured conversion should be possible as well?
Mediainfo output for the video file in question:
General
CompleteName : C:\DownLoad\1.mp4
Format : MPEG-PS
FileSize/String : 8.60 MiB
Duration/String : 2 h 7 min
OverallBitRate/String : 9 395 b/s
FileExtension_Invalid : mpeg mpg m2p vob pss evo
Video
ID/String : 224 (0xE0)
Format : AVC
Format/Info : Advanced Video Codec
Format_Profile : Baseline@L4
Format_Settings : 1 Ref Frames
Format_Settings_CABAC/String : No
Format_Settings_RefFrames/String : 1 frame
Format_Settings_GOP : M=1, N=30
Duration/String : 2 min 0 s
Width/String : 1 920 pixels
Height/String : 1 080 pixels
DisplayAspectRatio/String : 16:9
FrameRate_Mode/String : Variable
ColorSpace : YUV
ChromaSubsampling/String : 4:2:0
BitDepth/String : 8 bits
ScanType/String : Progressive
Audio
ID/String : 192 (0xC0)
Format : MPEG Audio
Duration/String : 2 h 7 min
Compression_Mode/String : Lossy
Video_Delay/String : -33 min 40 s
Note: the above video/audio duration is wrong, since the video is only 2 minutes in length. VLC shows the wrong duration as well
IP Camera settings on NVR:

Video sample: Dropbox - 1.zip
Last edited: