Hi folks,
First, off I appreciate all of the hard work you folks put into this software. Thank you for volunteering your time.
I've been troubleshooting a problem and I am stumped. I am hoping for some guidance, or at least a suggestion on where to look. Please let me know if there is information I am leaving out that will be helpful.
I am running ETV in Unraid (jasongdove/ersatztv:latest-vaapi, 0.8.6-beta-docker-vaapi). I am using it to stream media from a Plex library. When transcoding, I am using my i5-12600K integrated GPU.
For the first few minutes of the stream, everything works great, and the media plays as expected. Then, after a seemingly-random amount of time, usually around 5-15 minutes, the stream crashes. The media freezes and then, after 20-30 seconds, I get an error and the stream ends. I get different errors depending on what client I am using, but on the Plex web app, the error is "This live TV session has ended".
This is reproducible across platforms (Plex in Firefox for Linux, Plex for Google TV, Android Plex) and is independent of connection (wifi/wired). It happens across all different types of recordings, from 1080p to old SD videos. The problem is even reproducible if I delete my "appdata" folder, revert to the out-of-the-box settings, and set up a single channel playing a single known-good media file.
My most recent ffmpeg report is below. In this session, the channel is set to transmit in HLS Direct.
ffmpeg started on 2024-05-13 at 22:14:28
Report written to "/root/.local/share/ersatztv/ffmpeg-reports/ffmpeg-20240513-221428-transcode.log"
Log level: 32
Command line:
/usr/local/bin/ffmpeg -threads 1 -nostdin -hide_banner -nostats -loglevel error -fflags +genpts+discardcorrupt+igndts -hwaccel vaapi -vaapi_device /dev/dri/card0 -ss 00:00:01.1392253 -hwaccel_output_format vaapi -readrate 1.0 -readrate_initial_burst 45 -i http://localhost:8409/media/plex/2//library/parts/111593/1639302202/file.mkv -ss 00:00:01.1392253 -readrate 1.0 -readrate_initial_burst 45 -i http://localhost:8409/media/plex/2//library/parts/111593/1639302202/file.mkv -filter_complex "[1:0]loudnorm=I=-16:TP=-1.5:LRA=11,aresample=48000,aresample=async=1:first_pts=0,apad[a];[0:1]scale_vaapi=1920:1080:force_divisible_by=2,setsar=1[v];[v]scale_vaapi=format=nv12[vpf]" -map "[vpf]" -map "[a]" -muxdelay 0 -muxpreload 0 -movflags +faststart -flags cgop -bf 0 -sc_threshold 0 -t 00:21:32.5567747 -noautoscale -video_track_timescale 90000 -b:v 3000k -maxrate:v 3000k -bufsize:v 6000k -c:v h264_vaapi -sei -a53_cc -c:a aac -b:a 192k -maxrate:a 192k -bufsize:a 384k -ar 48k -map_metadata -1 -metadata "service_provider=\"ErsatzTV\"" -metadata "service_name=\"REDACTED\"" -metadata:s:a:0 "language=eng" -g 96 -keyint_min 96 -force_key_frames "expr:gte(t,n_forced*4)" -f hls -hls_time 4 -hls_list_size 0 -segment_list_flags +live -hls_segment_filename "/root/.local/share/etv-transcode/2.0/live%06d.ts" -hls_flags program_date_time+append_list+omit_endlist+independent_segments /root/.local/share/etv-transcode/2.0/live.m3u8
Input #0, matroska,webm, from 'http://localhost:8409/media/plex/2//library/parts/111593/1639302202/file.mkv':
Metadata:
title : [REDACTED]
encoder : libebml v1.0.0 + libmatroska v1.0.0
creation_time : 2010-06-10T07:13:00.000000Z
Duration: 00:21:33.70, start: 0.000000, bitrate: 4443 kb/s
Stream #0:0(eng): Audio: aac, 48000 Hz, stereo, fltp (default)
Stream #0:1(eng): Video: h264, yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Input #1, matroska,webm, from 'http://localhost:8409/media/plex/2//library/parts/111593/1639302202/file.mkv':
Metadata:
title : [REDACTED]
encoder : libebml v1.0.0 + libmatroska v1.0.0
creation_time : 2010-06-10T07:13:00.000000Z
Duration: 00:21:33.70, start: 0.000000, bitrate: 4443 kb/s
Stream #1:0(eng): Audio: aac, 48000 Hz, stereo, fltp (default)
Stream #1:1(eng): Video: h264, yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
Stream #1:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
[out#0/hls @ 0x5628894f7300] Codec AVOption sc_threshold (Scene change threshold) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
Stream #0:1 (h264) -> scale_vaapi:default
Stream #1:0 (aac) -> loudnorm:default
scale_vaapi:default -> Stream #0:0 (h264_vaapi)
apad:default -> Stream #0:1 (aac)
Output #0, hls, to '/root/.local/share/etv-transcode/2.0/live.m3u8':
Metadata:
service_provider: "ErsatzTV"
service_name : [REDACTED]
encoder : Lavf60.16.100
Stream #0:0: Video: h264, vaapi(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 3000 kb/s, 23.98 fps, 90k tbn
Metadata:
encoder : Lavc60.31.102 h264_vaapi
Stream #0:1(eng): Audio: aac, 48000 Hz, stereo, fltp, 192 kb/s
Metadata:
encoder : Lavc60.31.102 aac
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live000000.ts' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live.m3u8.tmp' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live000001.ts' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live.m3u8.tmp' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live000002.ts' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live.m3u8.tmp' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live000003.ts' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live.m3u8.tmp' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live000004.ts' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live.m3u8.tmp' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live000005.ts' for writing
[100 repeated lines removed here]
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live000106.ts' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live.m3u8.tmp' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live000107.ts' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live.m3u8.tmp' for writing
[http @ 0x5628894ff2c0] Stream ends prematurely at 250549857, should be 718551840
[matroska,webm @ 0x5628894fecc0] Read error
[http @ 0x5628894ff2c0] Stream ends prematurely at 250549857, should be 718551840
[http @ 0x5628894ff2c0] Stream ends prematurely at 250549857, should be 718551840
[in#1/matroska,webm @ 0x5628895966c0] Error during demuxing: Input/output error
[in#1/matroska,webm @ 0x5628895966c0] Error retrieving a packet from demuxer: Input/output error
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live000108.ts' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live.m3u8.tmp' for writing
[http @ 0x562889419700] Stream ends prematurely at 250877537, should be 718551840
[matroska,webm @ 0x5628894e7e80] Read error
[http @ 0x562889419700] Stream ends prematurely at 250877537, should be 718551840
[http @ 0x562889419700] Stream ends prematurely at 250877537, should be 718551840
[in#0/matroska,webm @ 0x5628894bc880] Error during demuxing: Input/output error
[in#0/matroska,webm @ 0x5628894bc880] Error retrieving a packet from demuxer: Input/output error
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live000109.ts' for writing
[hls @ 0x562889538d40] Opening '/root/.local/share/etv-transcode/2.0/live.m3u8.tmp' for writing
[out#0/hls @ 0x5628894f7300] video:160844kB audio:10663kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
frame=10531 fps= 27 q=-0.0 Lsize=N/A time=00:21:32.54 bitrate=N/A dup=2 drop=0 speed=3.26x
[aac @ 0x562889574e40] Qavg: 43523.129
The only messages in the ETV logs are:
2024-05-13 10:14:28 p.m. -03:00 Warning Unexpected pixel format null may have playback issues
2024-05-13 10:14:28 p.m. -03:00 Information Starting HLS session for channel 2.0
2024-05-13 10:14:28 p.m. -03:00 Information Starting ts stream for channel 2.0
The "Unexpected pixel format" error happens immediately on playing the channel, and the crash doesn't happen until several minutes later.
I'm stumped. Any ideas?