MCPcopy Index your code
hub / github.com/google/gvisor / TestFffmpegDecodeGPU

Function TestFffmpegDecodeGPU

test/gpu/ffmpeg_test.go:41–56  ·  view source on GitHub ↗

TestFffmpegDecodeGPU runs ffmpeg in a GPU container using NVDEC.

(t *testing.T)

Source from the content-addressed store, hash-verified

39
40// TestFffmpegDecodeGPU runs ffmpeg in a GPU container using NVDEC.
41func 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}

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…