0

I have 9 files: FHD001.MOV to FHD009.MOV. They come from 3 recordings: FHD001, FHD002-FHD007 and FHD008-FHD009. Apart from FHD001 and FHD007 all are about 2.3GB each.

With ffmpeg I can transcode FHD002-FDD004 without problems.

The other file give a moov atom not found error.

I was able to repair FHD001 with ffmpeg by applying "-movflags faststart". But this does not work with the other files.

The camera is not longer available and I do not remember brand or model.

ffmpeg output of FHD002.MOV, the working file:

Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'FHD0002.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
  Duration: 00:05:00.08, start: 0.000000, bitrate: 61534 kb/s
    Stream #0:0(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj420p(pc, bt470bg/unknown/unknown), 3840x2160, 60121 kb/s, 25 fps, 25 tbr, 60k tbn, 60k tbc (default)
    Metadata:
      handler_name    : Video Handler
      encoder         : iCatch AVCC
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 44100 Hz, stereo, s16, 1411 kb/s (default)
    Metadata:
      handler_name    : Audio Handler

ffmpeg output of FHD001.MOV when applying -movflags faststart

Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'FHD0001.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
  Duration: 00:00:06.20, start: 0.000000, bitrate: 61515 kb/s
    Stream #0:0(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj420p(pc, bt470bg/unknown/unknown), 3840x2160, 60123 kb/s, 25 fps, 25 tbr, 60k tbn, 60k tbc (default)
    Metadata:
      handler_name    : Video Handler
      encoder         : iCatch AVCC
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 44100 Hz, stereo, s16, 1411 kb/s (default)
    Metadata:
      handler_name    : Audio Handler
Output #0, mov, to 'vid1.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    encoder         : Lavf58.18.104
    Stream #0:0(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj420p(pc, bt470bg/unknown/unknown), 3840x2160, q=2-31, 60123 kb/s, 25 fps, 25 tbr, 60k tbn, 60k tbc (default)
    Metadata:
      handler_name    : Video Handler
      encoder         : iCatch AVCC
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 44100 Hz, stereo, s16, 1411 kb/s (default)
    Metadata:
      handler_name    : Audio Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
[mov @ 000001ba0d881540] Starting second pass: moving the moov atom to the beginning of the file
frame=  155 fps= 51 q=-1.0 Lsize=   46559kB time=00:00:06.16 bitrate=61916.6kbits/s speed=2.01x
video:45503kB audio:1051kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.009488%

Output for FHD005.MOV

[mov,mp4,m4a,3gp,3g2,mj2 @ 00000236d7269880] moov atom not found
FHD0005.MOV: Invalid data found when processing input

I tried to apply -movflags faststart to get a functioning video file

dnz
  • 23
  • 5
  • **(1)** Sounds like your MP4 recordings have the metadata added last (at back of file). I think `-movflags faststart` worked on the first file because you were lucky with that file. I suspect the other files must be when recording stopped suddenly(_eg:_ battery died?) before metadata could be written. When MOOV is not found, you'll have to recreate it. **(2)** FFmpeg cannot fix this. You'll need to edit the bytes of the MP4. This means referencing a working MP4 from same camera to transfer some "typical" metadata values that appear in every file (_eg:_ Width, Height, Frames-Per-Sec, etc). – VC.One Feb 01 '23 at 10:13
  • PS: Search for `MP4 file repair tool` on the Google site. Instead of coding this yourself, it'll be faster to use a utility that can read a working file and try to repair a damaged one. – VC.One Feb 01 '23 at 10:16

0 Answers0