Thanks for the wonderful program first of all, so let me get to the point.
In mux, i can add a pipe command like this and mux will generate service and it's watchable.
pipe:///usr/local/ffmpeg/bin/ffmpeg -i INPUT_LINK -vcodec copy -acodec copy -f mpegts pipe:1
The same, I put this command in a bash script like this named /volume1/appdata/t.sh:
#!/bin/bash
/usr/local/ffmpeg/bin/ffmpeg -i INPUT_LINK -vcodec copy -acodec copy -f mpegts pipe:1
then make it executable using:
chmod 755 /volume1/appdata/t.sh
I test the script using stdout and will generate video file.
then pipe in mux like this:
pipe:///volume1/appdata/t.sh
when running the mux, it will not generate anything, just says no data. here's the log
2017-06-14 14:25:42.284 spawn: Executing "/volume1/appdata/t.sh"
2017-06-14 14:25:42.284 subscription: 0019: "HTTP" subscribing to mux "test", weight: 10, adapter: "IPTV", network: "test", service: "Raw PID Subscription", hostname="10.0.0.119", client="NSPlayer/7.10.0.3059"
2017-06-14 14:25:42.300 iptv: stdin pipe unexpectedly closed: No data
2017-06-14 14:25:58.273 subscription: 0019: service instance is bad, reason: No input detected
This is on synology ds916+, with HTS Tvheadend 4.3.28042017
I suspect that it can not execute because some kind of permission issue, but I have also use chown to make internal user cs-tvheadend-testing as the owner of t.sh, and put it under tvheadend home folder and still no data.
Because this NAS support hardware accel, so I can use the following command with very fast encoding speed, about 170fps
/volume1/@appstore/VideoStation/bin/ffmpeg-vaapi -loglevel fatal -flags +global_header -vaapi_device "/dev/dri/card0" -hwaccel vaapi -hwaccel_output_format vaapi -i INPUT_LINK -c:v h264_vaapi ts.mp4
however, if pipe it, not even in a bash script, just pipe it like this:
pipe:///volume1/@appstore/VideoStation/bin/ffmpeg-vaapi -loglevel fatal -flags +global_header -vaapi_device "/dev/dri/renderD128" -hwaccel vaapi -hwaccel_output_format vaapi -i INPUT_LINK -c:v h264_vaapi -f mpegts -tune zerolatency pipe:1
The error is that somehow, tvheadend can not access dev/dri/renderD128, while command line can,
2017-06-15 08:57:38.617 spawn: [AVHWDeviceContext @ 0x3381580] No VA display found for device: "/dev/dri/renderD128".
2017-06-15 08:57:38.617 spawn: [vaapi @ 0x17daa50] Failed to create a VAAPI device
2017-06-15 08:57:38.618 iptv: stdin pipe unexpectedly closed: No data
and that's why i think there's some king of permission issue.
Could anyone please help and see how to resolve this?
Thanks.