So, you can cut the required video part starting from 0th second to nth second where video ends. So, output would be either the length of the video (if that was greater than length of input audio) or it would be length of audio otherwise. I have also removed the -shortest flag in previous command. exec("$ffmpeg -framerate 1/5 -i $convImgPath -i $audioPath -c:v libx264 -r 30 -c:a aac -strict experimental -b:a 16k $output") Replace your 2 exec statements with the following one and it should work. Problem of displaying only 1 image can be solved by setting output video frame rate by -r option. So is there a flag to tell ffmpeg to cut the keep the length of the output video to the length of the input video?Īudio conversion from wav format to mp3 is NOT needed in your case. Using -shortest cuts the video file short if the audio file is shorter than the video. However this extends the output video file to be the length of the audio file if it is longer than the video. $output = 'upload/2016/01/video_81332_1453307709.mp4' Įxec("$ffmpeg -i $audioPath -f mp2 $convAudioPath") Įxec("$ffmpeg -framerate 1/5 -i $convImgPath -i $convAudioPath -c:v libx264 -c:a aac -strict experimental -b:a 16k -shortest $output") I want to converted video playing all images with audio. In my knoledge : Because the audio file size is very low. Here i am converted video from images(8) and audio(file size: 307KB).īut the video is playing one image with audio and others are without audio.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |