Okay, I changed the range.
I am using the direct url
> #!/bin/bash
> /usr/bin/ffmpeg -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconne$
> -hide_banner -loglevel fatal \
> -i
http://10.0.0.11:9981/stream/channelnumber/2 \
> -vcodec copy -acodec copy -scodec copy -g 60 \
> -fflags +genpts -user_agent HLS_delayer \
> -metadata service_provider="TimeShift" \
> -metadata service_name="TV 1" \
> -f hls -hls_flags delete_segments \
> -hls_time 60 \
> -hls_list_size 480 \
> -hls_wrap 481 \
> -hls_segment_filename /opt/hls/tmp/%03d.ts /opt/hls/tmp/hls.m3u8
>
The service looks like:
> [Unit]
> Description=Timeshift tv
> After=tvheadend.service
> PartOf=tvheadend.service
>
> [Service]
> ExecStartPre=/bin/mkdir -p -m777 /opt/hls/tmp
> ExecStart=/opt/hls/hls.sh
> ExecStoPostp=/bin/rm -rf /opt/hls/tmp
>
> [Install]
> WantedBy=default.target
When I run it manually:
> pi@tv3:/etc/systemd/system $ sudo systemctl status tv3 service
> Unit service.service could not be found.
> ● tv3.service - Timeshift tv
> Loaded: loaded (/etc/systemd/system/tv3.service; enabled; vendor preset: enabled)
> Active: active (running) since Sat 2020-05-23 14:32:35 BST; 16s ago
> Process: 781 ExecStartPre=/bin/mkdir -p -m777 /opt/hls/tmp (code=exited, status=0/SUCCESS)
> Main PID: 782 (hls.sh)
> Tasks: 2 (limit: 4915)
> Memory: 18.2M
> CGroup: /system.slice/tv3.service
> ├─782 /bin/bash /opt/hls/hls.sh
> └─784 /usr/bin/ffmpeg -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 2 -y -nostdin -hide_banner -loglevel fa
>
> May 23 14:32:35 tv3 systemd[1]: Starting Timeshift tv...
> May 23 14:32:35 tv3 systemd[1]: Started Timeshift tv.
This is what happens when I check the service on boot:
> tv3.service - Timeshift tv
> Loaded: loaded (/etc/systemd/system/tv3.service; enabled; vendor preset: enabled)
> Active: failed (Result: exit-code) since Sat 2020-05-23 14:36:41 BST; 2min 18s ago
> Process: 464 ExecStartPre=/bin/mkdir -p -m777 /opt/hls/tmp (code=exited, status=0/SUCCESS)
> Process: 471 ExecStart=/opt/hls/hls.sh (code=exited, status=1/FAILURE)
> Main PID: 471 (code=exited, status=1/FAILURE)
>
> May 23 14:36:40 tv3 systemd[1]: Starting Timeshift tv...
> May 23 14:36:40 tv3 systemd[1]: Started Timeshift tv.
> May 23 14:36:41 tv3 systemd[1]: tv3.service: Main process exited, code=exited, status=1/FAILURE
> May 23 14:36:41 tv3 systemd[1]: tv3.service: Failed with result 'exit-code'.
Something I noticed while watching the TVH log is that on boot I never see a connection attempt.
Are there any other logs I should provide, and if so, how do I provide them?