Log in

View Full Version : Converting a Security Camera video mp4 to a more popular format


Carmageddon
21st December 2011, 17:01
Hello!

I've had a little accident, which was caught rather nicely on security DVR system :)

I want to sue the other guy ( I am the white car btw, if anyone is curious).

However, the video while in a MP4 container, is encoded with some bizarre codec - its not playing in any player I've tried.

It can only be opened by the "Player" provided by the DVR company...

any idea how to re-encode it into Xvid or something? which I could easily play on Any computer, or better yet put on youtube and show during the Trial to the Judge (hoping he will consider my mistakes less critical).

The video file and the player can be found on:
ftp://voyager.ccc.co.il/pub/genadi/

I assume that people here (unlike insurance office workers) wont need precise instructions how to load the video to playback :D


Thanks!

sneaker_ger
21st December 2011, 17:42
Lossless h.264 in mkv:
https://rapidshare.com/files/1918220440/seccam.mkv

nm
21st December 2011, 17:55
Your file is not really MP4. It's in a proprietary format used by Hikvision and maybe some other security DVR companies.

The Player.exe you have seems to include some conversion functionality (Option->Convert to AVI), but its raw AVI output had incorrect video parameters. (I only tried it with Wine on Linux though, so it could be caused by my system.) If it doesn't work for you either, use the "File Convertor" program from this site: http://www.hikvisionusa.com/downloads.html It's based on libavcodec and supports multiple common formats for output. MPEG-4 ASP (DivX or XviD) in AVI and WMV are probably the safest choices.

Edit: Sneaker's lossless conversion is a good option if you want to avoid any quality degradation. But you might need VLC for playing it back, or re-encode to high bitrate WMV.

Apt nick by the way. ;)

Carmageddon
21st December 2011, 18:24
Thanks both of you!

Well the first re-encoding by sneaker has no good Seeking capability - if I seek, the video crashes often.

nm - the converter looks good however it seems to change the source of 528x384 into 352x288!
Event the timing changes.. the clip becomes shorter, etc...


Sneaker - how did you do the re-encoding? your video is perfect except the buggy seeking

sneaker_ger
21st December 2011, 18:26
Graphstudio with the proprietary DS filters to Haali's muxer, then x264cli.

Just remux with mkvtoolnix to enable seeking. I used x264's mkv output, which does not create any index (though it should not crash any decent player).

nm
21st December 2011, 18:31
nm - the converter looks good however it seems to change the source of 528x384 into 352x288!

That can be changed in the "Video Set Dialog" (First icon in the bottom toolbar).

Event the timing changes.. the clip becomes shorter, etc...

Looks like the clip is slightly corrupted: Player.exe jumps from 3 seconds to 8 during playback, so that's why the converted output appears to be 4 seconds shorter. Somehow the DirectShow filter does a better job and only drops less than 1 second of the clip.

Carmageddon
21st December 2011, 18:51
Thanks! now that I've figured it out, their convert application actually did a good work I believe, I will upload it later on youtube as backup, I still need to prepare more evidence and stuff, but I think this is acceptable enough to present to judge :)

PS: The video made with mkvtoolnix still crashes but less often.. however the other file works perfect, so I'll use it.

Thanks!

sneaker_ger
21st December 2011, 18:56
Oh, then it could be because of the lossless profile, but youtube should handle that file just fine anyways.
But when going the youtube road I'd consider upscaling first, as the SD modes will seriously hurt the quality.

Ghitulescu
21st December 2011, 19:04
One of the reasons the surveillance cameras record into a "strange" format is to ensure that the video hasn't been "tempered" - one can colour the white car into blue and vice-versa :)

Carmageddon
21st December 2011, 20:50
Sneaker can you please tell me how to upscale it?

I also have a .AVI video (with audio) from inside my car during the accident from internal camera :)

However attempts to cut out the relevant part with Virtual Dub failed in direct stream copy, and in full processing mode - the video doesnt show :(
The file is pretty large 250mb...

sneaker_ger
21st December 2011, 22:14
You can use AviSynth for opening, upscaling and trimming:
ffvideosource("seccam.mkv") #needs ffmpegsource plugin
Trim(200, 300) # deletes all frames outside 200...300
Spline36Resize(1484, 1080) #resize to 1080p
AddBorders(218,0,218,0) #pillarbox (not sure if youtube really needs this, but I think so)

You can open that script with VirtualDub or x264cli.

evandrix
18th June 2019, 17:28
answered in detail https://stackoverflow.com/questions/47759599/hikvision-nvr-video-conversion-ffmpeg#answer-47771735

StainlessS
18th June 2019, 18:09
In a jury trial, you probably would not want to upload to YouTube (prejudice the jury, and the guy walks).

benwaggoner
19th June 2019, 17:18
In a jury trial, you probably would not want to upload to YouTube (prejudice the jury, and the guy walks).
Good advice. Although this was 7.5 years ago, so it's probably long since over with.