## Sinopse básica do comando FFMPEG: ffmpeg [global_options] {[input_file_options] -i ‘input_file’} ... {[output_file_options] ‘output_file’} ... >>> Alguns exemplos úteis: # To set the video bitrate of the output file to 64 kbit/s: ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi # To force the frame rate of the output file to 24 fps: ffmpeg -i input.avi -r 24 output.avi # Para obter Informações sobre um determinado vídeo: ffprobe ffprobe video.mov # P/ reduzir tamanho do vídeo: ffmpeg -i pendulo.mp4 -s 360x270 pendulo2.mp4 # P/ decompor o vídeo em frames (imagens separadas): ffmpeg -i "video.mts" -an -f image2 "output_%05d.png" ffmpeg -i video.avi -an -s 720x540 -f image2 "imagem_%04d.jpg" # P/ reconstruir o video a partir das imagens PNG: ffmpeg -r 6 -pattern_type glob -i '*.png' -c:v libx264 -r 60 -vf format=yuv420p out.mp4 ### :ATENÇÃO RECURSO ÚTIL PARA O PROJETO DESSE SEMESTRE: ### # Produzir contador de tempo diretamente no vídeo, fazendo redução para 360p (full-HD: 1440x1080) # e remove interlaçamento (-deinterlace), convertendo para *.mp4 e removendo audio (-an): ffmpeg -i pendulo1.mts -vf "drawtext=fontfile=/Library/Fonts/Arial.ttf: fontsize=61: timecode='00\:00\:00\:00': r=30: \ x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" -an -y -s 360x270 -deinterlace pendulo3.mp4 >># Melhores fontes no Mac OS X # << (p/ usuários do Mac OS) ffmpeg -i Clip-TrilhoAr.mp4 -vf "drawtext=fontfile=/Library/Fonts/DejaVuLGCSans-ExtraLight.ttf:fontsize=34: timecode='00\:00\:00\;00': r=30: \x=(w-tw)/2: y=2*lh : fontcolor=black: box=0: boxcolor=0x00000000@1" -an -y out.mp4 ffmpeg -i pendulo1.mts -vf "drawtext=fontfile=/Library/Fonts/Arial.ttf: fontsize=70: timecode='00\:00\:00\;00': r=30: \ x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" -an -y -s 360x270 -deinterlace out.mp4 ### ATENÇÃO! ### >> No filtro drawtext é OBRIGATÓRIO informar o "fontfile". >> No Mac OS X, fontes estão no diretório: /Library/Fonts... escolher arquivo .ttf desejado p/ fontes >>> no caso do Windows as fontes TTF normalmente estão no diretório /windows/fonts/*.ttf (escolher uma e usar: ex.: Arial.ttf) ============== :Câmera Lenta: ============== # To slow down your video, you can type: ffmpeg -i input.mkv -filter:v "setpts=2.0*PTS" output.mkv ou ffmpeg -i input.mp4 -vf "setpts=2.0*PTS" out.mp4 (* P/ acelerar multiplique PTS por 0.5, por exemplo… p/ redução (aceleração maiores) aplique múltiplas vezes *) >> ::CONTEÚDO OPCIONAL:: << -------------------------------------------- >>> Speeding up/slowing down audio You can speed up or slow down *audio* with the atempo audio filter. To double the speed of audio: ffmpeg -i input.mkv -filter:a "atempo=2.0" -vn output.mkv The atempo filter is limited to using values between 0.5 and 2.0 (so it can slow it down to no less than half the original speed, and speed up to no more than double the input). If you need to, you can get around this limitation by stringing multiple atempo filters together. The following with quadruple the audio speed: ffmpeg -i input.mkv -filter:a "atempo=2.0,atempo=2.0" -vn output.mkv Using a complex filtergraph, you can speed up video and audio at the same time: ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mkv -------------------------------------------- :: CONCATENAR VIDEOS :: >> Para combinar vários vídeos em um único arquivo contínuo… ffmpeg -i clip1.mp4 -i clip2.mp4 -i clip3.mp4 -filter_complex concat=n=3:v=1 novoclip-concatenado.mp4