Fix the input pixel format when using GPU video encoder (#3426)
Summary: StreamWriter's encoding pipeline looks like the following 1. convert tensor to AVFrame 2. pass AVFrame to AVFilter 3. pass the resulting AVFrame to AVCodecContext (encoder) and AVFormatContext (muxer) When dealing with CUDA tensor, the AVFilter becomes no-op, as we have not added support for CUDA-compatible filters. When CUDA frame is passed, the existing solution passes the software pixel format to AVFilter, which issues warning later as what AVFilter sees is AV_PIX_FMT_CUDA. Since the filter itself is no-op, it functions as expected. But this commit fixes it. See https://github.com/pytorch/audio/issues/3317 Pull Request resolved: https://github.com/pytorch/audio/pull/3426 Differential Revision: D46562370 Pulled By: mthrok fbshipit-source-id: ce0131f1e50bcc826ee036fc0f35db2a5162b660
Showing
Please register or sign in to comment