Log in

View Full Version : Indexing a camera corrupted H.264 mp4 file


FranceBB
22nd May 2022, 12:05
Hi there,
the crew was out and about shooting stuff when the camera shut down out of the blue.
No one is really sure what happened, but it just froze and rebooted. As a result, I have 2 H.264 files muxed in .mp4 recorded by the camera which I cannot index.
they have a weight of 3.5 GB and 5.8 GB each, so I'm pretty sure the bitstream is there, but since the header is missing, there's no way I can index them.

FFVideoSource()
LWLibavVideoSource()
LSMASHSource()
DirectShowSource()

all failed to index the file.
Virtualbox can't find a decoder, PotPlayer can't play it and FFMpeg can't read it.

When I try to ffprobe it, it says:

[mov,mp4,m4a,3gp,3g2,mj2 @ 000002475f0c2680] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002475f0c2680] moov atom not found
\\mibcssda001\Scambio 15GG\PEREGO\SPERIAMO\SPERIAMO2.MP4: Invalid data found when processing input


I tried to remux it with MKVToolnix v67 hoping that it would recreate the header, but it didn't.
Although I went from this:


General
Complete name : \\mibcssda001\Scambio 15GG\PEREGO\SPERIAMO\SPERIAMO2.MP4
Format : MXF
File size : 5.62 GiB
IsTruncated : Yes
FileExtension_Invalid : mxf

Other
CaptureGammaEquation_FirstFrame : 0401010101080000
IrisFNumber_FirstFrame : 8.000000
FocusPositionFromImagePlane_FirstFrame : 3.180 m
AutoExposureMode_FirstFrame : Manual
AutoFocusSensingAreaSetting_FirstFrame : Full Screen Sensing Auto
ShutterSpeed_Time_FirstFrame : 1/50 s
CameraMasterGainAdjustment_FirstFrame : 15.00 dB
ISOSensitivity_FirstFrame : 640
ElectricalExtenderMagnification_FirstFrame : 100%
AutoWhiteBalanceMode_FirstFrame : Hold
ExposureIndexofPhotoMeter_FirstFrame : 640


to:


General
Unique ID : 254926579696876684324323622767592138218 (0xBFC912C6CB0EAF117D2860D4619EE5EA)
Complete name : \\mibcssda001\Scambio 15GG\PEREGO\SPERIAMO\SPERIAMO2.mkv
Format : Matroska
Format version : Version 4
File size : 5.46 GiB
Overall bit rate : 800 b/s
Encoded date : UTC 2022-05-22 10:33:19
Writing application : mkvmerge v67.0.0 ('Under Stars') 64-bit
Writing library : libebml v1.4.2 + libmatroska v1.6.4

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Codec ID : V_MPEG4/ISO/AVC
Bit rate : 800 b/s
Width : 144 pixels
Height : 160 pixels
Display aspect ratio : 0.900
Frame rate mode : Variable
Frame rate : 0.001 FPS
Bits/(Pixel*Frame) : 34.722
Stream size : 5.46 GiB (100%)
Default : Yes
Forced : No




which doesn't make sense.
That "Format Extension Invalid" gave me a hunch, so I renamed it from .mp4 to .mxf, but it didn't work.
The funny thing is that mkvtoolnix detects the bitstream as H.264 10bit which is almost definitely correct.
I'm pretty sure they've been shooting in 1920x1080 4:2:2 10bit planar (probably either 25p or 50p), so the idea would be to recreate an header that says that so that I can recover the bitstream, but... how do I do that?
Keep in mind that I have no interest whatsoever in the original file, I just want to re-encode it into something playable.

File 1: https://filetransfer.io/data-package/hycUtGOK#link
File 2: https://filetransfer.io/data-package/brY43jnj#link

Dogway
22nd May 2022, 12:20
Use recover_mp4 (http://slydiman.me/eng/mmedia/recover_mp4.htm). You just need to supply a similar clip to copy header from.

FranceBB
22nd May 2022, 14:55
Thanks Dogway, it actually worked. :D

https://i.imgur.com/WoyBbtx.png

I'm gonna save it for future references in case something like this happens again.