Converting HikVision MP4 to standard MP4 or other format

naturecam

n3wb
Jan 19, 2018
18
1
I found an old thread on this but there was no answer to the question. I'm pretty new with my HikVision NVR. When I use the client to download a file, the only thing I can play it on is the VSPlayer. There was a converter app included in the Zip file, but it does not work on files produced by the iVMS-4200 client. I'm really stuck here. Can anyone help?
 
when you down load the file from ivms-4200
open vs player load that file in vs player
in the tool box you can then convert the file
 
I use the k-lite codec pack that includes all the right codecs for a PC and also Media Player Classic and it plays my files of the NVR with no issues, easier than converting...
 
I use the k-lite codec pack that includes all the right codecs for a PC and also Media Player Classic and it plays my files of the NVR with no issues, easier than converting...

Thanks for the tip. My cameras are set up for nature observation, including putting a couple into birdhouses and owl houses. Being able to share video with other nature lovers is an essential element of the system.
 
I'm replying to my own thread in case it helps others in the future. online-convert.com seems to work well. I just set the output to MP4 and the resulting file seems to play on any standard player.
 
I currently save files from nvr to a lightning to usb stick then plug it into iPad or iPhone then use file converter app and change it to mp4 video that way. Then save to my cloud storage or in photo library and then can edit in iMovie or something similar.
 
I currently save files from nvr to a lightning to usb stick then plug it into iPad or iPhone then use file converter app and change it to mp4 video that way. Then save to my cloud storage or in photo library and then can edit in iMovie or something similar.

Thank you for the reply. What file converter app do you use?
 
Try FFMPEG. It will modify the MP4 so it can be played on any device/program that supports MP4 encoded in H.264 (or H.265 depending on your NVR and/or camera). Here is a command you can run to fix your MP4's:

ffmpeg -err_detect ignore_err -i video.mkv -c copy video_fixed.mkv

You can also create a batch file (Windows PC) that will run this command on all files in the same directory as the batch file. Create a file called "FixMP4s.bat" and put the following text in it:

for %%i in (*.mp4) do ffmpeg -err_detect ignore_err -i %%i -c copy %%~ni_fixed.mp4
pause

Then just copy your Hikvision downloaded MP4's into the directory of the batch file, and run it.

Download FFmpeg
 
Hi all. I hope it's OK to pick up this old thread that I found while trying to convert files from a Hikvision NVR.

I installed a Win64 build of ffmpeg and carefully followed the instructions above, But it isn't converting. I've tried several Hikvision files, but each time it just creates an empty file with the name I specified. There is no visible error message.

If I try it with an ordinary mp4 file, it runs and copies the file to a new one as expected.

Has anyone any advice on fixing this please?
 
I've tried several Hikvision files
It's all down to the origin of the file.
These come from the camera - the NVR does little more than store the incoming video.
So the codec and video settings of the camera are the main variable.

If I try it with an ordinary mp4 file
There isn't such a thing - mp4 is just a container, the key item is the format of the enclosed video.

Do you have a smallish inocuous file you could share here?
 
Thanks for the reply!
The cameras are Hikvision 4k using H264 and 8k using H265.
Here is what MediaInfo says about one of the files:

General
Complete name : V:\iVMS\video\20191126\IP8-DN_20191126140339_20191126140417_2022509.mp4
Format : MPEG-PS
File size : 37.8 MiB
Duration : 37s 490ms
Overall bit rate mode : Variable
Overall bit rate : 8 465 Kbps

Video
ID : 224 (0xE0)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L5
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Duration : 37s 490ms
Bit rate mode : Variable
Bit rate : 8 296 Kbps
Maximum bit rate : 26.8 Mbps
Width : 2 688 pixels
Height : 1 520 pixels
Display aspect ratio : 16:9
Frame rate : 20.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.102
Stream size : 37.1 MiB (98%)
Color range : Full
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

Text
ID : 189 (0xBD)
Format : RLE
Format/Info : Run-length encoding
Duration : 34s 991ms
Delay relative to video : 2s 448ms
 
