1
I am using ffmpeg to edit mp4 creation_time metadata, using the command:
ffmpeg -i input.mp4 -metadata creation_time="YYYY-MM-DD HH:MM:SS" -codec copy output.mp4
Creation date is successfully changed, but output files are drastically smaller than input (2.2 MB gets reduced to 1.4 MB). Can anyone explain to me why that is, and if it is something I should be concerned about? I don't want to lose video quality, all I want to do is edit metadata creation_time.
Thanks!
If all streams are still present, then you won't have lost any quality. To be sure about that, I'd be a bit more explicit:
ffmpeg -i input.mp4 -map 0 -c copy -metadata creation_time="YYYY-MM-DD HH:MM:SS" output.mp4
– flolilo – 2017-12-02T00:49:09.847I tried testing both command syntaxes on an .mp4; both resulted in identical outputs, a few bytes larger in size than the original, but identical to each other. – Nevin Williams – 2017-12-02T02:20:28.120
An indication that a possible lossy re-encoding is taking place is the execution time. A straight copy is fast; a re-encoding takes time.
Also, you can compare the output from
ffmpeg -i input.mp4
andffmpeg -i output.mp4
to compare the info of each file. Perhaps there was some extraneous data in the original that got trimmed in the modified file. – Nevin Williams – 2017-12-02T02:27:43.857@flolilolilo Thanks, I updated my script with your suggestions. I – mux – 2017-12-02T04:25:50.250
@flolilolilo There appears to be only that size discrepancy for smaller sized mp4's. I did compare the bitrate in the 2.2 MB input file vs the 1.4 MB output file, the input was at 11637 kb/s vs 7567 kb/s for output. Do you know why it would have changed so much? All the other metadata seems consistent between input/output. – mux – 2017-12-02T04:32:55.123
@NevinWilliams After running the script on larger size mp4's I'm getting results consistent with you. (see my comment above). The command does run quickly so I'm assuming its working correctly. – mux – 2017-12-02T04:38:10.367
Share the full log of the run on the small file – Gyan – 2017-12-02T04:59:21.960
@Mulvya here you go: https://pastebin.com/37r98W7v
– mux – 2017-12-02T05:36:49.6931The copy seems fine. Note that the bitrates of the input streams are 7497 and 123 kbps, so the output has the media streams intact. I suspect there's some payload within the MOOV box, most likely in the UDTA that ffmpeg will ignore when making a new MP4. – Gyan – 2017-12-02T05:52:14.033
I have the same problem for all of my video. This is my command: ffmpeg -i " 1920x1080test.mp4" -filter:v subtitles="subname.ass" -c:a copy -c:v libx264 -crf 22 "outtest.mp4" – Bonn – 2019-05-08T09:17:20.413