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.