i just use handbrake, its free opensource and generally works very well with hikvsion, files u can convert it to any standard /format

you can drag and drop, choose the preset, name the output file and location, add to the queue, and encode

i now use the vimeo/ youtube HQ1080p60 preset, as it plays well with facebook,

handbrake can also handle 4k converting


handbrake link

for editing i generally use what is built into win10, and playback i use VLC - just learn some of the basic control controls - like zoom into a section, frame by frame replay and taking pictures
 
Last edited:
  • Like
Reactions: zigner
I'm using Win10. There is a MediaInfo version for Win.

I need to edit and join files, so they have to be converted from the native Hikvision format, and I've found that even their own VS program doesn't always work.

I have been using [Official] Video & DVD & Audio Converter - The versatile video converter for iPod, iPhone, PS4, Android phones, TV and more which will take Hikvision files and convert them, but this means decoding and recoding the files with an inevitable loss of quality. It also has file size limits.

ffmpeg seemed the ideal answer as a very quick tool, particularly with a batch.

Looks like I will have to try Handbrake. Is there any loss of quality when converting 8k video?
 
never tried it , its free , and pretty versatile



there are a few Open source video editing packages try openshot based on the FFmpeg library
another is Blender
 
Last edited:
I tried Handbrake, and yes it does the job, possibly a nicer interface than the AVC converter I linked in #14.

But I guess the question I'm asking is why is it necessary to use something to process and recode the whole file before it can be used?

Even an old program like Media Player Classic can open the file and play it instantly. VLC can open and play it.

Why can't these programs, or another, just open the file and save the video right away at its original settings? I realise there must be a good reason for this but I don't have it!
 
im sure i have edited converted using VS player, but it was basically crap to use, no investment by hikvision...

how often does an end user in a professional CCTV control room have to edit / convert videos into another format, thats DVD , Gmail, facebook, media player friendly at work. that will play on basically anything ...i suspect not a often.

Hikvision is a professional level kit, so why would it invest in software development and maintenance that probably isn't used all that often, and there is no ongoing payback for them?

Anyway i just get my cctv clips using a browser facility off my hikvision NVR, and just re-render them in handbrake, no need to download long clips and start editing, takes no time at all , then i can the render them to any format i want, facebook, Gmail etc

I generally don't bother with DVD /USB anymore, and just send out footage to the police via whatsapp and only burn to disc/USB if its actually wanted for a prosecution, then the Police supply a USB, and arrange to pick it up
 
Try FFMPEG. <<SNIP>>

Then just copy your Hikvision downloaded MP4's into the directory of the batch file, and run it.
I use ffmpeg frequently so I ftp'd the stupid Hik .mp4 to my Pi4, ran ffmpeg
ffmpeg -err_detect ignore_err -i NVR220_469876.mp4 -c copy NVR220_469876-ni_fixed.mp4
ftp'd it back to my laptop and it runs fine. I don't know a lot about video files, codecs, etc. but thanks for this.
If someone wants to explain, briefly, why Hikvision's .mp4 doesn't work with anything but Hikvision, I will listen and be grateful for the share.
"MP"
 
I use ffmpeg frequently so I ftp'd the stupid Hik .mp4 to my Pi4, ran ffmpeg
ffmpeg -err_detect ignore_err -i NVR220_469876.mp4 -c copy NVR220_469876-ni_fixed.mp4
ftp'd it back to my laptop and it runs fine. I don't know a lot about video files, codecs, etc. but thanks for this.
If someone wants to explain, briefly, why Hikvision's .mp4 doesn't work with anything but Hikvision, I will listen and be grateful for the share.
"MP"

I don't think there is a good answer. While I like Hikvision cameras, all of their software is terrible. I could be intentional on their part to force people to stay within the Hikvision umbrella of software/hardware, or it could just be something inadvertent that does't work well with non-Chinese video players that handle decoding video slightly differently than the rest of the world. It was a long time ago I wrote that FFMPEG post, and I don't remember exactly what FFMPEG did to fix the files, but I think it was something SUPER basic like modifying the header of the encoded file.
 
  • Like
Reactions: messypotamia