TestFffmpegDecodeGPU runs ffmpeg in a GPU container using NVDEC.
(t *testing.T)
| 39 | |
| 40 | // TestFffmpegDecodeGPU runs ffmpeg in a GPU container using NVDEC. |
| 41 | func TestFffmpegDecodeGPU(t *testing.T) { |
| 42 | ctx := context.Background() |
| 43 | container := dockerutil.MakeContainer(ctx, t) |
| 44 | defer container.CleanUp(ctx) |
| 45 | opts, err := dockerutil.GPURunOpts(dockerutil.SniffGPUOpts{Capabilities: "compute,video"}) |
| 46 | if err != nil { |
| 47 | t.Fatalf("Failed to get GPU run options: %v", err) |
| 48 | } |
| 49 | opts.Image = "benchmarks/ffmpeg" |
| 50 | // h264_cuvid refers to NVDEC. See Section 4.2 in |
| 51 | // https://docs.nvidia.com/video-technologies/video-codec-sdk/pdf/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration.pdf |
| 52 | cmd := strings.Split("ffmpeg -y -vsync 0 -c:v h264_cuvid -i encoded.mp4 output.mp4", " ") |
| 53 | if output, err := container.Run(ctx, opts, cmd...); err != nil { |
| 54 | t.Errorf("failed to run container: %v; output:\n%s", err, output) |
| 55 | } |
| 56 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…