spaam / svtplay-dl

Small command-line program to download videos from some streaming sites.
https://svtplay-dl.se
MIT License
714 stars 117 forks source link

Lyxfällan won't start in Kodi, VLC or WMP #665

Open Sopor opened 7 years ago

Sopor commented 7 years ago

I was downloading Lyxfällan season premiere and when i try to play it in Kodi it will only freeze with no audio or video and it will continue show the file list. The only thing that happens is changing the color of the file name to orange (Kodi do that when you play a file). If i instead use Retrospect (Kodi addon) to play it, it will work. I can also play the downloaded file in Media Player Classic and Media Player Classic Homecinema but not in VLC or Windows Media Player so it seems that something is wrong with the file when i download it.

svtplay-dl -S -P hls https://www.viafree.se/program/livsstil/lyxfallan/sasong-23/avsnitt-1

svtplay-dl 1.9.4 tested in both Windows and Linux.

spaam commented 7 years ago

when i run ffmpeg -i lyxfallan.s23e01-868694-viafree.ts -c copy output.ts, output.ts works in VLC and QuickTime. the original file does not work. maybe i guess we should always run ffmpeg on the files?

selepo commented 7 years ago

Same thing with different url/file: https://www.viafree.se/program/reality/supernanny-sverige/sasong-1/avsnitt-2

Seems like the file written is missing some header information for the ts-file "PAT" and "PMT". I believe this is what causes the issue, but as spaam noted ffmpeg will add this information if missing...

spaam commented 7 years ago

maybe we should have a hard dependency or just recommend people install ffmpeg to get around the issue? if they have ffmpeg installed, always run the copy thing on the .ts files?

selepo commented 7 years ago

I would suggest that we run the file through ffmpeg if it is viafree and the stream is HLS (encrypted). We should probably also add an error message if ffmpeg is not available and ask the user to install it.

Sopor commented 7 years ago

So i then manually need to run ffmpeg on every HLS file i download?

selepo commented 7 years ago

My suggestion was to run it automatically but only on the files that needs it (soft dependancy). Which to my knowledge is only viafree...

qnorsten commented 7 years ago

You should also be able to use the --remux flag to make svtplay-dl run it through ffmpeg.

Sopor commented 7 years ago

But i don't have ffmpeg installed and i don't know if it will work if i install libav-tools? I'm running svtplay-dl on a Vero 4K and libav-tools will install a lot of X11 packages. I don't know if this will create any issues :(

spaam commented 7 years ago

@Sopor- try using apt-get install --no-install-recommends libav-tools . what dist are that thing running?

Sopor commented 7 years ago

@spaam

Distributor ID: Debian
Description:    Debian GNU/Linux 8.9 (jessie)
Release:        8.9
Codename:       jessie
Linux osmc 3.14.29-34-osmc #1 SMP Mon Aug 28 12:42:11 UTC 2017 aarch64 GNU/Linux
Linux 3.14.29-34-osmc aarch64

And it seems to install the same packages as without the --no-install-recommends

Sopor commented 7 years ago

I downloaded an old episode from 2015 (112 Aina) and it was also missing the PAT/PMT. So why is this information suddenly removed and why can i play it from Retrospect?

selepo commented 7 years ago

No way of knowing for sure, but my guess would be they changed due to licensing. The HLS is now enrypted (needs pycrypto) which I believe wasn't necessary before.

I think it's possible for a videoplayer to play content without all header information. Most players doesn't support it, but some do.

BTW: Is this issue #232 related ?

spaam commented 7 years ago

@selepo it might be. maybe its just better to run it on all .ts files if we have ffmpeg installed. i guess i should write a tips and work arounds on the page when this kind of things happen.

selepo commented 7 years ago

It's your call, the upside I guess is that it is a more robust and easier solution. The downside is, that the processing takes time.

Sopor commented 7 years ago

I tested to run VLC with --demux ffmpeg and it worked.

Sopor commented 7 years ago

I hope this "fix" you planning to do will work with UNC paths...

Sopor commented 7 years ago

@selepo

No way of knowing for sure, but my guess would be they changed due to licensing. The HLS is now enrypted (needs pycrypto) which I believe wasn't necessary before.

I have PyCrypto installed.

I think it's possible for a videoplayer to play content without all header information. Most players doesn't support it, but some do.

Retrospect is using the same player in Kodi as when i play it from the hard drive. Retrospect is only an addon.

selepo commented 7 years ago

@Sopor- : Was just trying to make the point that the stream has changed. If you didn't have pycrypto installed you wouldn't be able to download the file at all.

Regarding kodi and retrospect I can't explain that. (I do not have enough knowledge about kodi and retrospect.)
What I can tell you is that I can observe the same issue if I try the file on Kodi.

kjetilpp commented 7 years ago

Any updates here? ffmpeg -i veterinaerene.s01e02-870311-viafree.ts -c copy output.ts works, but..

qnorsten commented 7 years ago

Just use the --remux parameter when ripping

granbom commented 7 years ago

I just give my 2 cents here. I think .ts and .srt doesn't play well with each other, might be issues there if there is an .srt file with the same filename together with a .ts file. Might not be the issue in this case, regardless I usually always convert .ts and .srt to .mkv (as far as I know, mp4 can't handle subrip and .srt seems to be the default in all play and .mkv you can throw anything at and it will handle it. I have a brief explanation in Swedish of converting many files at the same time here: https://granbom.se/svtplay-dl/ Yes it's in Swedish, but it seems that most people here will understand Swedish =)

Sopor commented 6 years ago

Will svtplay-dl support avconv?

spaam commented 6 years ago

@Sopor- we already support that. it will look for both. if it cant find ffmpeg, it will look for avconv,

Sopor commented 6 years ago

That sounds great @spaam :)

