Kodi Community Forum
IPTV script does not allow ffmpeg -i "http://" - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: PVR & Live TV Support (https://forum.kodi.tv/forumdisplay.php?fid=167)
+---- Forum: Tvheadend (https://forum.kodi.tv/forumdisplay.php?fid=168)
---- Thread: IPTV script does not allow ffmpeg -i "http://" (/showthread.php?tid=304106)



IPTV script does not allow ffmpeg -i "http://" - rosenrot - 2017-01-14

In the URL field of the tvheadend iptv settings I put:

Code:
pipe:///script.sh

The script contains:

Code:
#!/bin/bash
/usr/bin/ffmpeg -loglevel fatal -i http://ip?id=1&a=1&b=2 -vcodec copy -acodec copy -f mpegts pipe:1

However running the script shows an error because of the & symbol in the command. Seems that the bash script only executes the ffmpeg command until the &a=1. This leads to an error because the auth for the stream can not be done.

Adding "" to the source does work the job, the script executes, but tvheadend does not play the stream.

Code:
#!/bin/bash
/usr/bin/ffmpeg -loglevel fatal -i "http://ip?id=1&a=1&b=2" -vcodec copy -acodec copy -f mpegts pipe:1


Can someone help me?


RE: IPTV script does not allow ffmpeg -i "http://" - rpcameron - 2017-01-15

The "pipe://" is specific to TVH. Your script should not include that.

If you are going to use the pipe protocol, just ensure that your output is MPEG-TS output to stdout.


RE: IPTV script does not allow ffmpeg -i "http://" - rosenrot - 2017-01-15

Sorry, I corrected my post. Pipe:// is not within the bash script.

Could you give me a working example??


RE: IPTV script does not allow ffmpeg -i "http://" - rpcameron - 2017-01-15

pipe:///usr/bin/ffmpeg -v panic -hide_banner -nostats -i http://ip_address/path -c copy -flags +global_header -f mpegts pipe:1

That is a pipe command I have successfully used from within an M3U playlist with an Automatic IPTV network with TVH.


RE: IPTV script does not allow ffmpeg -i "http://" - rpcameron - 2017-01-15

A thought:

Because you are calling ffmpeg from a script, your redirection is probably failing because it is not immediately piping the output. If you must use a script, prefix it with exec, such as :

#!/bin/bash
exec /usr/bin/ffmpeg -i http://blah/blah -c copy -f mpegts pipe:1

That might solve your issues.


RE: IPTV script does not allow ffmpeg -i "http://" - rosenrot - 2017-01-16

Unfortunately it does not solve my problem since I have & symbols within my source. It seems that the bash script does only execute the ffmpeg command until the first &.

Code:
#!/bin/bash
exec /usr/bin/ffmpeg -loglevel fatal -i http://ip?id=1&a=1&b=2 -vcodec copy -acodec copy -f mpegts pipe:1

only runs this:

Code:
#!/bin/bash
/usr/bin/ffmpeg -loglevel fatal -i http://ip?id=1&



RE: IPTV script does not allow ffmpeg -i "http://" - rosenrot - 2017-01-16

(2017-01-15, 03:14)rpcameron Wrote: pipe:///usr/bin/ffmpeg -v panic -hide_banner -nostats -i http://ip_address/path -c copy -flags +global_header -f mpegts pipe:1

That is a pipe command I have successfully used from within an M3U playlist with an Automatic IPTV network with TVH.

What happens if you add "" around the URL, like this to:

Code:
pipe:///usr/bin/ffmpeg -v panic -hide_banner -nostats -i "http://ip_address/path" -c copy -flags +global_header -f mpegts pipe:1



RE: IPTV script does not allow ffmpeg -i "http://" - rpcameron - 2017-01-16

What about urlencoding the input URL? Replace "&" with "%26" in the URL; that might work ...


This forum uses Lukasz Tkacz MyBB addons.