I have a CCTV system that lets me back up the recordings as AVI (H264). Unfortunately, the format is not standard and I can't use the files in After Effects or Premiere. They also do not work correctly in Windows 10 Films & TV, VLC. Handbrake won't touch them and complains "No valid source of titles found". They do play with Windows 10 Windows Media Player and Kodi
Avidemux does allow me to transcode them after initially complaining about "Malformed Header". I'd rather not add yet another transcode to my workflow if possible as the files are quite low quality to start with and the transcoded versions would take up too much space as there are many hours of recordings.
I've contacted the manufacturers, but I'm not expecting anything back.
avifixed, divfix, avirepair won't fix it.
I really need to be able to get them to work directly with Adobe products, can anyone help?
**I've included the file and details:**
No audio was recorded
CCTV Model: Zosi H.264 HD 1080P DVR - ZR04LN/10
Dropbox: https://www.dropbox.com/s/v6odt6a5ggxvbew/CH03-2018-02-25-14-12-57.avi?dl=0 (~8mb)
VirtualDub won't open it: https://i.imgur.com/MuzyCkj.png
VirtualDub: https://i.imgur.com/8XTrLcp.png https://i.imgur.com/f6A0h4x.png
+ Reply to Thread
Results 1 to 25 of 25
VirtualDub can open the video if you have the right source filters and VFW decoder. Or you can just use VirtualDub FilterMod which has such things built-in.
As was pointed out, you can easily remux to MP4 or MKV, whatever your software accepts. You can do this with ffmpeg in a batch file. For example, put this in a batch file called Remux to MP4.bat:
"C:\Program Files\ffmpeg\bin\ffmpeg.exe" -i "%~1" -vcodec copy -acodec copy -absf aac_adtstoasc "%~dpn1.mp4"
I wrote a batch script for this, which I don't know how to remove the "malformed header" warning.
Thank you very much!!!!
set avidemux="C:\Program Files\Avidemux 2.7 - 64 bits\avidemux.exe" set videocodec=Copy set audiocodec=AAC (FDK) set outputformat=MP4 for %%f in (*.avi) do %avidemux% --videoprocess false --video-codec %videocodec% --audio-codec %audiocodec% --output-format %outputformat% --force-alt-h264 --load "%%f" --save "%%f.mp4" --quit
It seems the video is also variable frame rate, which is causing havoc with audio sync issues.
So it looks like I'll have to transcode too, meaning a re-compression of the video losing quality.. /sigh.
What are the best options for this in Avidemux to preserve quality? Again I can't go to a large intermediary format.
everything i open the avi with says it's cfr 29.97. what says different? and what audio? there is none in the avi you uploaded.--
"a lot of people are better dead" - prisoner KSC2-303
AVI does not support VFR . You must be referring to the re-wrapped file in MP4 container, there are probably errors with the timecodes
It opens up in AE CC 2015 as well for me, and aedipuss imported it into PP CS6 .... are you on Windows version of Adobe ?
External audio can be problematic, unless you have genlock or some method of running off the same clock . You almost always have some drift on longer recordings.
But that's probably an additional issue . I'm just wondering why it doesn't import correctly in your version of Adobe
have you updated your pp cc 2015? hard to believe cs6 can open and use the avi and cc can't.--
"a lot of people are better dead" - prisoner KSC2-303
Short clips usually don't have a problem . If you have long recordings ,you're likely in trouble . I'm guessing the CCTV usage scenario is going to be long clips...
Right now, I think it would be a better starting point with the AVI . Even if that has sync drift , that's not going to be compounded by your timecode errors.
But there is something buggy about your AVI which might be the cause of the MP4 timecode errors - how was it processed ? Was recording abruptly stopped, power outage, or some form of cutting used ?
The AVIs are created by using the "backup" feature of the CCTV which seem to have a non-standard format.
I've no idea how the conversion process outlined near the top of the thread has made the AVI (which are CFR) become VFR when changed to MP4s
I have a feeling that they were always VFR/MP4 and that the CCTV incorrectly just dumps them into an AVI container, but that's a guess.
I used Avidemux with the following settings:
Video Output : Copy
Audio Output : AAC (FDK)
Output Format: MP4 Muxer
Everything else just defaults.
I just manually converted one again and it's changed to VFR.
gspot reports error in your AVI "bad chunk in frame data: invalid length" - I was wondering if it was representative of an AVI you pull off the machine. Do all of them act like this ? Or did you process it , or cut it, or edit it in some way ?
There are some discrepancies between the actual coded frames and the timing information. That's probably why the re-wrapped MP4 is VFR .
gspot reports 1410frames and 47.047sec duration
mediainfo reports 1388frames and 46.313sec duration
media players like mpchc, potplayer report 1min 3sec duration
elementary stream only has 694 frames, unless there are errors in demuxing the video stream . But this would only be ~23seconds at 29.97 fps
all this conflicting data, none of them correlate. Very buggy AVI.
When you import the AVI directly into PP ,it actually gets converted to CFR , with duplicates, to keep the 29.97 timing . I keep an older version of AE CC2015 (because of some compatibility issues with some scripts and plugins) , and that imports the AVI as well
I've just tried importing one of the source AVIs into PP CC 2015 again and always get this error:
[Attachment 44785 - Click to enlarge]
I'm using APP CC 2015.0 9.0.0. (247) Build.
Have you tried installing a VFW h.264 decoder? Maybe your programs will open the original AVI file with that.
x264vfw which allowed me to import the AVIs directly into PP without needing to convert them into mp4's.
I also had to interpret the footage as 29.97. Which made the framerate correct and the length correct.
A whole ~8h sequence made from ~30 files is 3 seconds longer than the same sequence converted from ~30 AVI->MP4.
So I wonder if that now contains the extra frames that were missing that caused the audio sync issue?
I'll have to test this further thanks.
AVI doesn't support variable frame rates. So the length of the AVI file(s) is probably the correct length. AVI has a specific "duplicate" frame type that can be used for exact duplicate frames (your AVI has lots of them). When those are muxed into MP4 the duplicate frames aren't included, the time code of the previous frame is just extended -- making the MP4 VFR.