DEFENDORe / pseudotv

Create live TV channels from your own media. Access the streams using the simulated HDHomerun tuner or the generated M3U URl.
MIT License
232 stars 36 forks source link

Received end of stream when playing a continuous playlist #78

Open floppy-disk opened 4 years ago

floppy-disk commented 4 years ago

Hey all, I upgraded to the latest dev release, and ever since, I intermittently get this issue on all of my channels. I’ve tried to adjust various settings to no avail. I was using a custom ffmpeg that allowed Intel QuickSync transcoding on the master branch, and I’ve tried using the same in dev. I get the same error as below. While the stream cuts out, it recovers after about 10-15 seconds.

Any thoughts?

Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]: Stream starting. Channel: 4 (Star Trek: The Next Generation)
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]: ffmpeg version 4.3-2~18.04.york0 Copyright (c) 2000-2020 the FFmpeg developers
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   configuration: --prefix=/usr --extra-version='2~18.04.york0' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   libavutil      56. 51.100 / 56. 51.100
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   libavcodec     58. 91.100 / 58. 91.100
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   libavformat    58. 45.100 / 58. 45.100
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   libavdevice    58. 10.100 / 58. 10.100
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   libavfilter     7. 85.100 /  7. 85.100
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   libavresample   4.  0.  0 /  4.  0.  0
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   libswscale      5.  7.100 /  5.  7.100
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   libswresample   3.  7.100 /  3.  7.100
Jul 15 14:47:45 pseudo1 pseudotv-linux-x64[202]:   libpostproc    55.  7.100 / 55.  7.100
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]: Input #0, concat, from 'http://localhost:8000/playlist?channel=4':
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:   Duration: N/A, start: 0.000000, bitrate: N/A
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:     Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1440x1080, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:     Stream #0:1(eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, 5.1, fltp, 272 kb/s
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]: Output #0, mpegts, to 'pipe:1':
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:   Metadata:
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:     service_provider: "PseudoTV"
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:     service_name    : "Star Trek: The Next Generation
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:     encoder         : Lavf58.45.100
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:     Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1440x1080, q=2-31, 23.98 fps, 23.98 tbr, 90k tbn, 90k tbc
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:     Stream #0:1(eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, 5.1, fltp, 272 kb/s
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]: Stream mapping:
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:   Stream #0:0 -> #0:0 (copy)
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]:   Stream #0:1 -> #0:1 (copy)
Jul 15 14:47:46 pseudo1 pseudotv-linux-x64[202]: Press [q] to stop, [?] for help
Jul 15 14:51:56 pseudo1 pseudotv-linux-x64[202]: [48.0K blob data]
Jul 15 14:56:06 pseudo1 pseudotv-linux-x64[202]: [47.9K blob data]
Jul 15 15:00:18 pseudo1 pseudotv-linux-x64[202]: [48.0K blob data]
Jul 15 15:04:31 pseudo1 pseudotv-linux-x64[202]: [48.0K blob data]
Jul 15 15:08:03 pseudo1 pseudotv-linux-x64[202]: [40.3K blob data]
Jul 15 15:08:03 pseudo1 pseudotv-linux-x64[202]: http://localhost:8000/playlist?channel=4: Input/output error
Jul 15 15:08:03 pseudo1 pseudotv-linux-x64[202]: frame=29175 fps= 24 q=-1.0 Lsize= 1433925kB time=00:20:16.73 bitrate=9654.3kbits/s speed=   1x
Jul 15 15:08:03 pseudo1 pseudotv-linux-x64[202]: video:1353281kB audio:38233kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.047857%
Jul 15 15:08:03 pseudo1 pseudotv-linux-x64[202]: Recieved end of stream when playing a continuous playlist. This should never happen!
Jul 15 15:08:03 pseudo1 pseudotv-linux-x64[202]: This either means ffmpeg could not open any valid streams, or you've watched countless hours of television without changing channels. If it is the latter I salute you.
vexorian commented 4 years ago

In order to make all videos part of the same stream, pseudoTV uses ffmpeg to concatenate the files. But ffmpeg concat has a limitation that it's apparently impossible (or really difficult) to make it infinite, so instead pseudo provides the same address 100 times. This means that it's normal behavior for pseudotv to end after playing 100 videos in a sequence.

Now, if there are ffmpeg errors or problems with the videos that cause the ffmpeg playback to end too quickly, it may be exiting videos too early and playing again to replay them, which makes it run out of the 100 video attempts.

Normally when this happens, there's another ffmpeg error way above this one that's more specific to the problem.