francois:ffmpeg_usage
Différences
Ci-dessous, les différences entre deux révisions de la page.
| francois:ffmpeg_usage [2020/01/31 17:54] – créée francois | francois:ffmpeg_usage [2020/04/06 13:56] (Version actuelle) – francois | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | h1. FFMPEG usage | + | ====== |
| - | {{> | + | ====== |
| - | + | ||
| - | h2. useful links | + | |
| https:// | https:// | ||
| Ligne 11: | Ligne 9: | ||
| https:// | https:// | ||
| - | h2. Configuration d' | + | ====== |
| - | < | + | |
| - | sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \ | + | |
| libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \ | libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \ | ||
| libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev x264 libx264-dev | libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev x264 libx264-dev | ||
| - | </ | ||
| - | |||
| - | <pre> | ||
| - | sudo apt-get install yasm | ||
| - | </ | ||
| - | h2. Compilation | + | sudo apt-get install yasm |
| - | < | + | ====== |
| - | PATH=" | + | |
| - | --prefix=" | + | |
| - | --pkg-config-flags=" | + | |
| - | --extra-cflags=" | + | |
| - | --extra-ldflags=" | + | |
| - | --bindir=" | + | |
| - | --enable-gpl \ | + | |
| - | --enable-libass \ | + | |
| - | --enable-libfdk-aac \ | + | |
| - | --enable-libfreetype \ | + | |
| - | --enable-libmp3lame \ | + | |
| - | --enable-libopus \ | + | |
| - | --enable-libtheora \ | + | |
| - | --enable-libvorbis \ | + | |
| - | --enable-libvpx \ | + | |
| - | --enable-libx264 \ | + | |
| - | --enable-nonfree \ | + | |
| - | --enable-decklink \ | + | |
| - | --extra-cflags=-I/ | + | |
| - | make -j 8 | + | PATH=" |
| - | sudo make install | + | |
| + | | ||
| + | --extra-cflags=" | ||
| + | --extra-ldflags=" | ||
| + | --bindir=" | ||
| + | --enable-gpl \ | ||
| + | --enable-libass \ | ||
| + | --enable-libfdk-aac \ | ||
| + | --enable-libfreetype \ | ||
| + | --enable-libmp3lame \ | ||
| + | --enable-libopus \ | ||
| + | --enable-libtheora \ | ||
| + | --enable-libvorbis \ | ||
| + | --enable-libvpx \ | ||
| + | --enable-libx264 \ | ||
| + | --enable-nonfree \ | ||
| + | --enable-decklink \ | ||
| + | --extra-cflags=-I/ | ||
| - | </ | + | make -j 8 |
| + | sudo make install | ||
| - | h2. Usage | + | ====== |
| - | h3. List output devices | + | ===== List output devices |
| ffmpeg -i test.avi -f decklink -list_devices 1 dummy | ffmpeg -i test.avi -f decklink -list_devices 1 dummy | ||
| - | h3. List supported formats: | + | ===== List supported formats |
| ffmpeg -i test.avi -f decklink -list_formats 1 ' | ffmpeg -i test.avi -f decklink -list_formats 1 ' | ||
| - | h3. Play video clip: | + | ===== Play video clip ===== |
| ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 ' | ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 ' | ||
| - | h3. Play video clip with non-standard framerate or video size: | + | ===== Play video clip with non-standard framerate or video size ===== |
| ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 ' | ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 ' | ||
| - | h3. List output devices | + | ===== List output devices |
| ffmpeg -f decklink -list_devices 1 dummy -i big_buck_bunny_1080p_stereo.avi | ffmpeg -f decklink -list_devices 1 dummy -i big_buck_bunny_1080p_stereo.avi | ||
| - | h3. List supported formats | + | ===== List supported formats |
| ffmpeg -f decklink -list_formats 1 ' | ffmpeg -f decklink -list_formats 1 ' | ||
| - | h3. Play video clip | + | ===== Play video clip ===== |
| ffmpeg -f decklink | ffmpeg -f decklink | ||
| Ligne 83: | Ligne 74: | ||
| mplayer capture.raw -demuxer rawvideo -rawvideo fps=29.97: | mplayer capture.raw -demuxer rawvideo -rawvideo fps=29.97: | ||
| - | h3. List input devices: | + | ===== List input devices |
| ffmpeg -f decklink -list_devices 1 -i dummy | ffmpeg -f decklink -list_devices 1 -i dummy | ||
| - | h3. List supported formats: | + | ===== List supported formats |
| ffmpeg -f decklink -list_formats 1 -i ' | ffmpeg -f decklink -list_formats 1 -i ' | ||
| - | h3. Capture video clip at 1080i50: | + | ===== Capture video clip at 1080i50 |
| ffmpeg -format_code Hi50 -f decklink -i ' | ffmpeg -format_code Hi50 -f decklink -i ' | ||
| - | h3. Capture video clip at 1080i50 10 bit: | + | ===== Capture video clip at 1080i50 10 bit ===== |
| ffmpeg -bm_v210 1 -format_code Hi50 -f decklink -i ' | ffmpeg -bm_v210 1 -format_code Hi50 -f decklink -i ' | ||
| - | h3. Capture video clip at 1080i50 with 16 audio channels: | + | ===== Capture video clip at 1080i50 with 16 audio channels |
| ffmpeg -channels 16 -format_code Hi50 -f decklink -i ' | ffmpeg -channels 16 -format_code Hi50 -f decklink -i ' | ||
| - | |||
| ffmpeg -format_code Hp29 -f decklink -i ' | ffmpeg -format_code Hp29 -f decklink -i ' | ||
| ffmpeg -format_code Hp29 -f decklink -i ' | ffmpeg -format_code Hp29 -f decklink -i ' | ||
| - | h3. Compression h.264 | + | ===== Compression h.264 ===== |
| ffmpeg -i video_720p-16Mbps.mp4 -c:v libx264 -preset fast -crf 10 -profile:v high -level 4.0 video_opengl_scaled_720p_compressé_2.mp4 | ffmpeg -i video_720p-16Mbps.mp4 -c:v libx264 -preset fast -crf 10 -profile:v high -level 4.0 video_opengl_scaled_720p_compressé_2.mp4 | ||
| Ligne 114: | Ligne 104: | ||
| The options are documented in the ffmpeg site. | The options are documented in the ffmpeg site. | ||
| - | h3. Crop and pad filters | + | ===== Crop and pad filters |
| ffmpeg -i video_720p-16Mbps.mp4 -vf " | ffmpeg -i video_720p-16Mbps.mp4 -vf " | ||
| - | h3. display terratec G1 (USB composite capture). Display the captured input in a window | + | ===== display terratec G1 (USB composite capture). Display the captured input in a window |
| ffmpeg -input_format rgb565 -i /dev/video0 -f opengl " | ffmpeg -input_format rgb565 -i /dev/video0 -f opengl " | ||
| - | h3. Display blackmagic input on a opengl window | + | ===== Display blackmagic input on a opengl window |
| ffmpeg -format_code hp50 -f decklink -i ' | ffmpeg -format_code hp50 -f decklink -i ' | ||
| - | h3. Test frames generation | + | ===== Test frames generation |
| ffmpeg -f lavfi -i testsrc2=duration=100: | ffmpeg -f lavfi -i testsrc2=duration=100: | ||
| with white box in the first second | with white box in the first second | ||
| - | |||
| ffmpeg -f decklink | ffmpeg -f decklink | ||
| Ligne 158: | Ligne 147: | ||
| ffmpeg -f lavfi -i testsrc2=duration=10: | ffmpeg -f lavfi -i testsrc2=duration=10: | ||
| - | h3. Other examples | + | ===== Other examples |
| - | < | + | |
| - | stream = ffmpeg.input(' | + | stream = ffmpeg.output(stream, |
| - | stream = ffmpeg.output(stream, | + | ffmpeg.run(stream, |
| - | ffmpeg.run(stream, | + | ffmpeg.run(stream, |
| - | ffmpeg.run(stream, | + | |
| - | </ | + | |
| ffmpeg -i test.mp4 -filter_complex " | ffmpeg -i test.mp4 -filter_complex " | ||
| Ligne 172: | Ligne 159: | ||
| ---- | ---- | ||
| - | use -ss 1 to avoid the recording of the Colored Mire at the beginning | ||
| - | <pre> | ||
| - | ffmpeg -format_code 24ps -ss 1 -f decklink -i ' | ||
| - | ffplay output.avi | ||
| + | use -ss 1 to avoid the recording of the Colored Mire at the beginning | ||
| + | ffmpeg -format_code 24ps -ss 1 -f decklink -i ' | ||
| + | ffplay output.avi | ||
| - | [decklink @ 0x3f08560] Supported formats for ' | + | |
| format_code | format_code | ||
| ntsc 720x486 at 30000/1001 fps (interlaced, | ntsc 720x486 at 30000/1001 fps (interlaced, | ||
| Ligne 197: | Ligne 183: | ||
| hp59 1280x720 at 60000/1001 fps | hp59 1280x720 at 60000/1001 fps | ||
| hp60 1280x720 at 60000/1000 fps | hp60 1280x720 at 60000/1000 fps | ||
| - | </ | ||
| - | |||
| - | <pre> | ||
| - | stream = ffmpeg.input(' | ||
| - | stream = ffmpeg.output(stream, | ||
| - | ffmpeg.run(stream, | ||
| - | ffmpeg.run(stream, | ||
| - | </ | ||
| + | stream = ffmpeg.input(' | ||
| + | stream = ffmpeg.output(stream, | ||
| + | ffmpeg.run(stream, | ||
| + | ffmpeg.run(stream, | ||
| ffmpeg -i test.mp4 -filter_complex " | ffmpeg -i test.mp4 -filter_complex " | ||
| - | < | + | |
| - | # play sequence in loop | + | # (ffmpeg.input(' |
| - | # (ffmpeg.input(' | + | # |
| - | # | + | # |
| - | # | + | # ) |
| - | # ) | + | |
| - | </ | + | |
| ffmpeg -f dekclink -pix_fmt uyvy422 ' | ffmpeg -f dekclink -pix_fmt uyvy422 ' | ||
| + | adds black frames at the beginning | ||
| - | adds black frames at the beginning | ||
| - | < | + | |
| - | in_file = ffmpeg.input(' | + | marker = ffmpeg.input(' |
| - | marker = ffmpeg.input(' | + | ffmpeg.concat( |
| - | ffmpeg.concat( | + | marker.trim(start_frame=0, |
| - | marker.trim(start_frame=0, | + | in_file |
| - | in_file | + | ).output(' |
| - | ).output(' | + | |
| - | </ | + | |
francois/ffmpeg_usage.1580493255.txt.gz · Dernière modification : (modification externe)
