TestFffmpegEncodeGPU runs ffmpeg in a GPU container using NVENC.
(t *testing.T)
| 23 | |
| 24 | // TestFffmpegEncodeGPU runs ffmpeg in a GPU container using NVENC. |
| 25 | func TestFffmpegEncodeGPU(t *testing.T) { |
| 26 | ctx := context.Background() |
| 27 | container := dockerutil.MakeContainer(ctx, t) |
| 28 | defer container.CleanUp(ctx) |
| 29 | opts, err := dockerutil.GPURunOpts(dockerutil.SniffGPUOpts{Capabilities: "compute,video"}) |
| 30 | if err != nil { |
| 31 | t.Fatalf("Failed to get GPU run options: %v", err) |
| 32 | } |
| 33 | opts.Image = "benchmarks/ffmpeg" |
| 34 | cmd := strings.Split("ffmpeg -i video.mp4 -c:v h264_nvenc -preset fast output.mp4", " ") |
| 35 | if output, err := container.Run(ctx, opts, cmd...); err != nil { |
| 36 | t.Errorf("failed to run container: %v; output:\n%s", err, output) |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // TestFffmpegDecodeGPU runs ffmpeg in a GPU container using NVDEC. |
| 41 | func TestFffmpegDecodeGPU(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…