I did run one of the files in avconv and this is what i get when i tried to use the -codec copy:

Non-monotonous DTS in output stream 0:1; previous: 233230080, current: 233230080; changing to 233230081. This may result in incorrect timestamps in the output file.

One for every block...

spaam commented 6 years ago

does the file work? no? yes? if it works not an issue. maybe just an old version of avconv.

Sopor commented 6 years ago

@spaam Yes, it seems to work.

avconv -version
avconv version v13_dev0-1047-g9e4a5eb, Copyright (c) 2000-2017 the Libav developers
  built on Apr 15 2017 12:31:44 with gcc 4.8.3 (Gentoo 4.8.3 p1.1, pie-0.5.9)
avconv v13_dev0-1047-g9e4a5eb
libavutil     56.  0. 0 / 56.  0. 0
libavcodec    58.  2. 0 / 58.  2. 0
libavformat   58.  0. 0 / 58.  0. 0
libavdevice   57.  0. 0 / 57.  0. 0
libavfilter    7.  0. 0 /  7.  0. 0
libavresample  4.  0. 0 /  4.  0. 0
libswscale     5.  0. 0 /  5.  0. 0
Sopor commented 6 years ago

When i run avprobe on the original TS file there seems to be something that is wrong. The NULL is in red so it must be some kind of error.

avprobe lyxfallan.s23e05-877685-viafree.ts
avprobe version v13_dev0-1047-g9e4a5eb, Copyright (c) 2007-2017 the Libav developers
  built on Apr 15 2017 12:31:44 with gcc 4.8.3 (Gentoo 4.8.3 p1.1, pie-0.5.9)
[NULL @ 0000000001c96fe0] non-existing SPS 0 referenced in buffering period
[mpegts @ 0000000001c969a0] max_analyze_duration 5000000 reached
Input #0, mpegts, from 'lyxfallan.s23e05-877685-viafree.ts':
  Duration: 00:43:11.56, start: 11.210778, bitrate: 2629 kb/s
    Stream #0:0[0x100]: Video: h264 (Main)
      yuv420p, 1280x720 [PAR 1:1 DAR 16:9]
      25 fps, 90k tbn
    Stream #0:1[0x101]: Audio: aac (LC)
      48000 Hz, stereo, fltp, 88 kb/s
# avprobe output