TeamNewPipe/NewPipe

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

Open

#12.443 aperta il 19 lug 2025

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Java (3577 fork)batch import
PeerTubebugdownloaderhelp wanted

Metriche repository

Star
 (38.153 star)
Metriche merge PR
 (Merge medio 9g 17h) (17 PR mergiate in 30 g)

Descrizione

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.

Guida contributor