IPTV script does not allow ffmpeg -i "http://"
#1
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?
Reply
#2
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.
Reply
#3
Sorry, I corrected my post. Pipe:// is not within the bash script.

Could you give me a working example??
Reply
#4
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.
Reply
#5
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.
Reply
#6
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&
Reply
#7
(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
Reply
#8
What about urlencoding the input URL? Replace "&" with "%26" in the URL; that might work ...
Reply



Logout Mark Read Team Forum Stats Members Help
IPTV script does not allow ffmpeg -i "http://"1
This forum uses Lukasz Tkacz MyBB addons.