I'm trying to encode the video in the same quality in the same format, but the output file is several times larger than the input file. Whyis it happens? I want to fix the encoding errors, but I can not do it without losing quality or increasing the file size. How to encode mp4 video without losing quality and increasing the size in Linux terminal?
I want to use the video to show online on my site. I'm using the call to ffmpeg below
ffmpeg input.mp4 -c:v libx264 -preset placebo -crf 0 -c:a aac -movflags faststart output.mp4
P.S. I will add here an example of errors. Even if I get here, I want to understand why ffmpeg increases my files. I encounter this regularly. This is the main question.
[h264 @ 0x56524c25dea0] Invalid NAL unit 0, skipping.
[h264 @ 0x56524c25dea0] error while decoding MB 32 2, bytestream -7
[h264 @ 0x56524c216260] Invalid NAL unit 0, skipping.
[h264 @ 0x56524c216260] error while decoding MB 46 16, bytestream -5
[h264 @ 0x56524c25dea0] Invalid NAL unit 8, skipping.
[h264 @ 0x56524c25dea0] error while decoding MB 36 1, bytestream -13
[aac @ 0x56524c1e6ea0] Number of bands (57) exceeds limit (44).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x56524c1e6ea0] channel element 3.10 is not allocated
Error while decoding stream #0:1: Invalid data found when processing input
...
[aac @ 0x56524c1e6ea0] Number of bands (48) exceeds limit (44).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x56524c1e6ea0] Error decoding AAC frame header.
Error while decoding stream #0:1: Error number -50531338 occurred
[aac @ 0x56524c1e6ea0] Input buffer exhausted before END element found
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x56524c1e6ea0] decode_pce: Input buffer exhausted before END element found
Error while decoding stream #0:1: Invalid data found when processing input
[null @ 0x56524c1e7d20] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 12351488 >= 12350464
[null @ 0x56524c1e7d20] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 12351488 >= 12351488