Support for 10bit / 12bit encoding (e.g. yuv420p10le) in StreamWriter
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 799
- Avg merge
- 58m
- Merged PRs (30d)
- 3
Description
🚀 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the StreamWriter entry point and trace how torch.int16 input and the encoder_format option are currently handled. Compare the requested yuv420p10le-style formats with the existing encoding path; done means 10-bit and 12-bit output can be selected without copying the tensor to CPU, with coverage in the relevant StreamWriter tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- audio-video-rtc
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100