Benex254 / FastAnime

Your browser anime experience from the terminal
The Unlicense
174 stars 5 forks source link

[animepahe] corrupted Parametric Stereo (PS) flag in downloaded videos #8

Open Type-Delta opened 5 days ago

Type-Delta commented 5 days ago

The issue

Hi, I noticed that all videos downloaded from animepahe playback as Mono (audio).

I then inspect those videos with FFprobe an found this error.

[aac @ 000001ee84494940] Parametric Stereo signaled to be not-present but was found in the bitstream.

full FFprobe output:

[aac @ 0000020aab446200] Parametric Stereo signaled to be not-present but was found in the bitstream.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Hametsu no Oukoku - S01E01.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.17.102
  Duration: 00:24:27.27, start: 0.000000, bitrate: 1262 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1208 kb/s, 23.98 fps, 23.98 tbr, 90k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 48 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

When downloading I also found this warning reported by yt-dlp.

WARNING: Live HLS streams are not supported by the native downloader. If this is a livestream, please add "--downloader ffmpeg --hls

"full" yt-dlp log:

[generic] Extracting URL: https://vault-12.kwikie.ru/stream/12/10/acd214f9770f703ae93725531b6c4e16392b3454bcb64ef8bdd91c1160ba48e9/uwu.m3u8
[generic] uwu: Downloading webpage
[generic] uwu: Downloading m3u8 information
[generic] uwu: Checking m3u8 live status
[info] uwu: Downloading 1 format(s): 0
[hlsnative] Downloading m3u8 manifest
WARNING: Live HLS streams are not supported by the native downloader. If this is a livestream, please add "--downloader ffmpeg --hls-use-mpegts" to your command

What I've tried

I've tried re-encode the audio from aac (HE-AAC) to aac (LC) but was unable to recover the stereo data.

ffmpeg -i input.mp4 -c:v copy -c:a aac -q:a 1 -ac 2 -aac_is true output_fixed.mp4

Can't find much information about -aac_is option, but according to Chat-GPT it "tells ffmpeg to respect any implicit stereo information (if present) in the source".

Additional information

Benex254 commented 16 hours ago

Thats probably because animepahe has set up there server in a weird way. Though i think its not a problem cause you can still stream and download. And is it an issue if its mono audio. Cause i honestly did not notice a thing.

Type-Delta commented 16 hours ago

It's quite a big difference, at least for me.

plus, some media player would straight up refuse to play.

Benex254 commented 12 hours ago

Unfortunately this one can't be fixed on my side. Since those are the links animepahe provides.

Type-Delta commented 7 hours ago

I'll have a look and see if there's any workaround.

sorry for wasting your time.

Benex254 commented 7 hours ago

No you haven't, please don't feel that way. i just have no good idea on how to work around this myself. But i recommend in the meanwhile you ignore animepahe and use it only as a backup, allanime is stable enough. If you do find a solution i'll be waiting for a pr :smile: