audio
audio copied to clipboard
Support for 10bit / 12bit encoding (e.g. yuv420p10le) in StreamWriter
🚀 The feature
The ability to provide 16 bit data (torch.int16) as input to StreamWriter with the understanding that the data will be truncated to 10/12 bit depending on the selected encoder_format would be very helpful.
Motivation, pitch
10 bit video encoding is becoming more mainstream and is supported in nvenc. 12 bit video encoding is also getting more traction. torchaudio already supports reading 10 bit video and storing it in 16 bit tensors: https://github.com/pytorch/audio/issues/3331 https://github.com/pytorch/audio/pull/3023 https://github.com/pytorch/audio/pull/3332 It would be great to have the converse support on the encoding side.
Alternatives
- Copying the torch tensor to CPU and using
imageio-ffmpeg - Looking into VideoProcessingFramework or others
Additional context
N/A