pytorch / pytorch/audio

Support for 10bit / 12bit encoding (e.g. yuv420p10le) in StreamWriter

Open
#3,776 0 comments 0 reactions 0 assignees View on GitHub

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
Additional context

N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.