mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-08-12 04:54:33 +00:00
Add batch processing support to the LibTorch DNN backend, following the same pattern used by the OpenVINO backend. Key changes: - Add batch_size AVOption (range 1-1000, default 1) to DnnContext - Accumulate lltasks in the queue, trigger inference when batch_size lltasks are ready (matching the OpenVINO batch execution pattern) - Pre-allocate a single contiguous memory buffer for the entire batch in fill_model_input_th() to avoid unnecessary tensor copies - Split batched output in infer_completion_callback() and dispatch each slice to its corresponding task Tested with: ffmpeg -f lavfi -i testsrc=duration=5:size=640x480:rate=25 -vf format=rgb24,dnn_processing=dnn_backend=torch:model=dummy_model.pt:batch_size=4 -f null - Signed-off-by: Raja Rathour <imraja729@gmail.com>