aceleração de hardware

aceleração de hardware

  • Gerando vídeo de images jpeg com ffmpeg usando aceleração de hardware no MacOS

    Eu já escrevi sobre isso em Linux com Intel (Usando a GPU para renderizar vídeo) e depois em Linux com NVIDIA (Renderizando as fotos da GoPro em vídeo mpeg4 com ffmpeg e NVIDIA).  Agora eu testei como fazer isso no MacOS.

    E deu muito certo.

    O comando e saída foram esses:

    $ ffmpeg -r 1 -i G%04d.JPG -c:v h264_videotoolbox -b:v 5M -pix_fmt yuv420p output.mp4
    ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
      built with Apple clang version 14.0.3 (clang-1403.0.22.14.1)
      configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.0 --enable-shared --enable-pthreads 
    --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls
    --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d
    --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband
    --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora
    --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp
    --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma
    --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass
    --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex
    --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack
    --enable-videotoolbox --enable-neon libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 4. 10.100 / 4. 10.100 libpostproc 57. 1.100 / 57. 1.100 Input #0, image2, from 'G%04d.JPG': Duration: 00:03:05.08, start: 0.000000, bitrate: N/A Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 4000x3000, 25 fps, 25 tbr, 25 tbn File 'output.mp4' already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (h264_videotoolbox)) Press [q] to stop, [?] for help [swscaler @ 0x130018000] deprecated pixel format used, make sure you did set range correctly [swscaler @ 0x128478000] deprecated pixel format used, make sure you did set range correctly [swscaler @ 0x138008000] deprecated pixel format used, make sure you did set range correctly [swscaler @ 0x108e58000] deprecated pixel format used, make sure you did set range correctly Output #0, mp4, to 'output.mp4': Metadata: encoder : Lavf60.3.100 Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt470bg/unknown/unknown, progressive), 4000x3000, q=2-31, 5000 kb/s, 1 fps, 16384 tbn Metadata: encoder : Lavc60.3.100 h264_videotoolbox frame= 4627 fps= 21 q=-0.0 Lsize= 2824030kB time=01:17:06.00 bitrate=5001.0kbits/s speed=21.5x video:2823985kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001582%

    O que fez a mágica aqui foi o parâmetro "h264_videotoolbox".  Juntei 4626 imagens JPEG da última pedalada que fizemos em um vídeo de pouco mais de 1 hora.  E agora vou trabalhar em cima pra fazer o vídeo no formato adequado, trilha sonora e tamanho menor.

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.