Kethsar / ytarchive

Garbage Youtube livestream downloader
MIT License
1.01k stars 83 forks source link

Corrupt audio f140.ts file at all times. #170

Closed voidastro4 closed 5 months ago

voidastro4 commented 6 months ago

Lately the tool has been broken. It downloads everything successfully but always fails to merge. The reason for the failure is also obvious, corrupt audio file.

when opening the f140.ts file with mpv:

[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: error reading header
[lavf] avformat_open_input() failed
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: error reading header
[lavf] avformat_open_input() failed
Failed to recognize file format.
Exiting... (Errors when loading file)

The video file opens fine.

Archargelod commented 5 months ago

Seems related - https://github.com/yt-dlp/yt-dlp/issues/8641 Also, the latest ffmpeg from https://github.com/yt-dlp/FFmpeg-Builds/releases does merge files. No audio corruption.

Kethsar commented 5 months ago

Yeah this has been an ffmpeg issue. Though I do admit the way I grab the stream is also considered incorrect since each fragment is its own valid mp4 file, and not actually mpegts. I'll need to do something about that eventually, with the current tentative plan to feed everything into ffmpeg on the fly.

Still, take caution when updating ffmpeg as there have been a few versions that break merging, which I sadly ran into with 6.0.1 myself too.