1

I want to reduce the size of video files. I want to do it this way:

$thuc = exec("avconv -y -i $vfile -map 0 -c:v libx264 -crf 22 -c:a copy $vfile");

if ($video_width > 800) {
$thuc = exec("avconv -y -i $vfile -filter:v scale=\"750:trunc(ow/a/2)*2\" -c:a copy $vfile");
}

It doesn't work if input and output file names are the same. The file stays untouched. Does it mean that avconv can not override existing files and I have to choose a different name for output file and then delete the original file? I have read that -y option does overwriting but in reality it does not overwrite.

llogan
  • 121,796
  • 28
  • 232
  • 243
Verode
  • 145
  • 2
  • 9
  • ffmpeg does not do in-place editing, and I'm fairly sure, neither does avconv. – Gyan May 29 '18 at 05:19
  • Possible duplicate of [ffmpeg: add subtitles to mp4 with out creating a new file](https://stackoverflow.com/questions/45308561/ffmpeg-add-subtitles-to-mp4-with-out-creating-a-new-file) – llogan May 29 '18 at 17:57

0 Answers0