Rudloff / alltube

Web GUI for youtube-dl
GNU General Public License v3.0
2.94k stars 584 forks source link

Downloads from pscp.tv don't seem to work properly #331

Open jdaviescoates opened 3 years ago

jdaviescoates commented 3 years ago

New issue

I just tried to download https://www.pscp.tv/w/1YqKDBZVqjvJV

I seemed to work (a 283.3MB file downloaded) but then it wouldn't actually play. When I open the downloaded file in VLC it thinks it's only 1:39 minutes long when actually it is 1hr 19 minues and 28 seconds long.

When I open it in the default Ubuntu 20.04 Videos player it thinks it is only 2 seconds long, but then plays for 1:39 just like on VLC.

Your environment

What is your operating system (Windows, Linux, OSX, etc.)?

Ubuntu 18.04

What is your web server (Apache, IIS, etc.)?

Whatever the Cloudron package uses

What version of AllTube are you using?

AllTube 3.0.0-beta4

How did you install AllTube (with Git or with a release package)?

Cloudron Package.

Please provide the URL of a video that causes the issue.

https://www.pscp.tv/w/1YqKDBZVqjvJV

Describe your issue

I just tried to download https://www.pscp.tv/w/1YqKDBZVqjvJV

I seemed to work (a 283.3MB file downloaded) but then it wouldn't actually play. When I open the downloaded file in VLC it thinks it's only 1:39 minutes long when actually it is 1hr 19 minues and 28 seconds long.

When I open it in the default Ubuntu 20.04 Videos player it thinks it is only 2 seconds long, but then plays for 1:39 just like on VLC.

jdaviescoates commented 3 years ago

Just to add, downloading the same video using https://pscp.download/ worked fine (and resulted in a bigger file size - so I guess perhaps for some reason alltube isn't downloading the whole thing and hence that's why it's not working)

Rudloff commented 3 years ago

I can reproduce the issue but I am not sure what happens.

If I run ffmpeg manyally like this:

'/usr/bin/ffmpeg' '-v' 'error' '-i' 'https://prod-fastly-us-west-1.video.periscope.tv/Transcoding/v1/hls/al_CKDtfIi5r8dB2_1hpBw3zGHAUaGg3t9K7-ELagqSmzefrNZddrXurfX2m-Onzia1gXaMCcJwqZTTi1EJ1Mg/non_transcode/us-west-1/periscope-replay-direct-prod-us-west-1-public/playlist_16880814745145724468.m3u8?type=replay' '-f' 'mp4' '-c' 'copy' '-bsf:a' 'aac_adtstoasc' '-movflags' 'frag_keyframe+empty_moov' foo.mp4

I also get a 270 MB file but VLC correctly detects it as ~1 hour long.

So I think AllTube downloads the full video but the duration metadata is wrong.

ffmpeg complains about timestamp warnings:

[mpegts @ 0x556145604d40] Invalid timestamps stream=1, pts=419656230, dts=419659920, size=525
[mpegts @ 0x556145604d40] Continuity check failed for pid 0 expected 1 got 0
[mpegts @ 0x556145604d40] Continuity check failed for pid 4095 expected 1 got 0
[hls,applehttp @ 0x55614521c940] Invalid timestamps stream=1, pts=419656230, dts=419659920, size=512
[mp4 @ 0x556145d76e40] Invalid DTS: 412547940 PTS: 412544250 in output stream 0:0, replacing by guess
[mpegts @ 0x556145604d40] invalid dts/pts combination 419663700
[mpegts @ 0x556145604d40] invalid dts/pts combination 419667390
[mpegts @ 0x556145604d40] Invalid timestamps stream=1, pts=419671260, dts=419674950, size=709
[hls,applehttp @ 0x55614521c940] Invalid timestamps stream=1, pts=419671260, dts=419674950, size=699
[mp4 @ 0x556145d76e40] Invalid DTS: 412562970 PTS: 412559280 in output stream 0:0, replacing by guess
[mpegts @ 0x556145604d40] Invalid timestamps stream=1, pts=419678730, dts=419682420, size=709
[hls,applehttp @ 0x55614521c940] Invalid timestamps stream=1, pts=419678730, dts=419682420, size=781
[mp4 @ 0x556145d76e40] Invalid DTS: 412570440 PTS: 412566750 in output stream 0:0, replacing by guess

But I don't know enough about ffmpeg to understand what it means.

Rudloff commented 3 years ago

I can reproduce the issue on the commandline by running this:

/usr/bin/ffmpeg' '-i' 'https://prod-fastly-us-west-1.video.periscope.tv/Transcoding/v1/hls/al_CKDtfIi5r8dB2_1hpBw3zGHAUaGg3t9K7-ELagqSmzefrNZddrXurfX2m-Onzia1gXaMCcJwqZTTi1EJ1Mg/non_transcode/us-west-1/periscope-replay-direct-prod-us-west-1-public/playlist_16880814745145724468.m3u8?type=replay' '-f' 'mp4' '-c' 'copy' '-bsf:a' 'aac_adtstoasc' '-movflags' 'frag_keyframe+empty_moov' pipe:1 > foo.mp4

It looks like ffmpeg is not able to set the duration when outputing to a pipe.

Mennaruuk commented 3 years ago

Unfortunately, as of today, AllTube gives me this error when attempting to download a Periscope video: image

Rudloff commented 3 years ago

Periscope only provides M3U videos so AllTube will only be able to download them if stream mode is enabled.