[FFmpeg-user] How can FFmpeg truncate "00" Binary Codes in a MP4 video file?

PureOcean pureocean1 at gmail.com
Wed Jul 13 01:13:40 EEST 2016

Dear Hoyos,

Thank you very much for your reply and interest.

I able to read your reply over the web site. Because your reply is not 
delivered to my inbox. Therefore, I just now writing this reply over my 
own mesasage in Thunderbird.
I think, the reason for this, due to I sent my e-mail before without 
click to the confirm link. I'm newbie in here. :)

I uploaded two sample video file to Mega.Nz.


This MKV file real size is 642 MB but how can be packed as 37 MB? 
Because the MKV file containts many 00 (gaps hex code). I input 
Potplayer as stream URL a link of Sintel video. When the video playing, 
a few times I clicked to random.ly forward scenes. I terminated 
application. So, the stream (temp) video's size became small "size on 
disk" in comparison with real-size. Because, it is many contaains 
zero-fill/gap ("00" hex codes). Run for fix:

FFmpeg.exe -i "Random_Seeking_Stream-Sintel_Sample.mkv" -c copy Output.mkv

Result: FFmpeg truncated empty gaps and it's the output video's size now 
as it should be. 36 MB. That is to say, it's contain only playing 
scenes, without blank, empty, "00" full codes.

But there have a issue: The output video's timestamp still remains as 
the input video. I tried the "-reset_timestamps 1" switch. No change.

Another thing is MP4/MOV issue.


This MOV file real size is 397 MB. I applied same method to MOV video 
file. I opened MOV's URL with Potplayer . As stream playing, I clicked a 
few times random forwards. And terminated player. While as result stream 
temp video saved only 16 MB on disk, but ino change real size. Because, 
it contain zero bytes codes.

Run: FFmpeg.exe -i "Random_Seeking_Stream-Bunny_Sample.mov" -c copy 

Result: FFmpeg couldn't truncate zero-fill-gap bytes codes of input 
video. To boot, it saved output.mov's filesize same as real-size of 
input video. That is to say, the output video stores completely as 397 
MB size on disk, too. Besides, the output video's timestamps still 
remain same as input video.


1) On MKV files zero-bytes can be truncate but output's timestamps can't 
fix .
2) On MP4/MOV files zero-bytes can't truncate. Also, output video's 
timestamps can't fix.

I just spent too many hours trying to fix. But, I 'couldn't find true 

Which FFmpeg's command-switch can be correct this problems?  Would you 
help me with this? I would love to.


More information about the ffmpeg-user mailing list