TeamNewPipe/NewPipe

[PeerTube] The downloader can't combine/mux two fragmented MP4 files

Open

#12 443 ouverte le 19 juil. 2025

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)Java (3 577 forks)batch import
PeerTubebugdownloaderhelp wanted

Métriques du dépôt

Stars
 (38 153 stars)
Métriques de merge PR
 (Merge moyen 9j 17h) (17 PRs mergées en 30 j)

Description

Checklist

  • I am able to reproduce the bug with the latest version given here: CLICK THIS LINK.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected version

0.28.0

Steps to reproduce the bug

See #11601. The downloader is unable to combine/mux two segmented MP4 files and will generate a file with only audio and with strange intermittent silences. ffmpeg can combine the two files without issues. These two PeerTube videos are examples: https://peertube.qontinuum.space/w/k2wKrFgGpoSSrGTCkkjoLC https://video.blast-info.fr/w/87GhAwHborpk5Kym1eqZ6m . To make the download dialog provide the option to download video+audio, change the following in SecondaryStreamHelper:

Turn this:

        } else if (mediaFormat == MediaFormat.MPEG_4) {
            return audioStreams
                    .stream()
                    .filter(audioStream -> audioStream.getFormat() == MediaFormat.M4A)
                    .max(ListHelper.getAudioFormatComparator(MediaFormat.M4A,
                            ListHelper.isLimitingDataUsage(context)))
                    .orElse(null);

into this:

        } else if (mediaFormat == MediaFormat.MPEG_4) {
            return audioStreams
                    .stream()
                    .filter(audioStream -> audioStream.getFormat() == MediaFormat.M4A
                            || audioStream.getFormat() == MediaFormat.MPEG_4)
                    .max(ListHelper.getAudioFormatComparator(MediaFormat.M4A,
                            ListHelper.isLimitingDataUsage(context)))
                    .orElse(null);

It would be good if someone who has some experience with the MP4 format (standard ISO/IEC 14496-12) could work on this.

Guide contributeur