chrisbenincasa / tunarr

Spiritual successor to dizqueTV
https://tunarr.com/
zlib License
118 stars 11 forks source link

[Bug]: Issues playing 10-bit content with NVENC #639

Open Sunii opened 1 month ago

Sunii commented 1 month ago

Contact Details

No response

What happened?

Every show in series fails to play and does not show default generic error image. Series plays fine in plex app.

Sample of Media in question (Mediainfo output):

General Unique ID : 214128466142657500470278134608840404820 (0xA117A47A287BADA5127396AB82C4AF54) Complete name : M:\video\TV\That '70s Show\Season 1\That '70s Show - S01E17 - The Pill Bluray-1080p.mkv Format : Matroska Format version : Version 4 File size : 771 MiB Duration : 22 min 30 s Overall bit rate : 4 789 kb/s Frame rate : 23.976 FPS Encoded date : 2018-10-07 09:10:51 UTC Writing application : mkvmerge v20.0.0 ('I Am The Sun') 64-bit Writing library : libebml v1.3.5 + libmatroska v1.4.8 Cover : Yes Attachments : cover.jpg

Video ID : 1 Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main 10@L4@Main Codec ID : V_MPEGH/ISO/HEVC Duration : 22 min 30 s Bit rate : 4 260 kb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 23.976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 10 bits Bits/(Pixel*Frame) : 0.086 Stream size : 686 MiB (89%) Writing library : x265 2.8+74-fd517ae68f93:[Windows][MSVC 1915][64 bit] 10bit Encoding settings : cpuid=1111039 / frame-threads=5 / numa-pools=32,0 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x1080 / interlace=0 / total-frames=32368 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=5 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / bframes=8 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=120 / lookahead-slices=0 / scenecut=40 / radl=0 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=2 / tu-intra-depth=2 / limit-tu=0 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / no-strong-intra-smoothing / max-merge=3 / limit-refs=3 / limit-modes / me=3 / subme=7 / merange=57 / temporal-mvp / weightp / weightb / no-analyze-src-pics / deblock=-3:-3 / no-sao / no-sao-non-deblock / rd=6 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=1.50 / psy-rdoq=1.50 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=20.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=3 / aq-strength=0.85 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-mv-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei Language : English Default : Yes Forced : No

Audio ID : 2 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : A_AAC-2 Duration : 22 min 30 s Bit rate : 529 kb/s Channel(s) : 6 channels Channel layout : C L R Ls Rs LFE Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Delay relative to video : 20 ms Stream size : 83.9 MiB (11%) Language : English Default : Yes Forced : No

Text ID : 3 Format : PGS Muxing mode : zlib Codec ID : S_HDMV/PGS Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs Duration : 22 min 20 s Bit rate : 24.4 kb/s Frame rate : 0.603 FPS Count of elements : 808 Stream size : 3.90 MiB (1%) Language : English Default : No Forced : No

Menu 00:00:00.000 : en:Chapter 1 00:02:33.570 : en:Chapter 2 00:11:22.640 : en:Chapter 3

Version

ghcr.io/chrisbenincasa/tunarr:edge-nvidia Latest

What browser did you experience the the problem on?

Tivimate on Android TV

What operating system are you using?

Unraid

Relevant log output

