TeamNewPipe/NewPipe · error · RuntimeException
not implemented
Error message
not implemented
What it means
OggFromWebMWriter switches on webmTrack.kind and only handles Audio and Video. Any other track kind (e.g. Subtitles) falls through to default and throws RuntimeException "not implemented". The writer cannot mux non-AV tracks into Ogg.
Source
Thrown at app/src/main/java/org/schabi/newpipe/streams/OggFromWebMWriter.java:185
/* step 1: get the amount of frames per seconds */
switch (webmTrack.kind) {
case Audio:
resolution = getSampleFrequencyFromTrack(webmTrack.bMetadata);
if (resolution == 0f) {
throw new RuntimeException("cannot get the audio sample rate");
}
break;
case Video:
// WARNING: untested
if (webmTrack.defaultDuration == 0) {
throw new RuntimeException("missing default frame time");
}
resolution = 1000f / ((float) webmTrack.defaultDuration
/ webmSegment.info.timecodeScale);
break;
default:
throw new RuntimeException("not implemented");
}
/* step 2: create packet with code init data */
if (webmTrack.codecPrivate != null) {
addPacketSegment(webmTrack.codecPrivate.length);
makePacketheader(0x00, header, webmTrack.codecPrivate);
write(header);
output.write(webmTrack.codecPrivate);
}
/* step 3: create packet with metadata */
final byte[] buffer = makeMetadata();
if (buffer != null) {
addPacketSegment(buffer.length);
makePacketheader(0x00, header, buffer);
write(header);
output.write(buffer);
}View on GitHub (pinned to 9e8be09156)
Solutions
- Select only an Audio (or Video) track before invoking the writer; filter getAvailableTracks() by kind.
- Skip subtitle/metadata tracks entirely — Ogg muxing of them is unsupported.
- Validate webmTrack.kind == Audio || webmTrack.kind == Video before constructing the writer.
Example fix
// before — picks whatever track is first (could be subtitles)
WebMTrack t = reader.getAvailableTracks()[0];
reader.selectTrack(t);
// after — pick an audio/video track explicitly
WebMTrack t = Arrays.stream(reader.getAvailableTracks())
.filter(x -> x.kind == WebMTrack.Kind.Audio || x.kind == WebMTrack.Kind.Video)
.findFirst().orElseThrow(() -> new IOException("no AV track"));
reader.selectTrack(t); Defensive patterns
Strategy: type-guard
Validate before calling
// Select only Audio/Video tracks before invoking the writer.
WebMTrack t = Arrays.stream(reader.getAvailableTracks())
.filter(x -> x.kind == WebMTrack.Kind.Audio || x.kind == WebMTrack.Kind.Video)
.findFirst()
.orElseThrow(() -> new IOException("no Audio/Video track available"));
reader.selectTrack(t); Type guard
public static boolean isConvertibleTrack(WebMTrack t) {
return t.kind == WebMTrack.Kind.Audio || t.kind == WebMTrack.Kind.Video;
} Try / catch
try {
writer.write();
} catch (RuntimeException e) {
if ("not implemented".equals(e.getMessage())) {
// selected a subtitle/metadata track — re-select an AV track
selectAvTrack();
} else throw e;
} Prevention
- Always filter getAvailableTracks() by kind==Audio||Video before selection.
- Never select a track by raw index without checking its kind.
- Document that subtitle/metadata tracks are unsupported by this writer.
- Add a unit test that asserts only AV tracks are selected.
When it happens
Trigger: Selecting/parsing a WebM track whose kind is neither Audio nor Video (e.g. a subtitle or metadata track) and passing it to OggFromWebMWriter. The switch has no case for those kinds.
Common situations: Selecting the wrong track index from getAvailableTracks(); a WebM that contains subtitle tracks the caller did not filter out; iterating all tracks without checking kind.
Related errors
- cannot get the audio sample rate
- missing default frame time
- page size cannot be larger than 65025
- Truncated stream, missing {} bytes
- Unsupported EBML data (WebM)
AI-assisted analysis of TeamNewPipe/NewPipe@9e8be09156 (2026-08-14).
Data as JSON: /api/errors/b16af10f1560b83d.
Report an issue: GitHub.