Page 1 of 1

MP4 Video & audio lost after angle change & Save Metadata

Posted: 22 Jun 2020 17:35
by xanda
We have managed to bork an MP4 video after saving it with new metadata and while the angle transform geometry was applied.

The file still 'plays' with VLC reporting that there are H264 video & AAC audio streams present but with nothing of either being displayed in the statistics. Other players exhibit the same.

Running it through ffprobe/ffmpeg yields the following (partial report):-
[h264 @ 0000000000398200] Invalid NAL unit size (2029866413 > 192170).
[h264 @ 0000000000398200] Error splitting the input into NAL units.
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000003854c0] decoding for stream 0 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000003854c0] Could not find codec parameters for stream 0
(Video: h264 (avc1 / 0x31637661), none(tv, bt709), 1920x1080, 20005 kb/s): unspecified pixel format
We've tried tinkering with the angle/geometry to see if this forces anything back but without success.

Is there a way to recover this video?

Re: MP4 Video & audio lost after angle change & Save Metadata

Posted: 23 Jun 2020 17:47
by RĂ©mi Denis-Courmont
It really depends how the tool involved broke it. I don't think anybody here can give an answer.

Re: MP4 Video & audio lost after angle change & Save Metadata

Posted: 23 Jun 2020 18:22
by xanda
Thank you for responding.
It really depends how the tool involved broke it...
This is really the question. Is there anyway to determine what has taken place (even if with another tool)?

Re: MP4 Video & audio lost after angle change & Save Metadata

Posted: 24 Jun 2020 09:35
by JohnyC
If you have a sample (playable) file recorded with the same camera and settings, you could extract metadata from it and then insert it into the corrupted MP4 file. There is a free tool, called "Recover MP4" that can do just that. Plus, you will need FFmpeg to merge the resulting video and audio streams into the final MP4 file. Both Recover MP4 and FFmpeg are command prompt tools, so you will have to run a few simple commands to get them working. There was a detailed guide on how to use them, which I can't find so far. If I recall where the guide is, I will update you here.

Re: MP4 Video & audio lost after angle change & Save Metadata

Posted: 25 Jun 2020 12:54
by JohnyC
If you have a sample (playable) file recorded with the same camera and settings, you could extract metadata from it and then insert it into the corrupted MP4 file. There is a free tool, called "Recover MP4" that can do just that. Plus, you will need FFmpeg to merge the resulting video and audio streams into the final MP4 file. Both Recover MP4 and FFmpeg are command prompt tools, so you will have to run a few simple commands to get them working. There was a detailed guide on how to use them, which I can't find so far. If I recall where the guide is, I will update you here.
I found the guide: https://restore.media/blog/how-to-fix-c ... -mp4-files

You need to scroll down to the section where the Recover MP4 tool is described. Again, it's free, but you'll have to run it through the Command Prompt. In reality, this isn't that complicated. But if you get any troubles, you can also PM me the file and I will try to repair it myself.

Re: MP4 Video & audio lost after angle change & Save Metadata

Posted: 25 Jun 2020 14:22
by xanda
Thank you for the tip. We have tried the utility but without success.

We tested Recover MP4 using a working/reference clip plus a copy of it in which to change the angle & metadata. Unfortunately the header transfer from reference to copy doesn't yield any useable result.

As far as we can tell the header is intact: metadata, resolution, audio bitrate and so forth are easily readable. When playing the broken file, VLC reports blocks of audio & video are decoded but none for playback/display.

It would be helpful to know what VLC does when saving a clip under these conditions.