2024-07-28T14:45:29.780Z [info]: 
Stream starting. Channel: 12 (That 70's Show)
2024-07-28T14:45:29.781Z [debug]: Starting ffmpeg concat process with args: -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=12&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v hevc_nvenc -c:a aac -b:v 12000k -maxrate:v 12000k -bufsize:v 4000k -b:a 192k -maxrate:a 192k -bufsize:a 100k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 4000 -muxpreload 4000 -metadata service_provider="tunarr" -metadata service_name="That 70's Show" -f mpegts -mpegts_flags +initial_discontinuity pipe:1 {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"}
2024-07-28T14:45:29.793Z [debug] <>: Added channel connection for 23d65e54-bffd-4bac-b293-a39bd272a6f6 with token d35a98a3-e5a4-4d96-9e53-d63a0600520f. {"ipAddress":"192.168.1.150"}
2024-07-28T14:45:29.818Z [debug]: Starting stream timestamp: 2024-07-28T08:45:29-06:00
2024-07-28T14:45:29.840Z [info]: ! Start playback
2024-07-28T14:45:29.840Z [info]: ! Channel: That 70's Show (12)
2024-07-28T14:45:29.840Z [info]: ! Title: The Pill
2024-07-28T14:45:29.840Z [info]: ! From: 182645 to: 1350377
2024-07-28T14:45:29.840Z [info]: ! Type: program
2024-07-28T14:45:29.846Z [debug]: Client closed video stream, stopping it now.
2024-07-28T14:45:29.847Z [debug]: Stream FFMPEG RECEIVED kill() command {"channel":"221b8b4a-6701-4eb7-9830-59f490c842ac"}
2024-07-28T14:45:29.847Z [debug]: Concat stream was closed!
2024-07-28T14:45:29.856Z [debug]: About to play plex stream
2024-07-28T14:45:29.884Z [debug]:  {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"}
2024-07-28T14:45:29.885Z [debug]: Starting ffmpeg with args: "-hide_banner -threads 4 -fflags +genpts+discardcorrupt+igndts -loglevel error -re -ss 182.645 -i http://192.168.1.200:32400/library/parts/310682/1641636785/file.mkv?X-Plex-Token=REDACTED -filter_complex [0:1]anull[audio];[audio]aresample=48000,aresample=async=1:first_pts=0,apad=whole_dur=1167732ms[padded] -map 0:v -c:v rawvideo -sc_threshold 0 -video_track_timescale 90000 -map [padded] -flags cgop+ilme -c:a pcm_s16le -map_metadata -1 -movflags +faststart -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="That 70's Show" -f nut pipe:1" {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"}
2024-07-28T14:45:29.974Z [debug]: Stream FFMPEG exited due to signal: SIGKILL as expected. {"channel":"221b8b4a-6701-4eb7-9830-59f490c842ac"}
2024-07-28T14:45:30.006Z [info]: Concat FFMPEG exited due to signal: SIGKILL as expected. {"channel":"221b8b4a-6701-4eb7-9830-59f490c842ac"}
2024-07-28T14:46:00.006Z [debug]: Running task OnDemandChannelStateTask
2024-07-28T14:46:00.016Z [debug]: Task OnDemandChannelStateTask ran in 9.23 ms
2024-07-28T14:46:19.071Z [debug]: Concat request closed.
2024-07-28T14:46:19.072Z [debug] <>: Removed connection from channel 23d65e54-bffd-4bac-b293-a39bd272a6f6 for token d35a98a3-e5a4-4d96-9e53-d63a0600520f. 0 remaining connections
2024-07-28T14:46:19.072Z [debug]: Detected client initiated concat close, stopping stream...
2024-07-28T14:46:19.073Z [debug]: Concat FFMPEG RECEIVED kill() command {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"}
2024-07-28T14:46:19.073Z [debug]: Running task OnDemandChannelStateTask
2024-07-28T14:46:19.082Z [debug] <>: Scheduling session shutdown
2024-07-28T14:46:19.083Z [debug]: Task OnDemandChannelStateTask ran in 9.16 ms
2024-07-28T14:46:19.084Z [debug] <>: Shutting down session
2024-07-28T14:46:19.085Z [debug]: Cleaning up on-demand channel: 23d65e54-bffd-4bac-b293-a39bd272a6f6
2024-07-28T14:46:19.086Z [info]: Concat FFMPEG exited due to signal: SIGKILL as expected. {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"}
2024-07-28T14:46:19.086Z [debug]: Client closed video stream, stopping it now.
2024-07-28T14:46:19.086Z [debug]: Stream FFMPEG RECEIVED kill() command {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"}
2024-07-28T14:46:19.087Z [debug]: Concat stream was closed!
2024-07-28T14:46:19.782Z [debug]: Stream FFMPEG exited due to signal: SIGKILL as expected. {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"}
chrisbenincasa commented 1 month ago

Hey thanks for the report! Can you turn on "log ffmpeg to console" in the ffmpeg settings page and post the log output from trying to play? I suspect there is a misconduct there.

Sunii commented 1 month ago

"log ffmpeg to console" is checked and I restarted the docker. This is the log output:

2024-07-28T15:23:01.483Z [info]: Stream starting. Channel: 12 (That 70's Show) 2024-07-28T15:23:01.483Z [debug]: Starting ffmpeg concat process with args: -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=12&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v hevc_nvenc -c:a aac -b:v 12000k -maxrate:v 12000k -bufsize:v 4000k -b:a 192k -maxrate:a 192k -bufsize:a 100k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 4000 -muxpreload 4000 -metadata service_provider="tunarr" -metadata service_name="That 70's Show" -f mpegts -mpegts_flags +initial_discontinuity pipe:1 {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"} 2024-07-28T15:23:01.518Z [debug]: Starting stream timestamp: 2024-07-28T09:23:01-06:00 2024-07-28T15:23:01.525Z [info]: ! Start playback 2024-07-28T15:23:01.526Z [info]: ! Channel: That 70's Show (12) 2024-07-28T15:23:01.526Z [info]: ! Title: Career Day 2024-07-28T15:23:01.526Z [info]: ! From: 1083967 to: 1349737 2024-07-28T15:23:01.526Z [info]: ! Type: program 2024-07-28T15:23:01.546Z [debug]: About to play plex stream 2024-07-28T15:23:01.562Z [debug]: {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"} 2024-07-28T15:23:01.562Z [debug]: Starting ffmpeg with args: "-hide_banner -threads 4 -fflags +genpts+discardcorrupt+igndts -loglevel error -re -ss 1083.967 -i http://192.168.1.200:32400/library/parts/310683/1641636801/file.mkv?X-Plex-Token=REDACTED -filter_complex [0:1]anull[audio];[audio]aresample=48000,aresample=async=1:first_pts=0,apad=whole_dur=265770ms[padded] -map 0:v -c:v rawvideo -sc_threshold 0 -video_track_timescale 90000 -map [padded] -flags cgop+ilme -c:a pcm_s16le -map_metadata -1 -movflags +faststart -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="That 70's Show" -f nut pipe:1" {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"} 2024-07-28T15:23:28.233Z [debug]: Concat request closed. 2024-07-28T15:23:28.234Z [debug]: Detected client initiated concat close, stopping stream... 2024-07-28T15:23:28.234Z [debug]: Concat FFMPEG RECEIVED kill() command {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"} 2024-07-28T15:23:28.235Z [debug]: Running task OnDemandChannelStateTask 2024-07-28T15:23:28.246Z [debug] <>: Scheduling session shutdown 2024-07-28T15:23:28.247Z [debug]: Task OnDemandChannelStateTask ran in 10.85 ms 2024-07-28T15:23:28.248Z [debug] <>: Shutting down session 2024-07-28T15:23:28.249Z [debug]: Cleaning up on-demand channel: 23d65e54-bffd-4bac-b293-a39bd272a6f6 2024-07-28T15:23:28.250Z [info]: Concat FFMPEG exited due to signal: SIGKILL as expected. {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"} 2024-07-28T15:23:28.250Z [debug]: Client closed video stream, stopping it now. 2024-07-28T15:23:28.251Z [debug]: Stream FFMPEG RECEIVED kill() command {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"} 2024-07-28T15:23:28.252Z [debug]: Concat stream was closed! 2024-07-28T15:23:28.647Z [debug]: Stream FFMPEG exited due to signal: SIGKILL as expected. {"channel":"23d65e54-bffd-4bac-b293-a39bd272a6f6"}

Sunii commented 1 month ago

Double checked "log ffmpeg to console" was checked and saved, restarted the docker. No additional log output is generated.

chrisbenincasa commented 1 month ago

This is strange because it looks like the client is just immediately killing the connection. We saw something like this once with the Plex for Windows desktop (I'm trying to find the issue) but not this client. Unfortunately I don't have any android tv devices so I won't have a way to directly reproduce, but I will try to look for a way to emulate this soon!

Sunii commented 1 month ago

Looks like it also does not play using the hdhomerun in plex live tv in firefox with error: "Playback Error Could not tune channel. Please check your tuner or antenna."

Jul 30, 2024 06:51:15.243 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Unable to find title for item of type 5 Jul 30, 2024 06:51:15.243 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Unable to find title for item of type 5 Jul 30, 2024 06:51:15.243 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Unable to find title for item of type 5 Jul 30, 2024 06:51:15.243 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Unable to find title for item of type 5 Jul 30, 2024 06:51:15.243 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Unable to find title for item of type 5 Jul 30, 2024 06:51:15.243 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Unable to find title for item of type 5 Jul 30, 2024 06:51:40.245 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Failed to start session. Jul 30, 2024 06:51:40.245 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Failed to start session. Jul 30, 2024 06:51:40.245 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Failed to start session. Jul 30, 2024 06:51:40.246 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Recorder: Unable to create transcode session or session failed to start. Jul 30, 2024 06:51:40.246 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Recorder: Error 16 (Recording failed. Please check your tuner or antenna.) starting the record, shutting things down. Jul 30, 2024 06:51:40.246 [22614418524984] Error — [Req#88a1da] Subscription: Rolling media grab failed to start. Jul 30, 2024 06:51:40.249 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Starting media grab failed. Jul 30, 2024 06:51:40.249 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Unknown metadata type: Jul 30, 2024 06:51:40.246 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Recorder: Unable to create transcode session or session failed to start. Jul 30, 2024 06:51:40.246 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Recorder: Error 16 (Recording failed. Please check your tuner or antenna.) starting the record, shutting things down. Jul 30, 2024 06:51:40.246 [22614418524984] Error — [Req#88a1da] Subscription: Rolling media grab failed to start. Jul 30, 2024 06:51:40.249 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Starting media grab failed. Jul 30, 2024 06:51:40.249 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Unknown metadata type: Jul 30, 2024 06:51:40.246 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Recorder: Unable to create transcode session or session failed to start. Jul 30, 2024 06:51:40.246 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Recorder: Error 16 (Recording failed. Please check your tuner or antenna.) starting the record, shutting things down. Jul 30, 2024 06:51:40.246 [22614418524984] Error — [Req#88a1da] Subscription: Rolling media grab failed to start. Jul 30, 2024 06:51:40.249 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Starting media grab failed. Jul 30, 2024 06:51:40.249 [22614178143032] Error — [Req#88a1da/Grabber/12.tunarr-rwpdn4mgh4ibngk5h2crsf80] Unknown metadata type:

chrisbenincasa commented 1 month ago

Hmmm this is pretty strange. I am not able to reproduce in Plex DVR playing in the web player or Apple TV app, using the latest Docker image.

The last comment has logs from the client side - they seem like Plex logs? I'm curious if you can turn on debug logs on either that or your other IPTV client and see why it is failing on that side. The Tunarr logs are implying the clients are preemptively closing the session; Tunarr sees this as a "normal" close

Sunii commented 1 month ago

I suspect it's a problem with ffmpeg or tunarr not liking the media files because the plex and tivimate logs show nothing and all other channels/shows play fine. The previous plex log has all the debug info that it will show, here is the android adb logs regarding tivimate:

START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LEANBACK_LAUNCHER] flg=0x10000000 pkg=ar.tvplayer.tv cmp=ar.tvplayer.tv/.ui.MainActivity} from uid 10135 Start proc 30632:ar.tvplayer.tv/u0a39 for pre-top-activity {ar.tvplayer.tv/ar.tvplayer.tv.ui.MainActivity} START u0 {flg=0x4000000 cmp=ar.tvplayer.tv/.ui.MainActivity} from uid 10039 requestNetwork for uid/pid:10039/30632 NetworkRequest [ TRACK_DEFAULT id=881, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10039 AdministratorUids: [] RequestorUid: 10039 RequestorPackageName: ar.tvplayer.tv] ] 0|ar.tvplayer.tv|5|null|10039: granting content://settings/system/notification_sound 0|ar.tvplayer.tv|5|null|10039: granting content://settings/system/notification_sound releasing NetworkRequest [ TRACK_DEFAULT id=881, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10039 AdministratorUids: [] RequestorUid: 10039 RequestorPackageName: ar.tvplayer.tv] ] (release request) Time required to fsync /data/user/0/ar.tvplayer.tv/shared_prefs/com.google.android.gms.session.keys.xml: [<1: 0, <2: 0, <4: 2, <8: 0, <16: 2, <32: 0, <64: 0, <128: 0, <256: 0, <512: 0, <1024: 1, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0] [ 07-31 11:36:27.732 30632:30644 I/ar.tvplayer.tv ] [ 07-31 11:37:24.947 30632:30644 I/ar.tvplayer.tv ] [ 07-31 11:37:27.705 30632:30644 I/ar.tvplayer.tv ] [ 07-31 11:37:51.025 30632:30644 I/ar.tvplayer.tv ] Apps for Intent { act=android.intent.action.MAIN cat=[android.intent.category.LEANBACK_LAUNCHER] }: [AppInfo(enabled=true, longVersionCode=1, packageName=com.android.tv.settings, versionCode=1, versionName=1.0), AppInfo(enabled=true, longVersionCode=40030, packageName=com.android.gallery3d, versionCode=40030, versionName=1.1.40030), AppInfo(enabled=true, longVersionCode=84201608, packageName=com.android.vending, versionCode=84201608, versionName=42.0.16-23 [8] [PR] 654097543), AppInfo(enabled=true, longVersionCode=25, packageName=com.codingbuffalo.aerialdream, versionCode=25, versionName=1.11.0), AppInfo(enabled=true, longVersionCode=126, packageName=com.cybercat.adbappcontrol.tv, versionCode=126, versionName=1.5.1), AppInfo(enabled=true, longVersionCode=76400, packageName=com.rcreations.WebCamViewerPaid, versionCode=76400, versionName=7.6.4), AppInfo(enabled=true, longVersionCode=10090, packageName=com.rumble.battles, versionCode=10090, versionName=2.0.16), AppInfo(enabled=true, longVersionCode=70, packageName=com.spocky.projengmenu, versionCode=70, versionName=4.54), AppInfo(enabled=true, longVersionCode=1464, packageName=com.teamsmart.videomanager.tv, versionCode=1464, versionName=22.74), AppInfo(enabled=true, longVersionCode=3016, packageName=com.ted.android.tv, versionCode=3016, versionName=3.0.2), AppInfo(enabled=true, longVersionCode=839, packageName=com.tubitv, versionCode=839, versionName=8.15.0), AppInfo(enabled=true, longVersionCode=165, packageName=com.unbrokensoftware.launchbox, versionCode=165, versionName=1.15), AppInfo(enabled=true, longVersionCode=510400202, packageName=tv.pluto.android, versionCode=510400202, versionName=5.44.0-leanback), AppInfo(enabled=true, longVersionCode=514203925, packageName=com.nvidia.tegrazone3, versionCode=514203925, versionName=6.14.34467335), AppInfo(enabled=true, longVersionCode=5040, packageName=ar.tvplayer.tv, versionCode=5040, versionName=5.0.4), AppInfo(enabled=true, longVersionCode=50005, packageName=ca.cbc.mobile.android.cbcnewsandroidwebvi ... START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LEANBACK_LAUNCHER] flg=0x10000000 pkg=ar.tvplayer.tv cmp=ar.tvplayer.tv/.ui.MainActivity} from uid 10135 START u0 {flg=0x4000000 cmp=ar.tvplayer.tv/.ui.MainActivity} from uid 10039 onActivityResumed AM packageName = ar.tvplayer.tv [5258] hrw.ez(66): ar.tvplayer.tv: Account determined from installer data - [REDACTED] requestAudioFocus() from uid/pid 10039/30632 clientId=android.media.AudioManager@5b1d6c3ˎˉ.ʽᵎ@3c59729 callingPack=ar.tvplayer.tv req=1 flags=0x0 sdk=33 [5258] jhs.f(969): Billing preferred account via installer for ar.tvplayer.tv: [REDACTED] GoogleInputMethodService.onStartInput():1899 onStartInput(EditorInfo{inputType=0x0(NULL) imeOptions=0x0 privateImeOptions=null actionName=UNSPECIFIED actionLabel=null actionId=0 initialSelStart=-1 initialSelEnd=-1 initialCapsMode=0x0 hintText=null label=null packageName=ar.tvplayer.tv fieldId=-1 fieldName=null extras=null hintLocales=[]}, false) requestNetwork for uid/pid:10039/30632 NetworkRequest [ TRACK_DEFAULT id=889, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10039 AdministratorUids: [] RequestorUid: 10039 RequestorPackageName: ar.tvplayer.tv] ] got request NetworkRequest [ TRACK_DEFAULT id=889, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10039 AdministratorUids: [] RequestorUid: 10039 RequestorPackageName: ar.tvplayer.tv] ] with score 70 and providerId 1 got request NetworkRequest [ TRACK_DEFAULT id=889, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10039 AdministratorUids: [] RequestorUid: 10039 RequestorPackageName: ar.tvplayer.tv] ] with score 70 and providerId 1 got request NetworkRequest [ TRACK_DEFAULT id=889, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10039 AdministratorUids: [] RequestorUid: 10039 RequestorPackageName: ar.tvplayer.tv] ] with score 70 and providerId 1 /data/misc/iorapd/ar.tvplayer.tv/5040/ar.tvplayer.tv.ui.MainActivity/compiled_traces/compiled_trace.pb doesn't exist Displayed ar.tvplayer.tv/.ui.MainActivity: +484ms 0|ar.tvplayer.tv|5|null|10039: granting content://settings/system/notification_sound 0|ar.tvplayer.tv|5|null|10039: granting content://settings/system/notification_sound [ 07-31 11:39:23.575 30632:30644 I/ar.tvplayer.tv ] [ 07-31 11:39:31.199 30632:30644 I/ar.tvplayer.tv ] [ 07-31 11:39:35.044 30632:30644 I/ar.tvplayer.tv ] [ 07-31 11:39:35.729 30632:30644 I/ar.tvplayer.tv ] Time required to fsync /data/user/0/ar.tvplayer.tv/shared_prefs/com.google.android.gms.session.keys.xml: [<1: 0, <2: 0, <4: 9, <8: 0, <16: 3, <32: 1, <64: 0, <128: 0, <256: 0, <512: 0, <1024: 2, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0] [ 07-31 11:40:37.893 30632:30644 I/ar.tvplayer.tv ] [ 07-31 11:40:43.964 30632:30644 I/ar.tvplayer.tv ] [ 07-31 11:40:44.340 30632:30644 I/ar.tvplayer.tv ] [ 07-31 11:40:46.688 30632:30644 I/ar.tvplayer.tv ] [ 07-31 11:41:08.666 30632:30644 I/ar.tvplayer.tv ]

Sunii commented 1 month ago

Wondering if this is an issue with escaping the path/filename since it contains an apostrophe?

chrisbenincasa commented 1 month ago

It's an interesting thought, I can try on my end, but also you mentioned it happens on every video (unless you've only tried videos with apostrophes in the paths?).

What is strange is that judging from the Tunarr logs, both streams (video and concat) seem to start up but then the concat stream is immediately closed by the client. Tunarr and DTV have lots of error logging on the ffmpeg path, so if something was going wrong there, you'd very likely see it in the logs.

Sunii commented 1 month ago

It's an interesting thought, I can try on my end, but also you mentioned it happens on every video (unless you've only tried videos with apostrophes in the paths?).

The bug is only with this channel which only plays files from the same series. Each Folder and File name have an apostrophe in them. Every other channel I have created plays fine.

What is strange is that judging from the Tunarr logs, both streams (video and concat) seem to start up but then the concat stream is immediately closed by the client. Tunarr and DTV have lots of error logging on the ffmpeg path, so if something was going wrong there, you'd very likely see it in the logs.

I doubt it's the clients since it's happening in plex, jellyfin, and tivimate with only this channel.

chrisbenincasa commented 1 month ago

Ah ok, so there is other playable content for you. That's good to know. I wasn't blaming the clients, just stating what I'm seeing from the Tunarr logs.

I tried a show with an apostrophe in the title and it streamed with no issue for me (Plex web client). I will take a closer look at the media metadata you posted since I think that's our biggest clue at the moment.

blarrbot commented 1 month ago

hey @chrisbenincasa ! i've ran into the same issue. seems to be related to specific episodes. i'm guessing a codec issue because changing from h264 CUDA to h265 CUDA resolved for some, but not all episodes.

i am running both plex and tunnar on docker using the same manually created network bridge, hosted on a debian bookworm VM. hardware is an nvidia 1630.

i have been unsuccessful in getting the windows desktop plex client to play any channel, on both a 6 month old and latest version of the plex desktop client. all of the below testing is done via Chrome because that has my highest success rate.

here's the media info of a file that refused to play on h264 CUDA or H265 CUDA

General
Unique ID                   : 81358016418793543146873760288141919646 (0x3D34FBE7AA74ED0CA3BBB3BD7EF2C59E)
Complete name               : A:\path\American Dad!\Season 06\American Dad! - S06E12 - May the Best Stan Win (Uncensored).mkv
Format                      : Matroska
Format version              : Version 4
File size                   : 295 MiB
Duration                    : 21 min 54 s
Overall bit rate            : 1 883 kb/s
Frame rate                  : 23.976 FPS
Movie name                  : American Dad! - S06E12 - May the Best Stan Win (Uncensored)
Encoded date                : 2023-12-23 09:34:39 UTC
Writing application         : mkvmerge v81.0 ('Milliontown') 64-bit
Writing library             : libebml v1.4.4 + libmatroska v1.7.1
Cover                       : Yes
Attachments                 : cover.jpg

Video
ID                          : 1
Format                      : HEVC
Format/Info                 : High Efficiency Video Coding
Format profile              : Main 10@L5@Main
Codec ID                    : V_MPEGH/ISO/HEVC
Duration                    : 21 min 54 s
Bit rate                    : 1 239 kb/s
Width                       : 1 920 pixels
Height                      : 1 080 pixels
Display aspect ratio        : 16:9
Frame rate mode             : Constant
Frame rate                  : 23.976 (24000/1001) FPS
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 10 bits
Bits/(Pixel*Frame)          : 0.025
Stream size                 : 194 MiB (66%)
Default                     : Yes
Forced                      : No

Audio
ID                          : 2
Format                      : E-AC-3
Format/Info                 : Enhanced AC-3
Commercial name             : Dolby Digital Plus
Codec ID                    : A_EAC3
Duration                    : 21 min 54 s
Bit rate mode               : Constant
Bit rate                    : 640 kb/s
Channel(s)                  : 6 channels
Channel layout              : L R C LFE Ls Rs
Sampling rate               : 48.0 kHz
Frame rate                  : 31.250 FPS (1536 SPF)
Compression mode            : Lossy
Stream size                 : 100 MiB (34%)
Title                       : 5.1Ch Dolby Digital Plus
Language                    : English
Service kind                : Complete Main
Default                     : Yes
Forced                      : No
Dialog Normalization        : -31 dB
dialnorm_Average            : -31 dB
dialnorm_Minimum            : -31 dB
dialnorm_Maximum            : -31 dB

Text
ID                          : 3
Format                      : UTF-8
Codec ID                    : S_TEXT/UTF8
Codec ID/Info               : UTF-8 Plain Text
Duration                    : 21 min 47 s
Bit rate                    : 83 b/s
Frame rate                  : 0.291 FPS
Count of elements           : 381
Stream size                 : 13.4 KiB (0%)
Title                       : English
Language                    : English
Default                     : No
Forced                      : No

Menu
00:00:00.000                : Chapter 1
00:00:32.032                : Chapter 2
00:07:47.468                : Chapter 3
00:10:36.845                : Chapter 4
00:14:58.107                : Chapter 5
00:21:15.021                : Chapter 6

`

here is the related episode failing to play on h264 CUDA or H265 CUDA. sits for about 15 seconds before spitting "could not tune channel" error in plex web

2024-08-05T16:38:24.519Z [info]: 
Stream starting. Channel: 3 (Old Adult Cartoons)
2024-08-05T16:38:24.520Z [debug]: Starting ffmpeg concat process with args: -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=3&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v h264_nvenc -c:a aac -b:v 2000k -maxrate:v 2000k -bufsize:v 2000k -b:a 192k -maxrate:a 192k -bufsize:a 50k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Old Adult Cartoons" -f mpegts -mpegts_flags +initial_discontinuity pipe:1 {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T16:38:24.524Z [debug] <>: Added channel connection for 131132ff-c3dd-4840-8eec-c28333ac7bcb with token f9fcc87b-e79f-4f0e-ba68-892a756c8858. {"ipAddress":"172.18.0.1"}
2024-08-05T16:38:24.535Z [debug]: Starting stream timestamp: 2024-08-05T12:38:24-04:00
2024-08-05T16:38:24.542Z [info]: ! Start playback
2024-08-05T16:38:24.542Z [info]: ! Channel: Old Adult Cartoons (3)
2024-08-05T16:38:24.542Z [info]: ! Title: May the Best Stan Win
2024-08-05T16:38:24.543Z [info]: ! From: 547293 to: 1314062
2024-08-05T16:38:24.543Z [info]: ! Type: program
2024-08-05T16:38:24.544Z [debug]: About to play plex stream
2024-08-05T16:38:24.551Z [debug]:  {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T16:38:24.551Z [debug]: Starting ffmpeg with args: "-hide_banner -threads 6 -fflags +genpts+discardcorrupt+igndts -loglevel error -re -ss 547.293 -i http://IP:32400/library/parts/39299/1720321500/file.mkv?X-Plex-Token=REDACTED -filter_complex [0:1]anull[audio];[audio]aresample=48000,aresample=async=1:first_pts=0,apad=whole_dur=766769ms[padded] -map 0:v -c:v rawvideo -sc_threshold 0 -video_track_timescale 90000 -map [padded] -flags cgop+ilme -c:a pcm_s16le -map_metadata -1 -movflags +faststart -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Old Adult Cartoons" -f nut pipe:1" {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T16:38:49.515Z [debug]: Concat request closed.
2024-08-05T16:38:49.516Z [debug] <>: Removed connection from channel 131132ff-c3dd-4840-8eec-c28333ac7bcb for token f9fcc87b-e79f-4f0e-ba68-892a756c8858. 0 remaining connections
2024-08-05T16:38:49.516Z [debug]: Detected client initiated concat close, stopping stream...
2024-08-05T16:38:49.516Z [debug]: Concat FFMPEG RECEIVED kill() command {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T16:38:49.516Z [debug]: Running task OnDemandChannelStateTask
2024-08-05T16:38:49.518Z [debug] <>: Scheduling session shutdown
2024-08-05T16:38:49.518Z [debug]: Task OnDemandChannelStateTask ran in 2.13 ms
2024-08-05T16:38:49.519Z [info]: Concat FFMPEG exited due to signal: SIGKILL as expected. {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T16:38:49.519Z [debug]: Client closed video stream, stopping it now.
2024-08-05T16:38:49.519Z [debug]: Stream FFMPEG RECEIVED kill() command {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T16:38:49.520Z [debug]: Concat stream was closed!
2024-08-05T16:38:49.520Z [debug] <>: Shutting down session
2024-08-05T16:38:49.520Z [debug]: Cleaning up on-demand channel: 131132ff-c3dd-4840-8eec-c28333ac7bcb
2024-08-05T16:38:49.687Z [debug]: Stream FFMPEG exited due to signal: SIGKILL as expected. {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T16:39:00.001Z [debug]: Running task OnDemandChannelStateTask

here is the media info of another episode that refuses to play on both H264 CUDA and H265 CUDA. 

`General
Unique ID                   : 26117062845256305947860815765969595499 (0x13A5F69D67B907EEFFE0B74B97386C6B)
Complete name               : A:\path\The Eric Andre Show (2012)\Season 04\The Eric Andre Show - S04E06 - Warren G; Kelly Osbourne.mkv
Format                      : Matroska
Format version              : Version 4
File size                   : 478 MiB
Duration                    : 10 min 47 s
Overall bit rate            : 6 195 kb/s
Frame rate                  : 29.970 FPS
Encoded date                : 2022-09-08 15:47:29 UTC
Writing application         : mkvmerge v70.0.0 ('Caught A Lite Sneeze') 64-bit
Writing library             : libebml v1.4.2 + libmatroska v1.6.4
Cover                       : Yes
Attachments                 : cover.jpg

Video
ID                          : 1
Format                      : HEVC
Format/Info                 : High Efficiency Video Coding
Format profile              : Main 10@L4@Main
Codec ID                    : V_MPEGH/ISO/HEVC
Duration                    : 10 min 47 s
Bit rate                    : 5 547 kb/s
Width                       : 1 920 pixels
Height                      : 1 080 pixels
Display aspect ratio        : 16:9
Frame rate mode             : Variable
Frame rate                  : 29.970 FPS
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 10 bits
Bits/(Pixel*Frame)          : 0.089
Stream size                 : 428 MiB (90%)
Default                     : Yes
Forced                      : No
Color range                 : Limited
Color primaries             : BT.709
Transfer characteristics    : BT.709
Matrix coefficients         : BT.709

Audio
ID                          : 2
Format                      : E-AC-3
Format/Info                 : Enhanced AC-3
Commercial name             : Dolby Digital Plus
Codec ID                    : A_EAC3
Duration                    : 10 min 47 s
Bit rate mode               : Constant
Bit rate                    : 640 kb/s
Channel(s)                  : 6 channels
Channel layout              : L R C LFE Ls Rs
Sampling rate               : 48.0 kHz
Frame rate                  : 31.250 FPS (1536 SPF)
Compression mode            : Lossy
Stream size                 : 49.4 MiB (10%)
Title                       : 5.1Ch - Dolby Digital Plus
Language                    : English
Service kind                : Complete Main
Default                     : Yes
Forced                      : No
Dialog Normalization        : -31 dB
dialnorm_Average            : -31 dB
dialnorm_Minimum            : -31 dB
dialnorm_Maximum            : -31 dB

Text
ID                          : 3
Format                      : UTF-8
Codec ID                    : S_TEXT/UTF8
Codec ID/Info               : UTF-8 Plain Text
Duration                    : 10 min 36 s
Bit rate                    : 89 b/s
Frame rate                  : 0.399 FPS
Count of elements           : 254
Stream size                 : 6.92 KiB (0%)
Title                       : English
Language                    : English
Default                     : No
Forced                      : No

here is that episodes tunarr log

Stream starting. Channel: 8 (Sketch Comedy)
2024-08-05T16:58:17.409Z [debug]: Starting ffmpeg concat process with args: -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=8&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v h264_nvenc -c:a aac -b:v 2000k -maxrate:v 2000k -bufsize:v 2000k -b:a 192k -maxrate:a 192k -bufsize:a 50k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Sketch Comedy" -f mpegts -mpegts_flags +initial_discontinuity pipe:1 {"channel":"15f9d9e8-84ca-4973-9957-2f130fb3d4e2"}
2024-08-05T16:58:17.412Z [debug] <>: Added channel connection for 15f9d9e8-84ca-4973-9957-2f130fb3d4e2 with token 810b5ed4-4d92-45c4-9210-56a174d63573. {"ipAddress":"172.18.0.1"}
2024-08-05T16:58:17.423Z [debug]: Starting stream timestamp: 2024-08-05T12:58:17-04:00
2024-08-05T16:58:17.432Z [info]: ! Start playback
2024-08-05T16:58:17.432Z [info]: ! Channel: Sketch Comedy (8)
2024-08-05T16:58:17.432Z [info]: ! Title: Warren G; Kelly Osbourne
2024-08-05T16:58:17.432Z [info]: ! From: 522273 to: 647616
2024-08-05T16:58:17.433Z [info]: ! Type: program
2024-08-05T16:58:17.435Z [debug]: About to play plex stream
2024-08-05T16:58:17.442Z [debug]:  {"channel":"15f9d9e8-84ca-4973-9957-2f130fb3d4e2"}
2024-08-05T16:58:17.442Z [debug]: Starting ffmpeg with args: "-hide_banner -threads 6 -fflags +genpts+discardcorrupt+igndts -loglevel error -re -ss 522.273 -i http://IP:32400/library/parts/21877/1718313871/file.mkv?X-Plex-Token=REDACTED -filter_complex [0:1]anull[audio];[audio]aresample=48000,aresample=async=1:first_pts=0,apad=whole_dur=125343ms[padded] -map 0:v -c:v rawvideo -sc_threshold 0 -video_track_timescale 90000 -map [padded] -flags cgop+ilme -c:a pcm_s16le -map_metadata -1 -movflags +faststart -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Sketch Comedy" -f nut pipe:1" {"channel":"15f9d9e8-84ca-4973-9957-2f130fb3d4e2"}
2024-08-05T16:58:42.404Z [debug]: Concat request closed.
2024-08-05T16:58:42.404Z [debug] <>: Removed connection from channel 15f9d9e8-84ca-4973-9957-2f130fb3d4e2 for token 810b5ed4-4d92-45c4-9210-56a174d63573. 0 remaining connections
2024-08-05T16:58:42.404Z [debug]: Detected client initiated concat close, stopping stream...
2024-08-05T16:58:42.404Z [debug]: Concat FFMPEG RECEIVED kill() command {"channel":"15f9d9e8-84ca-4973-9957-2f130fb3d4e2"}
2024-08-05T16:58:42.405Z [debug]: Running task OnDemandChannelStateTask
2024-08-05T16:58:42.406Z [debug] <>: Scheduling session shutdown
2024-08-05T16:58:42.407Z [debug]: Task OnDemandChannelStateTask ran in 1.99 ms
2024-08-05T16:58:42.408Z [debug] <>: Shutting down session
2024-08-05T16:58:42.408Z [debug]: Cleaning up on-demand channel: 15f9d9e8-84ca-4973-9957-2f130fb3d4e2
2024-08-05T16:58:42.409Z [info]: Concat FFMPEG exited due to signal: SIGKILL as expected. {"channel":"15f9d9e8-84ca-4973-9957-2f130fb3d4e2"}
2024-08-05T16:58:42.409Z [debug]: Client closed video stream, stopping it now.
2024-08-05T16:58:42.409Z [debug]: Stream FFMPEG RECEIVED kill() command {"channel":"15f9d9e8-84ca-4973-9957-2f130fb3d4e2"}
2024-08-05T16:58:42.410Z [debug]: Concat stream was closed!
2024-08-05T16:58:42.616Z [debug]: Stream FFMPEG exited due to signal: SIGKILL as expected. {"channel":"15f9d9e8-84ca-4973-9957-2f130fb3d4e2"}

here is an episode on the same channel as example 1 that plays just fine with the same settings

General
Unique ID                   : 92252515817148441826679381217899620593 (0x456730322ED2B8F79F9CA0BD1642A8F1)
Complete name               : A:\path\Beavis.and.Butt-Head.S05\Beavis.and.Butt-Head.S05E12.Plastic.Surgin.480i.SDTV.DD.2.0.MPEG-2-KingTurd.mkv
Format                      : Matroska
Format version              : Version 4
File size                   : 279 MiB
Duration                    : 10 min 54 s
Overall bit rate mode       : Variable
Overall bit rate            : 3 576 kb/s
Frame rate                  : 29.970 FPS
Movie name                  : Beavis and Butt-Head - S05E12 - Plastic Surgin'
Track name/Position         : 12
Track name/Total            : 50
Writing application         : mkvmerge v85.0 ('Shame For You') 64-bit
Writing library             : libebml v1.4.5 + libmatroska v1.7.1
IMDB                        : tt0105950
TMDB                        : tv/13943
TVDB2                       : series/75863

Video
ID                          : 1
ID in the original source m : 224 (0xE0)
Format                      : MPEG Video
Format version              : Version 2
Format profile              : Main@Main
Format settings             : BVOP
Format settings, BVOP       : Yes
Format settings, Matrix     : Default
Format settings, GOP        : M=3, N=15
Format settings, picture st : Frame
Codec ID                    : V_MPEG2
Codec ID/Info               : MPEG 1 or 2 Video
Duration                    : 10 min 54 s
Bit rate mode               : Variable
Bit rate                    : 3 381 kb/s
Maximum bit rate            : 5 400 kb/s
Width                       : 720 pixels
Height                      : 480 pixels
Display aspect ratio        : 4:3
Frame rate mode             : Constant
Frame rate                  : 29.970 (30000/1001) FPS
Standard                    : NTSC
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Interlaced
Scan order                  : Top Field First
Compression mode            : Lossy
Bits/(Pixel*Frame)          : 0.326
Time code of first frame    : 00:00:00:00
Time code source            : Group of pictures header
GOP, Open/Closed            : Open
GOP, Open/Closed of first f : Closed
Stream size                 : 264 MiB (95%)
Title                       : MPEG-2 Video / 3381 kbps / 480i / 29.970 fps / 4:3
Language                    : English
Default                     : Yes
Forced                      : No
Original source medium      : DVD-Video

Audio
ID                          : 2
ID in the original source m : 189 (0xBD)128 (0x80)
Format                      : AC-3
Format/Info                 : Audio Coding 3
Commercial name             : Dolby Digital
Codec ID                    : A_AC3
Duration                    : 10 min 54 s
Bit rate mode               : Constant
Bit rate                    : 192 kb/s
Channel(s)                  : 2 channels
Channel layout              : L R
Sampling rate               : 48.0 kHz
Frame rate                  : 31.250 FPS (1536 SPF)
Compression mode            : Lossy
Stream size                 : 15.0 MiB (5%)
Title                       : Dolby Digital Audio / 2.0 / 48 kHz / 192 kbps
Language                    : English
Service kind                : Complete Main
Default                     : Yes
Forced                      : No
Original source medium      : DVD-Video
Dialog Normalization        : -27 dB
compr                       : -0.28 dB
dialnorm_Average            : -27 dB
dialnorm_Minimum            : -27 dB
dialnorm_Maximum            : -27 dB

and here is that episodes tunarr log

Stream starting. Channel: 3 (Old Adult Cartoons)
2024-08-05T17:09:35.399Z [debug]: Starting ffmpeg concat process with args: -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=3&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v h264_nvenc -c:a aac -b:v 2000k -maxrate:v 2000k -bufsize:v 2000k -b:a 192k -maxrate:a 192k -bufsize:a 50k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Old Adult Cartoons" -f mpegts -mpegts_flags +initial_discontinuity pipe:1 {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T17:09:35.403Z [debug] <>: Added channel connection for 131132ff-c3dd-4840-8eec-c28333ac7bcb with token dd4ed002-d657-467c-97ab-14b5bdf087ec. {"ipAddress":"172.18.0.1"}
2024-08-05T17:09:35.415Z [debug]: Starting stream timestamp: 2024-08-05T13:09:35-04:00
2024-08-05T17:09:35.423Z [info]: ! Start playback
2024-08-05T17:09:35.423Z [info]: ! Channel: Old Adult Cartoons (3)
2024-08-05T17:09:35.423Z [info]: ! Title: Plastic Surgin'
2024-08-05T17:09:35.423Z [info]: ! From: 441711 to: 654400
2024-08-05T17:09:35.423Z [info]: ! Type: program
2024-08-05T17:09:35.425Z [debug]: About to play plex stream
2024-08-05T17:09:35.431Z [info]: First stretch to 1620 x 1080. Then add padding to make it 1920 x 1080  {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T17:09:35.431Z [debug]: Stretch to 1620 x 1080. To fit target resolution of 1920 x 1080. {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T17:09:35.431Z [debug]: Starting ffmpeg with args: "-hide_banner -threads 6 -fflags +genpts+discardcorrupt+igndts -loglevel error -re -ss 441.711 -i http://IP:32400/library/parts/29074/1719161478/file.mkv?X-Plex-Token=REDACTED -filter_complex [0:v]null[video];[video]scale=1620:1080:flags=bicubic,format=yuv420p[scaled];[scaled]pad=1920:1080:(ow-iw)/2:(oh-ih)/2[blackpadded];[blackpadded]setsar=1,format=yuv420p[siz];[0:1]anull[audio];[audio]aresample=48000,aresample=async=1:first_pts=0,apad=whole_dur=212689ms[padded] -map [siz] -c:v rawvideo -sc_threshold 0 -video_track_timescale 90000 -map [padded] -flags cgop+ilme -c:a pcm_s16le -map_metadata -1 -movflags +faststart -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Old Adult Cartoons" -f nut pipe:1" {"channel":"131132ff-c3dd-4840-8eec-c28333ac7bcb"}
2024-08-05T17:09:35.481Z [debug]: Video stream started in 65.35660400055349 ms
frame=   10 fps=0.0 q=22.0 size=      88KiB time=00:00:00.23 bitrate=3097.3kbits/s speed=0.467x    
frame=   25 fps= 25 q=27.0 size=     261KiB time=00:00:00.73 bitrate=2911.4kbits/s speed=0.734x    
frame=   39 fps= 26 q=26.0 size=     420KiB time=00:00:01.20 bitrate=2863.5kbits/s speed=0.801x    
frame=   53 fps= 26 q=30.0 size=     572KiB time=00:00:01.66 bitrate=2808.2kbits/s speed=0.834x    
frame=   68 fps= 27 q=30.0 size=     715KiB time=00:00:02.16 bitrate=2701.7kbits/s speed=0.867x    
frame=   83 fps= 28 q=27.0 size=     855KiB time=00:00:02.66 bitrate=2622.8kbits/s speed=0.89x    
frame=   98 fps= 28 q=21.0 size=     933KiB time=00:00:03.16 bitrate=2410.8kbits/s speed=0.905x    
frame=  113 fps= 28 q=24.0 size=    1055KiB time=00:00:03.67 bitrate=2355.0kbits/s speed=0.917x    
frame=  128 fps= 28 q=27.0 size=    1201KiB time=00:00:04.17 bitrate=2359.0kbits/s speed=0.927x    
frame=  143 fps= 29 q=25.0 size=    1335KiB time=00:00:04.67 bitrate=2341.0kbits/s speed=0.934x    
frame=  158 fps= 29 q=18.0 size=    1451KiB time=00:00:05.17 bitrate=2298.8kbits/s speed=0.94x    
frame=  173 fps= 29 q=23.0 size=    1582KiB time=00:00:05.67 bitrate=2285.0kbits/s speed=0.945x    
frame=  187 fps= 29 q=25.0 size=    1719KiB time=00:00:06.13 bitrate=2293.9kbits/s speed=0.944x    
frame=  202 fps= 29 q=24.0 size=    1914KiB time=00:00:06.63 bitrate=2360.9kbits/s speed=0.948x    
frame=  217 fps= 29 q=29.0 size=    2073KiB time=00:00:07.14 bitrate=2378.7kbits/s speed=0.952x    
frame=  232 fps= 29 q=31.0 size=    2246KiB time=00:00:07.64 bitrate=2407.9kbits/s speed=0.955x    
frame=  247 fps= 29 q=31.0 size=    2392KiB time=00:00:08.14 bitrate=2407.3kbits/s speed=0.958x    
frame=  262 fps= 29 q=33.0 size=    2555KiB time=00:00:08.64 bitrate=2421.5kbits/s speed=0.96x    
frame=  277 fps= 29 q=28.0 size=    2658KiB time=00:00:09.14 bitrate=2381.9kbits/s speed=0.962x    
frame=  292 fps= 29 q=24.0 size=    2788KiB time=00:00:09.64 bitrate=2368.7kbits/s speed=0.964x    
frame=  307 fps= 29 q=29.0 size=    2907KiB time=00:00:10.14 bitrate=2347.5kbits/s speed=0.966x    
frame=  322 fps= 29 q=27.0 size=    3014KiB time=00:00:10.64 bitrate=2319.7kbits/s speed=0.967x    
frame=  337 fps= 29 q=24.0 size=    3150KiB time=00:00:11.14 bitrate=2315.2kbits/s speed=0.969x    
frame=  352 fps= 29 q=25.0 size=    3369KiB time=00:00:11.64 bitrate=2370.2kbits/s speed=0.97x    
frame=  367 fps= 29 q=31.0 size=    3544KiB time=00:00:12.14 bitrate=2390.6kbits/s speed=0.971x    
frame=  382 fps= 29 q=31.0 size=    3693KiB time=00:00:12.64 bitrate=2392.2kbits/s speed=0.973x    
frame=  397 fps= 29 q=31.0 size=    3836KiB time=00:00:13.14 bitrate=2390.3kbits/s speed=0.974x    
frame=  412 fps= 29 q=26.0 size=    3935KiB time=00:00:13.64 bitrate=2362.2kbits/s speed=0.975x    
frame=  427 fps= 29 q=31.0 size=    4073KiB time=00:00:14.14 bitrate=2358.4kbits/s speed=0.975x    
frame=  442 fps= 29 q=31.0 size=    4204KiB time=00:00:14.64 bitrate=2351.4kbits/s speed=0.976x    
frame=  457 fps= 29 q=27.0 size=    4361KiB time=00:00:15.14 bitrate=2358.2kbits/s speed=0.977x    
frame=  472 fps= 29 q=25.0 size=    4486KiB time=00:00:15.64 bitrate=2348.2kbits/s speed=0.978x    
frame=  487 fps= 30 q=29.0 size=    4617KiB time=00:00:16.14 bitrate=2341.8kbits/s speed=0.979x    
frame=  502 fps= 30 q=22.0 size=    4767KiB time=00:00:16.64 bitrate=2345.6kbits/s speed=0.979x    
frame=  517 fps= 30 q=27.0 size=    4939KiB time=00:00:17.15 bitrate=2359.2kbits/s speed=0.98x    
frame=  532 fps= 30 q=31.0 size=    5097KiB time=00:00:17.65 bitrate=2365.4kbits/s speed=0.98x    
frame=  547 fps= 30 q=26.0 size=    5203KiB time=00:00:18.15 bitrate=2348.3kbits/s speed=0.981x    
frame=  562 fps= 30 q=23.0 size=    5346KiB time=00:00:18.65 bitrate=2347.9kbits/s speed=0.981x    
frame=  577 fps= 30 q=28.0 size=    5456KiB time=00:00:19.15 bitrate=2333.8kbits/s speed=0.982x    
frame=  592 fps= 30 q=25.0 size=    5563KiB time=00:00:19.65 bitrate=2318.6kbits/s speed=0.982x    
frame=  607 fps= 30 q=26.0 size=    5698KiB time=00:00:20.15 bitrate=2316.2kbits/s speed=0.983x    
frame=  622 fps= 30 q=19.0 size=    5822KiB time=00:00:20.65 bitrate=2309.3kbits/s speed=0.983x    
frame=  637 fps= 30 q=25.0 size=    5960KiB time=00:00:21.15 bitrate=2307.9kbits/s speed=0.984x    
frame=  652 fps= 30 q=29.0 size=    6094KiB time=00:00:21.65 bitrate=2305.5kbits/s speed=0.984x    
frame=  667 fps= 30 q=25.0 size=    6238KiB time=00:00:22.15 bitrate=2306.4kbits/s speed=0.984x    
frame=  682 fps= 30 q=22.0 size=    6395KiB time=00:00:22.65 bitrate=2312.4kbits/s speed=0.985x    
frame=  697 fps= 30 q=25.0 size=    6503KiB time=00:00:23.15 bitrate=2300.4kbits/s speed=0.985x    
frame=  712 fps= 30 q=25.0 size=    6627KiB time=00:00:23.65 bitrate=2294.7kbits/s speed=0.985x    
[aist#0:1/pcm_s16le @ 0x3d29c80] Guessed Channel Layout: stereo
Input #0, concat, from 'http://localhost:8000/playlist?channel=3&audioOnly=false&hls=false':
  Duration: N/A, start: 0.000000, bitrate: 1536 kb/s
  Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, SAR 1:1 DAR 16:9, 29.97 tbr, 60k tbn
      Metadata:
        encoder         : Lavc61.3.100 rawvideo
  Stream #0:1: Audio: pcm_s16le (PSD[16] / 0x10445350), 48000 Hz, stereo, s16, 1536 kb/s
      Metadata:
        encoder         : Lavc61.3.100 pcm_s16le
[out#0/mpegts @ 0x3d2a9c0] 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:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mpegts, to 'pipe:1':
  Metadata:
    service_provider: "tunarr"
    service_name    : "Old Adult Cartoons"
    encoder         : Lavf61.1.100
  Stream #0:0: Video: h264, yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 2000 kb/s, 29.97 fps, 90k tbn
      Metadata:
        encoder         : Lavc61.3.100 h264_nvenc
      Side data:
        cpb: bitrate max/min/avg: 2000000/0/2000000 buffer size: 2000000 vbv_delay: N/A
  Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp, 192 kb/s
      Metadata:
        encoder         : Lavc61.3.100 aac
2024-08-05T17:09:35.700Z [debug]: Request ID 'conat-TOFB-fdd77be2-8a25-4bc9-b7ad-b0cc7dd4bc11 concat time-to-first-byte: 302.7626ms

and of course here is my docker compose

---
networks:
  default:
    name: arr
    external: true
version: '3.8'
services:
  tunarr:
    image: chrisbenincasa/tunarr:edge-nvidia
    container_name: tunarr
    restart: unless-stopped
    ports:
      - ${TUNARR_SERVER_PORT:-8000}:8000
    runtime: nvidia
    environment:
      - LOG_LEVEL=${TUNARR_LOG_LEVEL:-INFO}
      - TUNARR_DATABASE_PATH=/docker/tunarr
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=all
      - PGID=1000
      - PUID=1000
      - TZ=America/New_York
chrisbenincasa commented 1 month ago

hey @blarrbot thanks for all of the fine detail - this is super helpful. I agree that it seems to be something related to HEVC. I should be able to tackle this as soon as I find an item in my library I can repro with.

You mentioned that there are some items that will fail when you set Tunarr to encode to h264, but then work when you change that to h265. I know there are some that fail with both, but do you think you could provide media details for one of the items that fail on h264 and succeed on h265? it might help us find some relevant differences.

blarrbot commented 1 month ago

hey.

edit: example added in the next comment

i would also like to add that i tested h265 for the first time tonight and noticed my tvOS plex client would be kicked back to the plex client after an episode ended. switching back to h264 resolved. strange. most settings are default including disable channel prelude being unchecked.

On Mon, Aug 5, 2024 at 8:50 PM Christian Benincasa @.***> wrote:

hey @blarrbot https://github.com/blarrbot thanks for all of the fine detail - this is super helpful. I agree that it seems to be something related to HEVC. I should be able to tackle this as soon as I find an item in my library I can repro with.

You mentioned that there are some items that will fail when you set Tunarr to encode to h264, but then work when you change that to h265. I know there are some that fail with both, but do you think you could provide media details for one of the items that fail on h264 and succeed on h265? it might help us find some relevant differences.

— Reply to this email directly, view it on GitHub https://github.com/chrisbenincasa/tunarr/issues/639#issuecomment-2270161179, or unsubscribe https://github.com/notifications/unsubscribe-auth/BII2FLR7H4CFJYSMQY2PUQ3ZQAMTTAVCNFSM6AAAAABLS32WQ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZQGE3DCMJXHE . You are receiving this because you were mentioned.Message ID: @.***>

blarrbot commented 1 month ago

Managed to find what i think is the cause of this issue, at least when H265 resolves. Source file is 10bit and logs show 10bit is not supported, which explains why it's resolved by switching to h265. i don't believe nvenc h264 supports 10bit at all but i'd love to be corrected there. regardless, ffmpeg shouldn't have an issue transcoding to h264 8bit.

this was tested using latest x64 Chrome, but i also tested with my 10-bit capable apple tv hooked up to an HDR capable projector and got the same error.

Mediainfo:

General Unique ID : 28283919102483592418156499161435356446 (0x154748E06C10A8A1797F046793483D1E) Complete name : A:\path\The Powerpuff Girls (1998)\Specials\The Powerpuff Girls (1998) - S00E04 - The Powerpuff Girls Movie (1080p WEB-DL x265).mkv Format : Matroska Format version : Version 4 File size : 785 MiB Duration : 1 h 13 min Overall bit rate : 1 487 kb/s Frame rate : 24.000 FPS Movie name : The Powerpuff Girls Movie Encoded date : 2019-04-28 22:04:08 UTC Writing application : mkvmerge v30.1.0 ('Forever And More') 64-bit Writing library : libebml v1.3.6 + libmatroska v1.4.9 Writing frontend : StaxRip v1.7.0.6

Video ID : 1 Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main 10@L4@Main Codec ID : V_MPEGH/ISO/HEVC Duration : 1 h 13 min Bit rate : 1 101 kb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 24.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 10 bits Bits/(Pixel*Frame) : 0.022 Stream size : 581 MiB (74%) Writing library : x265 2.9+8-27d8424c799d:[Windows][GCC 8.2.0][64 bit] 10bit Encoding settings : cpuid=1049583 / frame-threads=3 / numa-pools=8 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x1080 / interlace=0 / total-frames=106243 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=24 / keyint=250 / gop-lookahead=0 / bframes=8 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=80 / lookahead-slices=0 / scenecut=40 / radl=0 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / no-strong-intra-smoothing / max-merge=2 / limit-refs=3 / no-limit-modes / me=1 / subme=5 / merange=57 / temporal-mvp / weightp / no-weightb / no-analyze-src-pics / deblock=-3:-3 / no-sao / no-sao-non-deblock / rd=3 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=abr / bitrate=1100 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=2 / cplxblur=20.0 / qblur=0.5 / ipratio=1.40 / pbratio=1.30 / aq-mode=3 / aq-strength=0.80 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-mv-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei Default : Yes Forced : No

Audio ID : 2 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : A_AAC-2 Duration : 1 h 13 min Bit rate : 384 kb/s Channel(s) : 6 channels Channel layout : C L R Ls Rs LFE Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Stream size : 203 MiB (26%) Language : English Default : Yes Forced : No

Logs when using h264:

2024-08-06T18:31:23.413Z [info]: Stream starting. Channel: 2 (Cartoons) 2024-08-06T18:31:23.413Z [debug]: Starting ffmpeg concat process with args: -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=2&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v h264_nvenc -c:a aac -b:v 2000k -maxrate:v 2000k -bufsize:v 2000k -b:a 192k -maxrate:a 192k -bufsize:a 50k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Cartoons" -f mpegts -mpegts_flags +initial_discontinuity pipe:1 {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:23.419Z [debug] <>: Added channel connection for 92f467ad-7369-40e9-a320-c5f6b207ee30 with token 21531116-685e-4b37-80fa-b71137d611f1. {"ipAddress":"172.18.0.1"} 2024-08-06T18:31:23.429Z [debug]: Starting stream timestamp: 2024-08-06T14:31:23-04:00 2024-08-06T18:31:23.438Z [info]: ! Start playback 2024-08-06T18:31:23.438Z [info]: ! Channel: Cartoons (2) 2024-08-06T18:31:23.438Z [info]: ! Title: The Powerpuff Girls Movie 2024-08-06T18:31:23.438Z [info]: ! From: 3227722 to: 4426791 2024-08-06T18:31:23.438Z [info]: ! Type: program 2024-08-06T18:31:23.441Z [debug]: About to play plex stream 2024-08-06T18:31:23.447Z [debug]: {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:23.447Z [debug]: Starting ffmpeg with args: "-hide_banner -threads 6 -fflags +genpts+discardcorrupt+igndts -loglevel error -re -ss 3227.722 -i http://IP:32400/library/parts/31517/1720215117/file.mkv?X-Plex-Token=REDACTED -filter_complex [0:1]anull[audio];[audio]aresample=48000,aresample=async=1:first_pts=0,apad=whole_dur=1199069ms[padded] -map 0:v -c:v rawvideo -sc_threshold 0 -video_track_timescale 90000 -map [padded] -flags cgop+ilme -c:a pcm_s16le -map_metadata -1 -movflags +faststart -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Cartoons" -f nut pipe:1" {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:23.706Z [debug]: Video stream started in 276.6892230063677 ms [aist#0:1/pcm_s16le @ 0x51c31c0] Guessed Channel Layout: 5.1 Input #0, concat, from 'http://localhost:8000/playlist?channel=2&audioOnly=false&hls=false': Duration: N/A, start: 0.000000, bitrate: 4608 kb/s Stream #0:0: Video: rawvideo (Y3[11][10] / 0xA0B3359), yuv420p10le, 1920x1080, SAR 1:1 DAR 16:9, 24 tbr, 49152 tbn Metadata: encoder : Lavc61.3.100 rawvideo Stream #0:1: Audio: pcm_s16le (PSD[16] / 0x10445350), 48000 Hz, 5.1, s16, 4608 kb/s Metadata: encoder : Lavc61.3.100 pcm_s16le [out#0/mpegts @ 0x51c3c80] 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:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc)) Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native)) Press [q] to stop, [?] for help [h264_nvenc @ 0x51c5000] 10 bit encode not supported [h264_nvenc @ 0x51c5000] No capable devices found [vost#0:0/h264_nvenc @ 0x51c4ac0] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. [vf#0:0 @ 0x51a2c00] Error sending frames to consumers: Generic error in an external library [vf#0:0 @ 0x51a2c00] Task finished with error code: -542398533 (Generic error in an external library) [vf#0:0 @ 0x51a2c00] Terminating thread with return code -542398533 (Generic error in an external library) [vost#0:0/h264_nvenc @ 0x51c4ac0] Could not open encoder before EOF [vost#0:0/h264_nvenc @ 0x51c4ac0] Task finished with error code: -22 (Invalid argument) [vost#0:0/h264_nvenc @ 0x51c4ac0] Terminating thread with return code -22 (Invalid argument) [out#0/mpegts @ 0x51c3c80] Nothing was written into output file, because at least one of its streams received no packets. frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A
[aac @ 0x51e3f40] Qavg: 611.301 Conversion failed! 2024-08-06T18:31:24.533Z [debug]: Client closed video stream, stopping it now. 2024-08-06T18:31:24.533Z [debug]: Stream FFMPEG RECEIVED kill() command {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:24.538Z [debug]: Concat request closed. 2024-08-06T18:31:24.538Z [debug] <>: Removed connection from channel 92f467ad-7369-40e9-a320-c5f6b207ee30 for token 21531116-685e-4b37-80fa-b71137d611f1. 0 remaining connections 2024-08-06T18:31:24.538Z [debug]: Running task OnDemandChannelStateTask 2024-08-06T18:31:24.538Z [debug]: Detected client initiated concat close, stopping stream... 2024-08-06T18:31:24.538Z [debug]: Concat FFMPEG RECEIVED kill() command {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:24.540Z [debug] <>: Scheduling session shutdown 2024-08-06T18:31:24.540Z [debug]: Task OnDemandChannelStateTask ran in 2.39 ms 2024-08-06T18:31:24.543Z [debug]: Concat stream was closed! 2024-08-06T18:31:24.543Z [debug] <>: Shutting down session 2024-08-06T18:31:24.543Z [debug]: Cleaning up on-demand channel: 92f467ad-7369-40e9-a320-c5f6b207ee30 2024-08-06T18:31:24.543Z [info]: Concat FFMPEG exited with code 187. {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:24.544Z [error]: CONCAT - FFMPEG ERROR {"code":187,"cmd":"/usr/bin/ffmpeg -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=2&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v h264_nvenc -c:a aac -b:v 2000k -maxrate:v 2000k -bufsize:v 2000k -b:a 192k -maxrate:a 192k -bufsize:a 50k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 0 -muxpreload 0 -metadata service_provider=\"tunarr\" -metadata service_name=\"Cartoons\" -f mpegts -mpegts_flags +initial_discontinuity pipe:1"} 2024-08-06T18:31:24.549Z [debug]: Stream FFMPEG exited due to signal: SIGKILL as expected. {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:32:00.002Z [debug]: Running task OnDemandChannelStateTask 2024-08-06T18:32:00.003Z [debug]: Task OnDemandChannelStateTask ran in 0.97 ms

Logs when using h265

2024-08-06T18:40:30.556Z [info]: Stream starting. Channel: 2 (Cartoons) 2024-08-06T18:40:30.556Z [debug]: Starting ffmpeg concat process with args: -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=2&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v hevc_nvenc -c:a aac -b:v 2000k -maxrate:v 2000k -bufsize:v 2000k -b:a 192k -maxrate:a 192k -bufsize:a 50k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Cartoons" -f mpegts -mpegts_flags +initial_discontinuity pipe:1 {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:40:30.561Z [debug] <>: Added channel connection for 92f467ad-7369-40e9-a320-c5f6b207ee30 with token d5b44975-3bab-4fc3-a05d-a22a2e3592ea. {"ipAddress":"172.18.0.1"} 2024-08-06T18:40:30.571Z [debug]: Starting stream timestamp: 2024-08-06T14:40:30-04:00 2024-08-06T18:40:30.580Z [info]: ! Start playback 2024-08-06T18:40:30.580Z [info]: ! Channel: Cartoons (2) 2024-08-06T18:40:30.580Z [info]: ! Title: The Powerpuff Girls Movie 2024-08-06T18:40:30.580Z [info]: ! From: 3774864 to: 4426791 2024-08-06T18:40:30.580Z [info]: ! Type: program 2024-08-06T18:40:30.585Z [debug]: About to play plex stream 2024-08-06T18:40:30.592Z [debug]: {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:40:30.592Z [debug]: Starting ffmpeg with args: "-hide_banner -threads 6 -fflags +genpts+discardcorrupt+igndts -loglevel error -re -ss 3774.864 -i http://IP:32400/library/parts/31517/1720215117/file.mkv?X-Plex-Token=REDACTED -filter_complex [0:1]anull[audio];[audio]aresample=48000,aresample=async=1:first_pts=0,apad=whole_dur=651927ms[padded] -map 0:v -c:v rawvideo -sc_threshold 0 -video_track_timescale 90000 -map [padded] -flags cgop+ilme -c:a pcm_s16le -map_metadata -1 -movflags +faststart -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Cartoons" -f nut pipe:1" {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:40:30.908Z [debug]: Video stream started in 337.5747890025377 ms [aist#0:1/pcm_s16le @ 0x51040c0] Guessed Channel Layout: 5.1 Input #0, concat, from 'http://localhost:8000/playlist?channel=2&audioOnly=false&hls=false': Duration: N/A, start: 0.000000, bitrate: 4608 kb/s Stream #0:0: Video: rawvideo (Y3[11][10] / 0xA0B3359), yuv420p10le, 1920x1080, SAR 1:1 DAR 16:9, 24 tbr, 49152 tbn Metadata: encoder : Lavc61.3.100 rawvideo Stream #0:1: Audio: pcm_s16le (PSD[16] / 0x10445350), 48000 Hz, 5.1, s16, 4608 kb/s Metadata: encoder : Lavc61.3.100 pcm_s16le [out#0/mpegts @ 0x510b5c0] 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:0 -> #0:0 (rawvideo (native) -> hevc (hevc_nvenc)) Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native)) Press [q] to stop, [?] for help Output #0, mpegts, to 'pipe:1': Metadata: service_provider: "tunarr" service_name : "Cartoons" encoder : Lavf61.1.100 Stream #0:0: Video: hevc, p010le(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 2000 kb/s, 24 fps, 90k tbn Metadata: encoder : Lavc61.3.100 hevc_nvenc Side data: cpb: bitrate max/min/avg: 2000000/0/2000000 buffer size: 2000000 vbv_delay: N/A Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp, 192 kb/s Metadata: encoder : Lavc61.3.100 aac 2024-08-06T18:40:31.023Z [debug]: Request ID 'conat-TOFB-3c773c04-075e-48c9-8540-e1b7d5c279c0 concat time-to-first-byte: 467.6808ms

chrisbenincasa commented 1 month ago

The is hugely helpful and definitely looks to be the reason. I think there are some changes we can make to make this a bit more stable.

I have a larger set of changes to make the ffmpeg pipeline a lot more resilient but those are a bit off. So for now, we’ll probably have fix these types of issues piecemeal.

Again, really appreciate the investigation. If you get any more info while trying this out please let me know! I should be able to look into this and fixes for it this week.

On Tue, Aug 6, 2024 at 2:42 PM blarrbot @.***> wrote:

Managed to find what i think is the cause of this issue, at least when H265 resolves. Source file is 10bit and logs show 10bit is not supported, which explains why it's resolved by switching to h265. i don't believe h264 supports 10bit yet i know tools like Handbrake support 10bit x264 encoding so i'm hoping there is a solution that involves using h264 or x264. if we're already transcoding, it'd be nice to use the more widely supported format.

Mediainfo:

General Unique ID : 28283919102483592418156499161435356446 (0x154748E06C10A8A1797F046793483D1E) Complete name : A:\path\The Powerpuff Girls (1998)\Specials\The Powerpuff Girls (1998) - S00E04 - The Powerpuff Girls Movie (1080p WEB-DL x265).mkv Format : Matroska Format version : Version 4 File size : 785 MiB Duration : 1 h 13 min Overall bit rate : 1 487 kb/s Frame rate : 24.000 FPS Movie name : The Powerpuff Girls Movie Encoded date : 2019-04-28 22:04:08 UTC Writing application : mkvmerge v30.1.0 ('Forever And More') 64-bit Writing library : libebml v1.3.6 + libmatroska v1.4.9 Writing frontend : StaxRip v1.7.0.6

Video ID : 1 Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main @.**@Main Codec ID : V_MPEGH/ISO/HEVC Duration : 1 h 13 min Bit rate : 1 101 kb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 24.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 10 bits Bits/(PixelFrame) : 0.022 Stream size : 581 MiB (74%) Writing library : x265 2.9+8-27d8424c799d:[Windows][GCC 8.2.0][64 bit] 10bit Encoding settings : cpuid=1049583 / frame-threads=3 / numa-pools=8 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x1080 / interlace=0 / total-frames=106243 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=24 / keyint=250 / gop-lookahead=0 / bframes=8 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=80 / lookahead-slices=0 / scenecut=40 / radl=0 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / no-strong-intra-smoothing / max-merge=2 / limit-refs=3 / no-limit-modes / me=1 / subme=5 / merange=57 / temporal-mvp / weightp / no-weightb / no-analyze-src-pics / deblock=-3:-3 / no-sao / no-sao-non-deblock / rd=3 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=abr / bitrate=1100 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=2 / cplxblur=20.0 / qblur=0.5 / ipratio=1.40 / pbratio=1.30 / aq-mode=3 / aq-strength=0.80 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-mv-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei Default : Yes Forced : No

Audio ID : 2 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : A_AAC-2 Duration : 1 h 13 min Bit rate : 384 kb/s Channel(s) : 6 channels Channel layout : C L R Ls Rs LFE Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Stream size : 203 MiB (26%) Language : English Default : Yes Forced : No

Logs when using h264:

2024-08-06T18:31:23.413Z [info]: Stream starting. Channel: 2 (Cartoons) 2024-08-06T18:31:23.413Z [debug]: Starting ffmpeg concat process with args: -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=2&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v h264_nvenc -c:a aac -b:v 2000k -maxrate:v 2000k -bufsize:v 2000k -b:a 192k -maxrate:a 192k -bufsize:a 50k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Cartoons" -f mpegts -mpegts_flags +initial_discontinuity pipe:1 {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:23.419Z [debug] <>: Added channel connection for 92f467ad-7369-40e9-a320-c5f6b207ee30 with token 21531116-685e-4b37-80fa-b71137d611f1. {"ipAddress":"172.18.0.1"} 2024-08-06T18:31:23.429Z [debug]: Starting stream timestamp: 2024-08-06T14:31:23-04:00 2024-08-06T18:31:23.438Z [info]: ! Start playback 2024-08-06T18:31:23.438Z [info]: ! Channel: Cartoons (2) 2024-08-06T18:31:23.438Z [info]: ! Title: The Powerpuff Girls Movie 2024-08-06T18:31:23.438Z [info]: ! From: 3227722 to: 4426791 2024-08-06T18:31:23.438Z [info]: ! Type: program 2024-08-06T18:31:23.441Z [debug]: About to play plex stream 2024-08-06T18:31:23.447Z [debug]: {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:23.447Z [debug]: Starting ffmpeg with args: "-hide_banner -threads 6 -fflags +genpts+discardcorrupt+igndts -loglevel error -re -ss 3227.722 -i http://IP:32400/library/parts/31517/1720215117/file.mkv?X-Plex-Token=REDACTED -filter_complex [0:1]anull[audio];[audio]aresample=48000,aresample=async=1:first_pts=0,apad=whole_dur=1199069ms[padded] -map 0:v -c:v rawvideo -sc_threshold 0 -video_track_timescale 90000 -map [padded] -flags cgop+ilme -c:a pcm_s16le -map_metadata -1 -movflags +faststart -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Cartoons" -f nut pipe:1" {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:23.706Z [debug]: Video stream started in 276.6892230063677 ms [aist#0:1/pcm_s16le @ 0x51c31c0] Guessed Channel Layout: 5.1 Input #0, concat, from ' http://localhost:8000/playlist?channel=2&audioOnly=false&hls=false': Duration: N/A, start: 0.000000, bitrate: 4608 kb/s Stream #0:0: Video: rawvideo (Y3[11][10] / 0xA0B3359), yuv420p10le, 1920x1080, SAR 1:1 DAR 16:9, 24 tbr, 49152 tbn Metadata: encoder : Lavc61.3.100 rawvideo Stream #0:1: Audio: pcm_s16le (PSD[16] / 0x10445350), 48000 Hz, 5.1, s16, 4608 kb/s Metadata: encoder : Lavc61.3.100 pcm_s16le [out#0/mpegts @ 0x51c3c80] 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:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc)) Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native)) Press [q] to stop, [?] for help [h264_nvenc @ 0x51c5000] 10 bit encode not supported [h264_nvenc @ 0x51c5000] No capable devices found [vost#0:0/h264_nvenc @ 0x51c4ac0] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. [vf#0:0 @ 0x51a2c00] Error sending frames to consumers: Generic error in an external library [vf#0:0 @ 0x51a2c00] Task finished with error code: -542398533 (Generic error in an external library) [vf#0:0 @ 0x51a2c00] Terminating thread with return code -542398533 (Generic error in an external library) [vost#0:0/h264_nvenc @ 0x51c4ac0] Could not open encoder before EOF [vost#0:0/h264_nvenc @ 0x51c4ac0] Task finished with error code: -22 (Invalid argument) [vost#0:0/h264_nvenc @ 0x51c4ac0] Terminating thread with return code -22 (Invalid argument) [out#0/mpegts @ 0x51c3c80] Nothing was written into output file, because at least one of its streams received no packets. frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A [aac @ 0x51e3f40] Qavg: 611.301 Conversion failed! 2024-08-06T18:31:24.533Z [debug]: Client closed video stream, stopping it now. 2024-08-06T18:31:24.533Z [debug]: Stream FFMPEG RECEIVED kill() command {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:24.538Z [debug]: Concat request closed. 2024-08-06T18:31:24.538Z [debug] <>: Removed connection from channel 92f467ad-7369-40e9-a320-c5f6b207ee30 for token 21531116-685e-4b37-80fa-b71137d611f1. 0 remaining connections 2024-08-06T18:31:24.538Z [debug]: Running task OnDemandChannelStateTask 2024-08-06T18:31:24.538Z [debug]: Detected client initiated concat close, stopping stream... 2024-08-06T18:31:24.538Z [debug]: Concat FFMPEG RECEIVED kill() command {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:24.540Z [debug] <>: Scheduling session shutdown 2024-08-06T18:31:24.540Z [debug]: Task OnDemandChannelStateTask ran in 2.39 ms 2024-08-06T18:31:24.543Z [debug]: Concat stream was closed! 2024-08-06T18:31:24.543Z [debug] <>: Shutting down session 2024-08-06T18:31:24.543Z [debug]: Cleaning up on-demand channel: 92f467ad-7369-40e9-a320-c5f6b207ee30 2024-08-06T18:31:24.543Z [info]: Concat FFMPEG exited with code 187. {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:31:24.544Z [error]: CONCAT - FFMPEG ERROR {"code":187,"cmd":"/usr/bin/ffmpeg -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=2&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v h264_nvenc -c:a aac -b:v 2000k -maxrate:v 2000k -bufsize:v 2000k -b:a 192k -maxrate:a 192k -bufsize:a 50k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Cartoons" -f mpegts -mpegts_flags +initial_discontinuity pipe:1"} 2024-08-06T18:31:24.549Z [debug]: Stream FFMPEG exited due to signal: SIGKILL as expected. {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:32:00.002Z [debug]: Running task OnDemandChannelStateTask 2024-08-06T18:32:00.003Z [debug]: Task OnDemandChannelStateTask ran in 0.97 ms

Logs when using h265

2024-08-06T18:40:30.556Z [info]: Stream starting. Channel: 2 (Cartoons) 2024-08-06T18:40:30.556Z [debug]: Starting ffmpeg concat process with args: -hide_banner -threads 1 -fflags +genpts+discardcorrupt+igndts -re -f concat -safe 0 -stream_loop -1 -protocol_whitelist file,http,tcp,https,tcp,tls -probesize 32 -i http://localhost:8000/playlist?channel=2&audioOnly=false&hls=false -flags cgop -sc_threshold 0 -movflags +faststart -map 0:v -map 0:a -c:v hevc_nvenc -c:a aac -b:v 2000k -maxrate:v 2000k -bufsize:v 2000k -b:a 192k -maxrate:a 192k -bufsize:a 50k -af aselect=concatdec_select,aresample=async=1 -ac 2 -ar 48k -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Cartoons" -f mpegts -mpegts_flags +initial_discontinuity pipe:1 {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:40:30.561Z [debug] <>: Added channel connection for 92f467ad-7369-40e9-a320-c5f6b207ee30 with token d5b44975-3bab-4fc3-a05d-a22a2e3592ea. {"ipAddress":"172.18.0.1"} 2024-08-06T18:40:30.571Z [debug]: Starting stream timestamp: 2024-08-06T14:40:30-04:00 2024-08-06T18:40:30.580Z [info]: ! Start playback 2024-08-06T18:40:30.580Z [info]: ! Channel: Cartoons (2) 2024-08-06T18:40:30.580Z [info]: ! Title: The Powerpuff Girls Movie 2024-08-06T18:40:30.580Z [info]: ! From: 3774864 to: 4426791 2024-08-06T18:40:30.580Z [info]: ! Type: program 2024-08-06T18:40:30.585Z [debug]: About to play plex stream 2024-08-06T18:40:30.592Z [debug]: {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:40:30.592Z [debug]: Starting ffmpeg with args: "-hide_banner -threads 6 -fflags +genpts+discardcorrupt+igndts -loglevel error -re -ss 3774.864 -i http://IP:32400/library/parts/31517/1720215117/file.mkv?X-Plex-Token=REDACTED -filter_complex [0:1]anull[audio];[audio]aresample=48000,aresample=async=1:first_pts=0,apad=whole_dur=651927ms[padded] -map 0:v -c:v rawvideo -sc_threshold 0 -video_track_timescale 90000 -map [padded] -flags cgop+ilme -c:a pcm_s16le -map_metadata -1 -movflags +faststart -muxdelay 0 -muxpreload 0 -metadata service_provider="tunarr" -metadata service_name="Cartoons" -f nut pipe:1" {"channel":"92f467ad-7369-40e9-a320-c5f6b207ee30"} 2024-08-06T18:40:30.908Z [debug]: Video stream started in 337.5747890025377 ms [aist#0:1/pcm_s16le @ 0x51040c0] Guessed Channel Layout: 5.1 Input #0, concat, from ' http://localhost:8000/playlist?channel=2&audioOnly=false&hls=false': Duration: N/A, start: 0.000000, bitrate: 4608 kb/s Stream #0:0: Video: rawvideo (Y3[11][10] / 0xA0B3359), yuv420p10le, 1920x1080, SAR 1:1 DAR 16:9, 24 tbr, 49152 tbn Metadata: encoder : Lavc61.3.100 rawvideo Stream #0:1: Audio: pcm_s16le (PSD[16] / 0x10445350), 48000 Hz, 5.1, s16, 4608 kb/s Metadata: encoder : Lavc61.3.100 pcm_s16le [out#0/mpegts @ 0x510b5c0] 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:0 -> #0:0 (rawvideo (native) -> hevc (hevc_nvenc)) Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native)) Press [q] to stop, [?] for help Output #0, mpegts, to 'pipe:1': Metadata: service_provider: "tunarr" service_name : "Cartoons" encoder : Lavf61.1.100 Stream #0:0: Video: hevc, p010le(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 2000 kb/s, 24 fps, 90k tbn Metadata: encoder : Lavc61.3.100 hevc_nvenc Side data: cpb: bitrate max/min/avg: 2000000/0/2000000 buffer size: 2000000 vbv_delay: N/A Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp, 192 kb/s Metadata: encoder : Lavc61.3.100 aac 2024-08-06T18:40:31.023Z [debug]: Request ID 'conat-TOFB-3c773c04-075e-48c9-8540-e1b7d5c279c0 concat time-to-first-byte: 467.6808ms

— Reply to this email directly, view it on GitHub https://github.com/chrisbenincasa/tunarr/issues/639#issuecomment-2271919980, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMQRX2MTZQJYGB2Q3S5RJLZQEKJFAVCNFSM6AAAAABLS32WQ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZRHEYTSOJYGA . You are receiving this because you were mentioned.Message ID: @.***>

chrisbenincasa commented 3 weeks ago

Seems like this might be specific to using the nvidia encoder - testing on my Mac with videotoolbox with some 10-bit HEVC files and unable to repro. I'll have to hop onto my other computer that has the Nvidia card to test this out.

chrisbenincasa commented 7 hours ago

Have a prospective fix for this here: https://github.com/chrisbenincasa/tunarr/pull/765

Basic idea is to convert down to 8-bit for format/GPU combinations that don't support 10-bit output. It might not be perfect, but the FFMPEG pipeline has a long way to go. This seemed to work in my testing, though!