Hello,
I have an ffmpeg
bash script
which is working nice
and
I need to do the same for other sources.
To create new scripts and to deal with multiple bash files
sounds not logical. It is a bit hard to manage for me..
I wondered if it was possible to make my input file as variable.
Then I wrote below scripts to make it shorter
This one works as expected.
working_nice_one.sh
#!/bin/bash
while read line
do
/usr/bin/ffmpeg -loglevel quiet -re -y -reconnect_delay_max 2 -timeout 1600000 \
-i $line -c copy -f mpegts pipe:1 </dev/null
done < myfile
myfile
http://xx.yy.zz
http://aa.bb.cc
http://11.22.33
I call the script this way: (this is what I do not prefer)
pipe:///home/working_nice_one.sh
When the first source goes down, it runs the second source promptly, etc..
At the end of the loop, it goes back to first url line once again. That is good..
Below one is working just for the first line of myfile source. Not looping for some reason. I really dont understand why this is happening.
it_works_but_not_loop.sh
#!/bin/bash
while read line
do
/usr/bin/ffmpeg -loglevel quiet -re -y -reconnect_delay_max 2 -timeout 1600000 \
-i $line -c copy -f mpegts pipe:1 </dev/null
done < "$1"
I call the script this way: (what I wish to accomplish)
pipe:///home/it_works_but_not_loop.sh myfile
Could you please explain why the second one is not looping and reading only the first line of my source file? I am scratching my hairs
Thanks
Boris