I have the audio file on my s3 bucket and I have to crop it using some seconds portion from the whole file and upload it again at the exact location.
I am trying this using the FFmpeg command and shell_exec but the FFmpeg command is not executing on local as well as on the server.
I have divided my task into chunks :
- How to get the input file from the s3 bucket?
- How to write output file on s3 bucket in FFmpeg command execution output
- How to check shell_exec() function output or log?
MY Code:
$input_file= Storage::disk('recording_files')->url($path);
$new_file_with_crop = "ffmpeg -i ".$input_file." -ss 00:00:00 -to 00:00:15 -async 1 ".Storage::disk('recording_files')->put($path.'/test_audio.mp3',$input_file->getRealPath())." -y";
$new_file_with_crop_output = shell_exec($new_file_with_crop);