Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg - generate moov atom

I am currently recording video with blackmagic's prorecorder. I transcode video on-the-fly to mp4 video container with ffmpeg. Duration is unknown as I'm transcoding .ts that prorecorder is outputting to named pipe.

My goal is to try to play this file with browser, while stream is still being recorded - Playback is great, but problem is that when I open file, duration is defined to current recording time.

So, question is - I would like to generate a "fake" moov atom for duration of fe. 8 hours with ffmpeg, and then start recording mp4 file as I'm already doing. How could I do this?

Documentation that I checked and I think it's relevant - https://ffmpeg.org/ffmpeg-formats.html#MOV_002fMP4_002fISMV I also saw this on stack: Is it possible to fake a (mp4) moov atom?

like image 860
mmx Avatar asked Aug 18 '13 01:08

mmx


People also ask

How do you get MOOV atom?

Step 1: Open the command prompt on your computer. Step 2: Download and run MP4box. Step 3: Add the video files' locations having the issue "Moov atom not found". Step 4: Once the video file's location is added, add this further command from the mp4 box.

How do you fix missing MOOV atom?

Method 1: Download the video again from the source If possible, download the video file again from the source, be it from the Internet, CD/DVD, Android, or other devices. Get your video again and this time, make sure the file is properly and completely downloaded or transferred without any interruption.

What is a MOOV atom?

moov atom is the special part of the file, which defines the timescale, duration, display characteristics of the video, as well as subatoms containing information for each track in the video. This atom may be located at the end of the file, which is why you may get the error when the file was not completely uploaded.


1 Answers

I had a similar problem and only discovered it after encoding nearly 2000 videos. Instead of starting over, I used this command to insert the moov atom:

/usr/bin/ffmpeg -i ./input.mp4 -c:v copy -movflags faststart -strict -2 ./output.mp4
like image 56
Alan Avatar answered Sep 22 '22 09:09

Alan