MCPcopy
hub / github.com/google/gvisor / TestFffmpegEncodeGPU

Function TestFffmpegEncodeGPU

test/gpu/ffmpeg_test.go:25–38  ·  view source on GitHub ↗

TestFffmpegEncodeGPU runs ffmpeg in a GPU container using NVENC.

(t *testing.T)

Source from the content-addressed store, hash-verified

23
24// TestFffmpegEncodeGPU runs ffmpeg in a GPU container using NVENC.
25func 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.
41func TestFffmpegDecodeGPU(t *testing.T) {

Callers

nothing calls this directly

Calls 7

MakeContainerFunction · 0.92
GPURunOptsFunction · 0.92
CleanUpMethod · 0.65
FatalfMethod · 0.65
SplitMethod · 0.65
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…