| | 4 | |
| | 5 | With CUVID |
| | 6 | {{{ |
| | 7 | ffmpeg -v verbose -hwaccel cuvid -c:v h264_cuvid -i input.mp4 -c:v h264_nvenc -b:v 3M -y output.mp4 |
| | 8 | ffmpeg version n4.1.4-22-g08d3cc2 Copyright (c) 2000-2019 the FFmpeg developers |
| | 9 | built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 20160609 |
| | 10 | configuration: --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-gpl --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-nonfree --enable-openssl --enable-nvenc --enable-cuda-sdk --enable-cuvid --enable-libnpp --enable-nvdec --enable-filter=scale_cuda --enable-filter=thumbnail_cuda --enable-filter=yadif_cuda --enable-libfdk_aac --disable-ffplay --bindir=/usr/local/bin |
| | 11 | libavutil 56. 22.100 / 56. 22.100 |
| | 12 | libavcodec 58. 35.100 / 58. 35.100 |
| | 13 | libavformat 58. 20.100 / 58. 20.100 |
| | 14 | libavdevice 58. 5.100 / 58. 5.100 |
| | 15 | libavfilter 7. 40.101 / 7. 40.101 |
| | 16 | libswscale 5. 3.100 / 5. 3.100 |
| | 17 | libswresample 3. 3.100 / 3. 3.100 |
| | 18 | libpostproc 55. 3.100 / 55. 3.100 |
| | 19 | [h264 @ 0x3ded340] Reinit context to 1920x1088, pix_fmt: yuv420p |
| | 20 | Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4': |
| | 21 | Metadata: |
| | 22 | major_brand : dash |
| | 23 | minor_version : 0 |
| | 24 | compatible_brands: iso6avc1mp41 |
| | 25 | creation_time : 2019-12-19T06:29:54.000000Z |
| | 26 | Duration: 00:04:56.21, start: 0.000000, bitrate: 3834 kb/s |
| | 27 | Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, progressive, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 29 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default) |
| | 28 | Metadata: |
| | 29 | creation_time : 2019-12-19T06:29:54.000000Z |
| | 30 | handler_name : ISO Media file produced by Google Inc. |
| | 31 | [h264_cuvid @ 0x3e13880] Initializing cuvid hwaccel |
| | 32 | [h264_cuvid @ 0x3e13880] CUVID capabilities for h264_cuvid: |
| | 33 | [h264_cuvid @ 0x3e13880] 8 bit: supported: 1, min_width: 48, max_width: 4096, min_height: 16, max_height: 4096 |
| | 34 | [h264_cuvid @ 0x3e13880] 10 bit: supported: 0, min_width: 0, max_width: 0, min_height: 0, max_height: 0 |
| | 35 | [h264_cuvid @ 0x3e13880] 12 bit: supported: 0, min_width: 0, max_width: 0, min_height: 0, max_height: 0 |
| | 36 | Stream mapping: |
| | 37 | Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> h264 (h264_nvenc)) |
| | 38 | Press [q] to stop, [?] for help |
| | 39 | [h264_cuvid @ 0x3e13880] Initializing cuvid hwaccel |
| | 40 | [h264_cuvid @ 0x3e13880] Formats: Original: cuda | HW: cuda | SW: nv12 |
| | 41 | frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A [graph 0 input from stream 0:0 @ 0x4ada6c0] w:1920 h:1080 pixfmt:cuda tb:1/24000 fr:24000/1001 sar:1/1 sws_param:flags=2 |
| | 42 | [h264_nvenc @ 0x3e13280] Loaded Nvenc version 9.1 |
| | 43 | [h264_nvenc @ 0x3e13280] Nvenc initialized successfully |
| | 44 | Output #0, mp4, to 'output.mp4': |
| | 45 | Metadata: |
| | 46 | major_brand : dash |
| | 47 | minor_version : 0 |
| | 48 | compatible_brands: iso6avc1mp41 |
| | 49 | encoder : Lavf58.20.100 |
| | 50 | Stream #0:0(und): Video: h264 (h264_nvenc) (Main), 1 reference frame (avc1 / 0x31637661), cuda(left), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 3000 kb/s, 23.98 fps, 24k tbn, 23.98 tbc (default) |
| | 51 | Metadata: |
| | 52 | creation_time : 2019-12-19T06:29:54.000000Z |
| | 53 | handler_name : ISO Media file produced by Google Inc. |
| | 54 | encoder : Lavc58.35.100 h264_nvenc |
| | 55 | Side data: |
| | 56 | cpb: bitrate max/min/avg: 0/0/3000000 buffer size: 6000000 vbv_delay: -1 |
| | 57 | frame= 3 fps=0.1 q=24.0 size= 0kB time=00:00:00.00 bitrate=9142.9kbits/s speed=1.9e-06x frame= 4 fps=0.1 q=33.0 size= 0kB time=00:00:00.04 bitrate= 9.2kbits/s speed=0.000965xframe= 5 fps=0.1 q=31.0 size= 0kB time=00:00:00.08 bitrate= 4.6kbits/s speed=0.00155x frame= 6 fps=0.1 q=30.0 size= 0kB time=00:00:00.12 bitrate= 3.1kbits/s speed=0.00167x frame= 7 fps=0.1 q=30.0 size= 0kB time=00:00:00.16 bitrate= 2.3kbits/s speed=0.00195x frame= 8 fps=0.1 q=29.0 size= 0kB time=00:00:00.20 bitrate= 1.8kbits/s speed=0.00217x |
| | 58 | }}} |
| | 59 | |
| | 60 | |
| | 61 | With software decode |
| | 62 | |
| | 63 | {{{ |
| | 64 | ffmpeg -v verbose -i input.mp4 -c:v h264_nvenc -b:v 3M -y output.mp4 |
| | 65 | ffmpeg version n4.1.4-22-g08d3cc2 Copyright (c) 2000-2019 the FFmpeg developers |
| | 66 | built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 20160609 |
| | 67 | configuration: --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-gpl --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-nonfree --enable-openssl --enable-nvenc --enable-cuda-sdk --enable-cuvid --enable-libnpp --enable-nvdec --enable-filter=scale_cuda --enable-filter=thumbnail_cuda --enable-filter=yadif_cuda --enable-libfdk_aac --disable-ffplay --bindir=/usr/local/bin |
| | 68 | libavutil 56. 22.100 / 56. 22.100 |
| | 69 | libavcodec 58. 35.100 / 58. 35.100 |
| | 70 | libavformat 58. 20.100 / 58. 20.100 |
| | 71 | libavdevice 58. 5.100 / 58. 5.100 |
| | 72 | libavfilter 7. 40.101 / 7. 40.101 |
| | 73 | libswscale 5. 3.100 / 5. 3.100 |
| | 74 | libswresample 3. 3.100 / 3. 3.100 |
| | 75 | libpostproc 55. 3.100 / 55. 3.100 |
| | 76 | [h264 @ 0x406c240] Reinit context to 1920x1088, pix_fmt: yuv420p |
| | 77 | Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4': |
| | 78 | Metadata: |
| | 79 | major_brand : dash |
| | 80 | minor_version : 0 |
| | 81 | compatible_brands: iso6avc1mp41 |
| | 82 | creation_time : 2019-12-19T06:29:54.000000Z |
| | 83 | Duration: 00:04:56.21, start: 0.000000, bitrate: 3834 kb/s |
| | 84 | Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, progressive, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 29 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default) |
| | 85 | Metadata: |
| | 86 | creation_time : 2019-12-19T06:29:54.000000Z |
| | 87 | handler_name : ISO Media file produced by Google Inc. |
| | 88 | Stream mapping: |
| | 89 | Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc)) |
| | 90 | Press [q] to stop, [?] for help |
| | 91 | [h264 @ 0x4093c00] Reinit context to 1920x1088, pix_fmt: yuv420p |
| | 92 | [graph 0 input from stream 0:0 @ 0x44e5440] w:1920 h:1080 pixfmt:yuv420p tb:1/24000 fr:24000/1001 sar:1/1 sws_param:flags=2 |
| | 93 | [h264_nvenc @ 0x4091d00] Loaded Nvenc version 9.1 |
| | 94 | [h264_nvenc @ 0x4091d00] Nvenc initialized successfully |
| | 95 | [h264_nvenc @ 0x4091d00] 1 CUDA capable devices found |
| | 96 | [h264_nvenc @ 0x4091d00] [ GPU #0 - < Tesla T4 > has Compute SM 7.5 ] |
| | 97 | [h264_nvenc @ 0x4091d00] supports NVENC |
| | 98 | Output #0, mp4, to 'output.mp4': |
| | 99 | Metadata: |
| | 100 | major_brand : dash |
| | 101 | minor_version : 0 |
| | 102 | compatible_brands: iso6avc1mp41 |
| | 103 | encoder : Lavf58.20.100 |
| | 104 | Stream #0:0(und): Video: h264 (h264_nvenc) (Main), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 3000 kb/s, 23.98 fps, 24k tbn, 23.98 tbc (default) |
| | 105 | Metadata: |
| | 106 | creation_time : 2019-12-19T06:29:54.000000Z |
| | 107 | handler_name : ISO Media file produced by Google Inc. |
| | 108 | encoder : Lavc58.35.100 h264_nvenc |
| | 109 | Side data: |
| | 110 | cpb: bitrate max/min/avg: 0/0/3000000 buffer size: 6000000 vbv_delay: -1 |
| | 111 | No more output streams to write to, finishing.e=00:04:52.37 bitrate=3034.1kbits/s speed=11.6x |
| | 112 | frame= 7102 fps=278 q=22.0 Lsize= 109408kB time=00:04:56.17 bitrate=3026.2kbits/s speed=11.6x |
| | 113 | video:109378kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.027704% |
| | 114 | Input file #0 (input.mp4): |
| | 115 | Input stream #0:0 (video): 7102 packets read (141882400 bytes); 7102 frames decoded; |
| | 116 | Total: 7102 packets (141882400 bytes) demuxed |
| | 117 | Output file #0 (output.mp4): |
| | 118 | Output stream #0:0 (video): 7102 frames encoded; 7102 packets muxed (112002911 bytes); |
| | 119 | Total: 7102 packets (112002911 bytes) muxed |
| | 120 | [AVIOContext @ 0x4092180] Statistics: 2 seeks, 431 writeouts |
| | 121 | [h264_nvenc @ 0x4091d00] Nvenc unloaded |
| | 122 | [AVIOContext @ 0x40734c0] Statistics: 141974669 bytes read, 0 seeks |
| | 123 | |
| | 124 | }}} |