Skip to content

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

@Stypox

Description

@Stypox

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:

Things to change to reproduce the problem

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PeerTubeService, https://joinpeertube.org/bugIssue is related to a bugdownloaderIssue is related to the downloaderhelp wantedHelp is wanted in fixing this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions