![]() ![]() ![]() The final working command will be as in this example: ffmpeg -i YOUR-AUDIO.aac -i YOUR-PICTURE.jpg -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -crf 18 -map 0:a -map 1:v -r 25 YOUR-FINAL-VIDEO.mp4Įxtracting Portion of a Video or Audio from a Shared Dropbox Link Then specify an output quality for the h264 encoder, with the “-crf” option ( default value is 23), and finally mapping your audio and picture inputs with the “-map” option. Then, again, you may want to specify the rate (FPS=frame per second) of the video input with the “-r” option (after the “-i”). (See FFMPEG’s Color Syntax reference for more details on changing color values). The above command uses the FFMPEG’s “ Pad Filter“, which divides both the original widht and height by 2, round it up to the nearest pixel ( ceil), multiply by 2 again for make it an even number and adding black padding pixels (if needed) up to this number.Ĭolor of the padding can be changed using the option “:color ” at the end, such as follows: Thus, in order to produce a standard h264 file with audio and 1 picture, you may want to include the following filter into your instructions: -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" This is beacause the h264 encoder needs even dimensions. Error initializing output stream 0:1 - Error while opening encoder for output stream #0:1 – maybe incorrect parameters such as bit_rate, rate, width or height” “ width ( or height) non divisible by 2 ( w x h). You could instruct FFMPEG to do the following: ffmpeg -i YOUR-AUDIO.aac -i YOUR-PICTURE.jpg -map 0:a -map 1:v output.mp4īut with the above instructions, you may encounter the following error: You may want to add an audio track onto a single picture so to create an h264 file, using the audio lenght as the total lenght. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |