0

i have this function in my laravel controller

foreach ($arrayi['audio'] as $i => $audioFile) {
            // Loop through the audio files and image files
                // Create a new video with the audio file and image file
                $dimensions = "1024x1024";
                // Set the audio and image file paths
                $audioPath = public_path("storage/{$arrayi['audio'][$i]}");
                $imagePath = public_path("storage/{$arrayi['links'][$i]}");
                $duration = exec("ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 {$audioPath}");
                // Set the command to create the video
                $command =exec("ffmpeg -loop 1 -i {$audioPath} -i {$imagePath} -t {$duration}  -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p output_{$i}.mp4");
               
                
                // Add the output video to the array of output videos
                $outputVideos[] = public_path("storage/output_{$i}.mp4");
            }

which is supposed to create multiple videos by running the ffmpeg command one by one for each image and audio. this is all done after clicking a button in browser.

I've tried printing the $command and then running it in cmd in windows and it all works fine but when i do it through the browser nothing happens. the $duration command works fine it passes the duration to the ffmpeg command .

Altin
  • 1
  • 1

0 Answers0