1

I'm trying to use FFMpeg to do some processing on my input video files which is then given to an emulator software (a packetization software) for further processing. The emulator is basically a packetization software. But no matter what it is, the original video file which works is attached. The creator of the file said he used bento4 tool for creation of the file. What is different from that tool from FFmpeg?

The problem is that the emulator can read the original video file, but when I simply use the command ffmpeg -i input.video -c copy output.mp4, while it should essentially copy all configurations, the emulator can not read and process the new file.

Here is a copy of the original .mp4 file which works fine in the emulator.

I used mediainfo tool to compare the details of the two files and noticed while all video codec related configs are the same, there are some differences in the header sizes which probably are causing the problems. Is there any ways to force FFmpeg to keep headers information (aside from codecs)? Or maybe there are other problems? In any case, the output video is not being totally the same.

UPDATE: I'm still struggling with the issue. I looked into the emulator code, and it parses the MOOV and fragment headers for information. Using the MP4 explorer software, I notice in my generated .mp4 file, for all moof.traf.trun, sample duration is 0, but in the Track Fragment Header box, it sets the default_sample_duration to 512. While in the working file, there is no default_sample_duration, and each individual sample has a duration of size 512. I guess this might be the problem. Now any ways to make it like original?

enter image description here

6
  • What the heck do you mean by “emulator?” Jul 17 '17 at 15:57
  • The emulator is basically a packetization software. But no matter what it is, the original video file which works is attached.
    – Ariana
    Jul 17 '17 at 16:19
  • I'm not sure if this can be solved … at least not without having access to that “emulator” software and debugging it. Do you get any log output as to what's wrong? Does it say why it cannot process the file? Can you check with a developer?
    – slhck
    Jul 17 '17 at 17:33
  • Not a specific error. It looks NULL to it: loading binary file\ pthread_join(thread[1], NULL);
    – Ariana
    Jul 17 '17 at 17:39
  • 2
    Hm, this question comes down to guesswork then. It's ultimately a bug/problem in proprietary software, which we cannot (easily) solve without a lot of back and forward.
    – slhck
    Jul 17 '17 at 18:38
2

If by header, you mean the MOOV box/atom, then ffmpeg will always construct a new box. It cannot copy boxes or their contents over. What your command does is tell FFmpeg to demux all streams from the original file and remux them into a new container.

Can you be specific in what your emulator looks for?

11
  • The emulator is basically a packetization software. But no matter what it is, the original video file which works is attached.
    – Ariana
    Jul 17 '17 at 16:20
  • 2
    Your attached file has MOOV upfront, which ffmpeg does not do, by default. Try ffmpeg -i input.video -c copy -movflags +faststart output.mp4
    – Gyan
    Jul 17 '17 at 16:33
  • @Mulvya I would recommend to adjust your answer to add those details. Jul 17 '17 at 17:16
  • 1
    ok, mp4box indicates your source is fragmented mp4. So, try ffmpeg -i input.video -c copy -movflags +dash output.mp4
    – Gyan
    Jul 17 '17 at 18:00
  • 1
    @Mulvya Yes it is for streaming purposes. That throws a segmentation fault! segmentation fault (core dumped) Looks like we are getting close!
    – Ariana
    Jul 17 '17 at 18:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.