Log in

View Full Version : Corrupted files from a Sony Camera (UHD 29.970p BT2020 HLG)


FranceBB
15th December 2023, 23:06
Hi there,
JR, one of my colleagues, was out and about shooting stuff for fun in his spare time with his Sony and unfortunately they got corrupted.
Allegedly they're 3840x2160 29.970p 4:2:2 BT2020 HLG 10bit planar files encoded as H.264 Intra Level 5.2 with PCM 24bit 48'000Hz audio muxed as .mp4

It looks like Sony saves them internally as .rsv and then only muxes them into a right container, .mxf, at the end, when the file is effectively "closed" so what you have here are the .RSV files Link (https://wetransfer.com/downloads/30fd1be2327309e400e21d4e4367a37b20231213221828/740f62f3d6593b21926a45e1378f738620231213221852/456bee/grid)

Do you guys see any chance of recovery?
The mediainfo clearly says that the file is truncated and from an hex dump things don't look that good...

wswartzendruber
15th December 2023, 23:51
Are C1799.RSV and C1809.RSV supposed to be completely empty?

FranceBB
16th December 2023, 17:30
Those two are gone forever I'm afraid as they're quite literally impossible to copy from the memory card... :(
The other two have a certain file size but are nonetheless impossible to decode.
Indexing doesn't work, remuxing to mkv doesn't work (the file is remuxed with bogus info).
I think the only thing that *can* be done is taking one good file from the same camera with the same setting, copy the header and put it in the corrupted files and hope for the best.

I've asked JR for another good sample of his camera.

wswartzendruber
16th December 2023, 17:57
I think the only thing that *can* be done is taking one good file from the same camera with the same setting, copy the header and put it in the corrupted files and hope for the best.

I've asked JR for another good sample of his camera.
Yes, I concluded the same. At least for MP4 files shot on a Sony camera. I'm not sure of the distinction between MP4 and RSV, though.

Mounir
16th December 2023, 23:24
Try photorec, that's the best recovery tool i've used (and it's free), it look for mp4, mov formats like that though. You'll have to experiment and report back

StainlessS
17th December 2023, 16:57
+1 on PhotoRec [a more specific version of TestDisk media recovery tool]:- https://www.cgsecurity.org/wiki/PhotoRec
EDIT: For file recovery, but not file damage repair.

TestDisk:- https://www.cgsecurity.org/wiki/TestDisk

FranceBB
18th December 2023, 10:35
Well PhotoRec managed to recover the missing two files, however that doesn't help with the recovery.

After a few attempts transplanting stuff and writing random info to make the container work, this is as far as I've got:

https://i.imgur.com/EyJjO6b.jpg
https://i.imgur.com/HHNqNgY.jpg
https://i.imgur.com/IGp9Eqs.jpg


Reconstructed: Link (https://we.tl/t-iQI0LrQeQu) (link valid for 7 days)


Then I've got the good samples from JR and I tried swapping the header with the one of some good files.
Those are the good files I used to swap the header, though: Link (https://wetransfer.com/downloads/4aba69a8a6af1b73a7bceb87b073ebd320231218082850/49d9fea84b9be44d077764463bf944b820231218082902/8b6510?trk=TRN_TDL_01&utm_campaign=TRN_TDL_01&utm_medium=email&utm_source=sendgrid)


however the results are not what I expected:

https://i.imgur.com/04PQixU.png

I used recover_mp4 like so:


recover_mp4.exe "Z:\zzz_scambio\0000 INGEST\JR\header_good\stesse_spec_C1795.MP4" --analyze

recover_mp4.exe "Z:\zzz_scambio\0000 INGEST\JR\C1795.RSV" "Z:\zzz_scambio\0000 INGEST\JR\C1795_recontructed_v2.mp4"

pause


Mediainfo looks good, though, so I'm a bit puzzled:


Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High 4:2:2@L5.1
Format settings : CABAC / 2 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 2 frames
Bit rate mode : Variable
Maximum bit rate : 140 Mb/s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 (30000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 10 bits
Scan type : Progressive
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : HLG
Matrix coefficients : BT.2020 non-constant



Header Transplanted but somehow failed: Link (https://we.tl/t-EDqW0HJiL8)

If someone wants to try to get something better out of it, go for it.

richardpl
20th December 2023, 20:37
I have alpha-state RSV demuxer for Librempeg. I struggle to find any info about layout of kkad/rtmd chunk that also store exif like metadata.
Huge boost would be if someone from Sony gives more info about such layout, (rtmd chunk is also present in normal mp4 sony files).
It looks like it intentionally discards/does not store actual extradata feed to video decoder in RSV files, and that data needs to be recreated copied from working mp4 files of same specifications.
There is some info that some Sonny utility named like *something Browser *something have support for reading and parsing such metadata. So it would be helpful to get such binary in some form.

wswartzendruber
20th December 2023, 23:41
What I don't understand is...who in blazes would ever make a stream writer work like this? I mean...the camera knows the resolution, frame rate, transfer function, colorspace, etc. of the video it's recording...and this isn't going to change mid-stream so........

Oh well. I'm in the market for a camera, but at least now I know it's not going to be a Sony.

FranceBB
2nd April 2025, 12:22
were you able to recover those files?

yes, transplanting the header from a good file allowed me to play the file as well as index it and re-encode it, so it kinda worked, however keep in mind that not all slices were decodable as the video was actually truly corrupted.