phpvideotoolkit-v2
phpvideotoolkit-v2 copied to clipboard
When
Hello, i have this error for create a vidéo by glob with img. And i don't understand.
Notice: Trying to access array offset on value of type null
I use this code :
$audio = new Audio($this->getParameter('kernel.project_dir') . '/public/music/Ballad_of_the_Sneak.mp3');
$process = $audio->getProcess();
$process->addPreInputCommand('-framerate', '1/5');
$process->addPreInputCommand('-pattern_type', 'glob');
$process->addPreInputCommand('-i', glob($this->getParameter('kernel.project_dir') . "/public/glob/*.jpg"));
$process->addCommand('-pix_fmt', 'yuv420p');
$process->addCommand('-shortest', '');
$output_format = new VideoFormat();
$output_format->setVideoFrameRate('1/5')
->setVideoDimensions(320, 240, true, true)
->setAudioCodec('libfdk_aac')
->setVideoCodec('mpeg4');
$process = $audio->save('./homemade-video.mp4', $output_format);
Can you help me please ?
Cordialy