Hi all again!
----Edited, corrected on yyyy.mm.dd. 2024.09.09. CEST 19:47----
I've re-tested the following scripts and seems they are working much better now:
1st: NOStreamer_MX-antix-2.0.sh
Code: Select all
#!/bin/bash
export frame_rate="25"
export video_bitrate="2500k"
export audio_bitrate="256k"
###DO_NOT_EDIT_BELOW######
export LANG=C
export LC_NUMERIC=C
export OUTPUT_CHARSET=UTF-8
export cucf=$(xrandr | grep 'Screen' | grep -o "t.*, " | sed 's/ //g ; s/t\|\,//g')
#export ipcim="$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')"
export ipcim="$(ip route | grep -m1 -o "src [^ ]*" | cut -f2 -d' ')"
export audiocodecs="$(ffmpeg -hide_banner -encoders|grep "A..\..." | grep -v "= Audio\|[248]\-bit\|planar\|[aA][dD][pP]" | cut -f3- -d' ' | sed 's/ / /g')"
export videocodecs="$(ffmpeg -hide_banner -encoders|grep "V..\..." | grep "mpeg\|H\.\|VP\|theora\|wmv" | cut -f3- -d' ' | sed 's/ / /g ; s: / : :g ; s/ part 2// ; s/(cod.*)// ; s/ AVC MPEG-4//')"
NOSTMP="$HOME/ernyostreamelo"
if [[ -d "$NOSTMP" ]];then
echo "1"
else
mkdir -p "$NOSTMP"
xmessage -title "Something Happen" -buttons Ok:0,Cancel:1 -default Ok -nearmouse "Created:
$NOSTMP
" &
fi
export ablakf="$NOSTMP/ablakf.txt"
export ablak="$NOSTMP/ablak.txt"
if [[ -f "$ablak" ]];then
echo "" > "$ablak"
else
touch "$ablak"
fi
if [[ -f "$ablakf" ]];then
echo "" > "$ablakf"
else
touch "$ablakf"
fi
if [[ "$(pgrep pulseaudio)" ]] || [[ "$(pgrep pipewire-pulse)" ]];then
ffmpeg -hide_banner -sources pulse | grep -v "^A" | sed 's/\* / / ; s/^/pulse:/' > "$NOSTMP"/audio_card_list
else
DEVS="$(ffmpeg -hide_banner -sources alsa | grep -v "^A" | sed 's/^/alsa:/')"
grep default: -m1 <<< "$DEVS" > "$NOSTMP"/audio_card_list
echo "$DEVS" >> "$NOSTMP"/audio_card_list
fi
if [[ ! -f "$NOSTMP/func.sh" ]];then
echo "#!/bin/bash
export PATHPROG01=\"\$PATHPROG01\"
export PATHPROG02=\"\$PATHPROG02\"
export PATHPROG03=\"\$PATHPROG03\"
export PATHPROG04=\"\$PATHPROG04\"
export filsizz=\"\$filsizz\"
export display=\"\$display\"
export frame_rate=\"\$frame_rate\"
export video_bitrate=\"\$video_bitrate\"
export audio_bitrate=\"\$audio_bitrate\"
export HTVP2=\"\$HTVP2\"
export HTVP1=\"\$HTVP1\"
export iffile=\"\$iffile\"
export ablak=\"\$ablak\"
export ablakf=\"\$ablakf\"
export SR_AUDIO_CARD=\"\$SR_AUDIO_CARD\"
export SOSE=\"\${SR_AUDIO_CARD%%:*}\" # SOund SErver xD
export SODEV=\"\$(cut -f3 -d' ' <<< \"\$SR_AUDIO_CARD\")\" # Sound device
fos (){
#sert=\$(xwininfo -frame | grep \"Corners\" | tr -d '\n' | sed 's/ Corners: //' | cut -f-4 -d' ' | tr -d ' '| sed 's/+/\,/2')
sert=\$(xwininfo -frame | grep \"Cor\|Wid\|He\" | tr -d '\n' | sed 's/h:/\n/ ; s/Height:/x/ ; s/ / /g ; s/ Corners: //' | cut -f-4 -d' ' | tr -d ' ' | sed 1d | sed 's/+/\,/2')
echo \":0.0+\$(echo \${sert} | cut -f2- -d'+')\" > \"\$ablak\"
echo \"\${sert}\" | cut -f1 -d'+' > \"\$ablakf\"
#rxvt --hold -e echo \$(xwininfo -frame | grep 'geometry\|Corners' | cut -f1- -d 'y')
#printf \" \n\"
}
tosr(){
roadrunner=
roadrunner=\"\"
if [[ \"\$iffile\" == \"\" ]] || [[ \"\$iffile\" == \"0\" ]] || [[ ! \"\$iffile\" ]];then
#ififfile
if [[ \"\$HTVP1\" == true ]];then
#ifHTVP1
if [[ ! \"\$PATHPROG02\" ]] || [[ \"\$PATHPROG02\" == \"0\" ]] || [[ ! \"\$filsizz\" ]] || [[ \"\$filsizz\" == \"0\" ]]; then
#if_pathprog02_or_filsizz
xmessage -title \"Something Wrong\" -buttons Ok:0,Cancel:1 -default Ok -nearmouse \"No value given!\" &
else
#else_pathprog02_or_filsizz
if [[ \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG04\" == \"0\" ]] || [[ \"\$PATHPROG04\" == \"\" ]] || [[ ! \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG03\" ]] && [[ \"\$PATHPROG03\" != \"0\" ]];then
#only video screen stream with cvlc broadcast
ffmpeg -y -hwaccel auto -s \${PATHPROG01} -thread_queue_size \${PATHPROG02} -framerate \${frame_rate} -f x11grab -i \${display} -vcodec \${PATHPROG03} -vb \${video_bitrate} -pix_fmt yuv420p -flags unaligned -f mpegts udp://\${filsizz}?pkt_size=1316 &
export loadrunner=\$!
cvlc -vvv udp://@\${filsizz} --sout '#transcode {scodec=none}:std{access=http,mux=ts,dst=0.0.0.0:12000/}' :sout-all :sout-keep &
export loadvlc=\$!
echo \"v\"
else
if [[ \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG04\" != \"0\" ]] || [[ \"\$PATHPROG04\" != \"\" ]] && [[ \"\$PATHPROG03\" ]] && [[ \"\$PATHPROG03\" != \"0\" ]] || [[ \"\$PATHPROG03\" != \"\" ]];then
ffmpeg -y -hwaccel auto -s \${PATHPROG01} -thread_queue_size \${PATHPROG02} -framerate \${frame_rate} -f x11grab -i \${display} -f \${SOSE} -thread_queue_size \${PATHPROG02} -ar 44100 -i \${SODEV} -ac 2 -vcodec \${PATHPROG03} -vb \${video_bitrate} -acodec \${PATHPROG04} -ab \${audio_bitrate} -pix_fmt yuv420p -flags unaligned -f mpegts udp://\${filsizz}?pkt_size=1316 &
export loadrunner=\$!
cvlc -vvv udp://@\${filsizz} --sout '#transcode {scodec=none}:std{access=http,mux=ts,dst=0.0.0.0:12000/}' :sout-all :sout-keep &
export loadvlc=\$!
echo \"av\"
else
#cvlc -vvv alsa://default --sout '#transcode {acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=http,mux=mp3,dst=0.0.0.0:12000/}' :sout-all :sout-keep &
ffmpeg -y -f \${SOSE} -thread_queue_size \${PATHPROG02} -ar 44100 -i \${SODEV} -ac 2 -acodec \${PATHPROG04} -ab \${audio_bitrate} -f mpegts udp://\${filsizz}?pkt_size=1316 &
export loadrunner=\$!
cvlc -vvv udp://@\${filsizz} --sout '#transcode {scodec=none}:std{access=http,mux=ts,dst=0.0.0.0:12000/}' :sout-all :sout-keep &
export loadvlc=\$!
echo \"a\"
fi
fi
#fi_of_filsizz_and_pathprog02
#fofeltetel
sleep 3
sleep 6
if ps -p \$loadvlc > /dev/null
then
vlfc=\"\"
vlfc=\"OK\"
else
#fofeltetel else
echo \"nincs vfrcvlc\"
xmessage -title \"Something Wrong\" -buttons Ok:0,Cancel:1 -default Ok -nearmouse \"cvlc broadcast does not started or cvlc command does not exists!\" &
fi
#fofeltetel fi
sleep 6
if ps -p \$loadrunner > /dev/null
then
if [[ \"\$vlfc\" == \"OK\" ]];then
ICONSETSGUI8=\"\"
ICONSETSGUI8='
<text>
<label>nothing</label>
<input>ps -p \$loadvlc</input>
<variable>nocsakdokku</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokku</action>
</timer>
<button>
<label>STOP: cvlc stream</label>
<action>exec kill -15 \$loadvlc</action>
</button>
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdokukh</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokukh</action>
</timer>
<button>
<label>STOP: ffmpeg felvétel</label>
<action>exec kill -15 \$loadrunner</action>
</button>
'
ICONSETSGUI9=\"\"
ICONSETSGUI9='
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdokuk</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokuk</action>
</timer>
<button>
<label>STOP: ffmpeg felvétel</label>
<action>sleep 6 && kill -15 \$loadrunner &</action>
</button>
<text>
<label>nothing</label>
<input>ps -p \$loadvlc</input>
<variable>nocsakdokku</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokku</action>
</timer>
<button>
<label>STOP: cvlc stream</label>
<action>sleep 6 && kill -15 \$loadvlc &</action>
</button>
'
if [[ \"\$PATHPROG03\" == \"h264\" ]] || [[ \"\$PATHPROG03\" == \"libx264\" ]];then
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI9}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
else
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI8}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
fi
else
ICONSETSGUI8=\"\"
ICONSETSGUI8='
<vbox>
<hbox>
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdokk</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokk</action>
</timer>
<button>
<label>STOP: ffmpeg record</label>
<action>exec kill -15 \$loadrunner</action>
</button>
</hbox>
</vbox>
'
ICONSETSGUI9=\"\"
ICONSETSGUI9='
<vbox>
<hbox>
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdookk</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdookk</action>
</timer>
<button>
<label>STOP: ffmpeg felvétel</label>
<action>sleep 6 && kill -15 \$loadrunner &</action>
</button>
</hbox>
</vbox>
'
if [[ \"\$PATHPROG03\" == \"h264\" ]] || [[ \"\$PATHPROG03\" == \"libx264\" ]];then
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI9}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
else
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI8}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
fi
fi
else
echo \"not run\"
xmessage -title \"Something Wrong\" -buttons Ok:0,Cancel:1 -default Ok -nearmouse \"cvlc broadcast does not started!\" &
fi
fi
elif [[ \"\$HTVP2\" == true ]];then
#elifHTVP2
#ittartok
if [[ ! \"\$PATHPROG02\" ]] || [[ \"\$PATHPROG02\" == \"0\" ]] || [[ ! \"\$filsizz\" ]] || [[ \"\$filsizz\" == \"0\" ]]; then
#if_pathprog02_or_filsizz
xmessage -title \"Something Wrong\" -buttons Ok:0,Cancel:1 -default Ok -nearmouse \"No value given!\" &
else
#else_pathprog02_or_filsizz
if [[ \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG04\" == \"0\" ]] || [[ \"\$PATHPROG04\" == \"\" ]] || [[ ! \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG03\" ]] && [[ \"\$PATHPROG03\" != \"0\" ]];then
#only video screen stream with cvlc broadcast
ffmpeg -y -hwaccel auto -s \${PATHPROG01} -thread_queue_size \${PATHPROG02} -framerate \${frame_rate} -f x11grab -i \${display} -vcodec \${PATHPROG03} -vb \${video_bitrate} -pix_fmt yuv420p -flags unaligned -f mpegts udp://\${filsizz}?pkt_size=1316 &
export loadrunner=\$!
echo \"v\"
else
if [[ \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG04\" != \"0\" ]] || [[ \"\$PATHPROG04\" != \"\" ]] && [[ \"\$PATHPROG03\" ]] && [[ \"\$PATHPROG03\" != \"0\" ]] || [[ \"\$PATHPROG03\" != \"\" ]];then
ffmpeg -y -hwaccel auto -s \${PATHPROG01} -thread_queue_size \${PATHPROG02} -framerate \${frame_rate} -f x11grab -i \${display} -f \${SOSE} -thread_queue_size \${PATHPROG02} -ar 44100 -i \${SODEV} -ac 2 -vcodec \${PATHPROG03} -vb \${video_bitrate} -acodec \${PATHPROG04} -ab \${audio_bitrate} -pix_fmt yuv420p -flags unaligned -f mpegts udp://\${filsizz}?pkt_size=1316 &
export loadrunner=\$!
echo \"av\"
else
#roadrunner=\"cvlc -vvv alsa://default --sout '#transcode {acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=http,mux=mp3,dst=0.0.0.0:12000/}'\"
ffmpeg -y -f \${SOSE} -thread_queue_size \${PATHPROG02} -ar 44100 -i \${SODEV} -ac 2 -acodec \${PATHPROG04} -ab \${audio_bitrate} -f mpegts udp://\${filsizz}?pkt_size=1316 &s
export loadrunner=\$!
echo \"a\"
fi
fi
#fi_of_filsizz_and_pathprog02
#fofeltetel fi
sleep 6
if ps -p \$loadrunner > /dev/null
then
ICONSETSGUI8=\"\"
ICONSETSGUI8='
<vbox>
<hbox>
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdokk</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokk</action>
</timer>
<button>
<label>STOP: ffmpeg record</label>
<action>exec kill -15 \$loadrunner</action>
</button>
</hbox>
</vbox>
'
ICONSETSGUI9=\"\"
ICONSETSGUI9='
<vbox>
<hbox>
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdookk</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdookk</action>
</timer>
<button>
<label>STOP: ffmpeg felvétel</label>
<action>sleep 6 && kill -15 \$loadrunner &</action>
</button>
</hbox>
</vbox>
'
if [[ \"\$PATHPROG03\" == \"h264\" ]] || [[ \"\$PATHPROG03\" == \"libx264\" ]];then
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI9}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
else
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI8}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
fi
else
echo \"not run\"
xmessage -title \"Something Wrong\" -buttons Ok:0,Cancel:1 -default Ok -nearmouse \"ffmpeg multicast does not started!\" &
fi
fi
#eddigtartok
else
#elseHTVP
echo \"HTVP else\"
fi
#fiHTVP
else
#elseofiffile
if [[ \"\$HTVP1\" == true ]];then
#ifHTVP1
if [[ ! \"\$PATHPROG02\" ]] || [[ \"\$PATHPROG02\" == \"0\" ]] || [[ ! \"\$filsizz\" ]] || [[ \"\$filsizz\" == \"0\" ]]; then
#if_pathprog02_or_filsizz
xmessage -title \"Something Wrong\" -buttons Ok:0,Cancel:1 -default Ok -nearmouse \"No value given!\" &
else
#else_pathprog02_or_filsizz
if [[ \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG04\" == \"0\" ]] || [[ \"\$PATHPROG04\" == \"\" ]] || [[ ! \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG03\" ]] && [[ \"\$PATHPROG03\" != \"0\" ]];then
#only video screen stream with cvlc broadcast
ffmpeg -y -hwaccel auto -thread_queue_size \${PATHPROG02} -re -i \"\${iffile}\" -f mpegts udp://\${filsizz}?pkt_size=1316 &
export loadrunner=\$!
cvlc -vvv udp://@\${filsizz} --sout '#transcode {scodec=none}:std{access=http,mux=ts,dst=0.0.0.0:12000/}' :sout-all :sout-keep &
export loadvlc=\$!
echo \"v\"
else
if [[ \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG04\" != \"0\" ]] || [[ \"\$PATHPROG04\" != \"\" ]] && [[ \"\$PATHPROG03\" ]] && [[ \"\$PATHPROG03\" != \"0\" ]] || [[ \"\$PATHPROG03\" != \"\" ]];then
ffmpeg -y -hwaccel auto -thread_queue_size \${PATHPROG02} -re -i \"\${iffile}\" -f mpegts udp://\${filsizz}?pkt_size=1316 &
export loadrunner=\$!
cvlc -vvv udp://@\${filsizz} --sout '#transcode {scodec=none}:std{access=http,mux=ts,dst=0.0.0.0:12000/}' :sout-all :sout-keep &
export loadvlc=\$!
echo \"av\"
else
cvlc -vvv \"\${iffile}\" --sout '#transcode {acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=http,mux=mp3,dst=0.0.0.0:12000/}' :sout-all :sout-keep &
export loadrunner=\$!
echo \"a\"
fi
fi
#fi_of_filsizz_and_pathprog02
#fofeltetel
sleep 3
sleep 6
if ps -p \$loadvlc > /dev/null
then
vlfc=\"\"
vlfc=\"OK\"
else
#fofeltetel else
echo \"nincs vfrcvlc\"
xmessage -title \"Something Wrong\" -buttons Ok:0,Cancel:1 -default Ok -nearmouse \"cvlc broadcast does not started or cvlc command does not exists!\" &
fi
#fofeltetel fi
sleep 6
if ps -p \$loadrunner > /dev/null
then
if [[ \"\$vlfc\" == \"OK\" ]];then
ICONSETSGUI8=\"\"
ICONSETSGUI8='
<text>
<label>nothing</label>
<input>ps -p \$loadvlc</input>
<variable>nocsakdokku</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokku</action>
</timer>
<button>
<label>STOP: cvlc stream</label>
<action>exec kill -15 \$loadvlc</action>
</button>
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdokukh</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokukh</action>
</timer>
<button>
<label>STOP: ffmpeg felvétel</label>
<action>exec kill -15 \$loadrunner</action>
</button>
'
ICONSETSGUI9=\"\"
ICONSETSGUI9='
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdokuk</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokuk</action>
</timer>
<button>
<label>STOP: ffmpeg felvétel</label>
<action>sleep 6 && kill -15 \$loadrunner &</action>
</button>
<text>
<label>nothing</label>
<input>ps -p \$loadvlc</input>
<variable>nocsakdokku</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokku</action>
</timer>
<button>
<label>STOP: cvlc stream</label>
<action>sleep 6 && kill -15 \$loadvlc &</action>
</button>
'
if [[ \"\$PATHPROG03\" == \"h264\" ]] || [[ \"\$PATHPROG03\" == \"libx264\" ]];then
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI9}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
else
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI8}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
fi
else
ICONSETSGUI8=\"\"
ICONSETSGUI8='
<vbox>
<hbox>
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdokk</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokk</action>
</timer>
<button>
<label>STOP: ffmpeg record</label>
<action>exec kill -15 \$loadrunner</action>
</button>
</hbox>
</vbox>
'
ICONSETSGUI9=\"\"
ICONSETSGUI9='
<vbox>
<hbox>
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdookk</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdookk</action>
</timer>
<button>
<label>STOP: ffmpeg felvétel</label>
<action>sleep 6 && kill -15 \$loadrunner &</action>
</button>
</hbox>
</vbox>
'
if [[ \"\$PATHPROG03\" == \"h264\" ]] || [[ \"\$PATHPROG03\" == \"libx264\" ]];then
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI9}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
else
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI8}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
fi
fi
else
echo \"not run\"
xmessage -title \"Something Wrong\" -buttons Ok:0,Cancel:1 -default Ok -nearmouse \"cvlc broadcast does not started!\" &
fi
fi
elif [[ \"\$HTVP2\" == true ]];then
#elifHTVP2
#ittartokccc
if [[ ! \"\$PATHPROG02\" ]] || [[ \"\$PATHPROG02\" == \"0\" ]] || [[ ! \"\$filsizz\" ]] || [[ \"\$filsizz\" == \"0\" ]]; then
#if_pathprog02_or_filsizz
xmessage -title \"Something Wrong\" -buttons Ok:0,Cancel:1 -default Ok -nearmouse \"No value given!\" &
else
#else_pathprog02_or_filsizz
if [[ \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG04\" == \"0\" ]] || [[ \"\$PATHPROG04\" == \"\" ]] || [[ ! \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG03\" ]] && [[ \"\$PATHPROG03\" != \"0\" ]];then
#only video screen stream with cvlc broadcast
ffmpeg -y -hwaccel auto -thread_queue_size \${PATHPROG02} -re -i \${iffile} -f mpegts udp://\${filsizz}?pkt_size=1316 &
export loadrunner=\$!
echo \"v\"
else
if [[ \"\$PATHPROG04\" ]] && [[ \"\$PATHPROG04\" != \"0\" ]] || [[ \"\$PATHPROG04\" != \"\" ]] && [[ \"\$PATHPROG03\" ]] && [[ \"\$PATHPROG03\" != \"0\" ]] || [[ \"\$PATHPROG03\" != \"\" ]];then
ffmpeg -y -hwaccel auto -thread_queue_size \${PATHPROG02} -re -i \${iffile} -f mpegts udp://\${filsizz}?pkt_size=1316 &
export loadrunner=\$!
echo \"av\"
else
#roadrunner=\"cvlc -vvv alsa://default --sout '#transcode {acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=http,mux=mp3,dst=0.0.0.0:12000/}'\"
ffmpeg -y -hwaccel auto -thread_queue_size \${PATHPROG02} -re -i \${iffile} -f mpegts udp://\${filsizz}?pkt_size=1316 &
export loadrunner=\$!
echo \"a\"
fi
fi
#fi_of_filsizz_and_pathprog02
#fofeltetel fi
sleep 6
if ps -p \$loadrunner > /dev/null
then
ICONSETSGUI8=\"\"
ICONSETSGUI8='
<vbox>
<hbox>
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdokk</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdokk</action>
</timer>
<button>
<label>STOP: ffmpeg record</label>
<action>exec kill -15 \$loadrunner</action>
</button>
</hbox>
</vbox>
'
ICONSETSGUI9=\"\"
ICONSETSGUI9='
<vbox>
<hbox>
<text>
<label>nothing</label>
<input>ps -p \$loadrunner</input>
<variable>nocsakdookk</variable>
</text>
<timer milliseconds=\"true\" interval=\"3000\" visible=\"false\">
<action>refresh:nocsakdookk</action>
</timer>
<button>
<label>STOP: ffmpeg felvétel</label>
<action>sleep 6 && kill -15 \$loadrunner &</action>
</button>
</hbox>
</vbox>
'
if [[ \"\$PATHPROG03\" == \"h264\" ]] || [[ \"\$PATHPROG03\" == \"libx264\" ]];then
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI9}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
else
export MAIN_DIALOG='
<window title=\"Screen Streamer - Stop\" icon-name=\"gtk-disconnect\" resizable=\"true\">
<vbox>
<frame Functions:>
<text wrap=\"true\" width-chars=\"40\"><label>Stop Recording</label></text>
</frame>
<frame Running process:>
'\"\${ICONSETSGUI8}\"'
<text>
<label>-1-</label>
</text>
</frame>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>QUIT</label></button>
</hbox>
</vbox>
</window>'
gtkdialog --program=MAIN_DIALOG --center &
fi
else
echo \"not run\"
xmessage -title \"Something Wrong\" -buttons Ok:0,Cancel:1 -default Ok -nearmouse \"ffmpeg multicast does not started!\" &
fi
fi
#eddigtartok
else
#elseHTVP
echo \"HTVP else\"
fi
#fiHTVP
fi
#iffilefi
}
if [[ \"\$1\" == \"fos\" ]];then
fos
elif [[ \"\$1\" == \"tosr\" ]];then
tosr
else
echo \"BaD\"
fi
" > "$NOSTMP"/func.sh && chmod +x "$NOSTMP"/func.sh
else
echo "van"
fi
#export novik="$(date +'%Y_%m_%d-%H-%M-%S')"
if [[ "$(which cvlc)" != "" ]];then
echo "cvlc found"
xmessage -title "cvlc check" -buttons Ok:0,Cancel:1 -default Ok -nearmouse "cvlc:
FOUND!
" -timeout 5 &
else
vfrcvlc=""
fi
DEF=""
[[ "$1" ]]&& DEF="<default>$1</default>"
export MAIN_DIALOG='
<window title="Screen or File Streamer - ffmpeg - nocsak" icon-name="folder-remote" resizable="true" width-request="400">
<vbox>
<frame File>
<hbox homogeneous="true">
<entry space-expand="false" space-fill="false">
'"${DEF}"'
<variable>iffile</variable>
</entry>
<button>
<label>Open File for stream</label>
<input file stock="gtk-open"></input>
<action>fileselect:iffile</action>
</button>
</hbox>
</frame>
<frame Resolution and thread_queue_size>
<hbox homogeneous="true" tooltip-text="Resolution">
<entry auto-refresh="true" space-expand="false" space-fill="false" editable="false"><default>'$cucf'</default><input file>'$ablakf'</input>
<variable>PATHPROG01</variable>
</entry>
<entry space-expand="false" space-fill="false">
<default>16M</default>
<variable>PATHPROG02</variable>
</entry>
</hbox>
</frame>
<frame display and position:>
<hbox homogeneous="true" tooltip-text="window">
<entry auto-refresh="true" editable="false" space-expand="false" space-fill="false"><default>:0.0+0,0</default><input file>'$ablak'</input>
<variable>display</variable>
</entry>
<button><action>'$NOSTMP'/func.sh fos &</action><label>window</label></button>
</hbox>
</frame>
<frame vcodec acodec:>
<hbox homogeneous="true">
<entry tooltip-text="'$videocodecs'">
<default>mpeg2video</default>
<variable>PATHPROG03</variable>
</entry>
<entry tooltip-text="'$audiocodecs'">
<default>libmp3lame</default>
<variable>PATHPROG04</variable>
</entry>
</hbox>
</frame>
<frame choices to stream>
<radiobutton active="true">
<label>ffmpeg multicast with cvlc broadcast</label>
<variable>HTVP1</variable>
</radiobutton>
<radiobutton>
<label>ffmpeg multicast only</label>
<variable>HTVP2</variable>
</radiobutton>
</frame>
<frame UDP IP address:portnumber http cvlc port is 12000>
<entry>
<default>'$ipcim':11000</default>
<variable>filsizz</variable>
</entry>
</frame>
<frame Sound>
<comboboxtext width-request="100" tooltip-text="Chooseable soundcards">
<variable>SR_AUDIO_CARD</variable> <input file>'$NOSTMP'/audio_card_list</input>
</comboboxtext>
</frame>
<frame killall ffmpeg and vlc>
<hbox>
<timer interval="1" visible="false">
<action condition="command_is_true([ ! -z $(pidof ffmpeg) ]&& echo true)">enable:ffmpeget</action>
<action condition="command_is_true([ -z $(pidof ffmpeg) ]&& echo true)">disable:ffmpeget</action>
</timer>
<timer interval="1" visible="false">
<action condition="command_is_true([ ! -z $(pidof vlc) ]&& echo true)">enable:vlct</action>
<action condition="command_is_true([ -z $(pidof vlc) ]&& echo true)">disable:vlct</action>
</timer>
</hbox>
<button>
<label>killall ffmpeg</label>
<action>killall -9 ffmpeg</action>
<variable>ffmpeget</variable>
</button>
<button>
<label>killall vlc</label>
<action>killall -9 vlc</action>
<variable>vlct</variable>
</button>
</frame>
<hbox homogeneous="true">
<button><label>START</label><action>'$NOSTMP'/func.sh tosr &</action></button>
<togglebutton><input file stock="gtk-quit"></input><label>Quit</label><input>exit 1</input><action>exit:abort</action><default>true</default><variable>pagg</variable></togglebutton>
</hbox>
</vbox>
</window>
'
RETSTRING="$(gtkdialog --program=MAIN_DIALOG --center)"
eval "$RETSTRING"
if [[ "$pagg" = true ]]; then
echo "nothing"
else
exit 1
fi
exit 0
- nostreamer.gif (528.59 KiB) Viewed 1411 times
-------
2nd: dbmW.sh
Code: Select all
#!/bin/bash
export LANG=C
export LC_NUMERIC=C
export OUTPUT_CHARSET=UTF-8
if [[ ! -f "/tmp/cukik.txt" ]];then
touch "/tmp/cukik.txt"
else
echo "ok"
fi
cat << 'EOF' > "/tmp/FuF.sh" && chmod +x "/tmp/FuF.sh"
#!/bin/bash
funcelso(){
if [[ "$cuki" -lt "1000" ]];then
ans="$(echo "scale=10;1*e(($cuki/10)*l(10))*1" | bc -l | awk '{printf "%f", $0}')"
echo "$ans" > /tmp/cukik.txt
else
echo "OverDose" > /tmp/cukik.txt
fi
}
funck(){
fans="$(echo "scale=10;1*((l($cukix)/l(10)*10))*1" | bc -l | awk '{printf "%f", $0}')"
echo "$fans" > /tmp/cukik.txt
}
if [[ "$1" == "ablak" ]];then
funcelso "$@"
elif [[ "$1" == "ajto" ]];then
funck "$@"
else
echo "nem"
fi
EOF
export MAIN_DIALOG='
<window title="mW and dBm conversion" allow-shrink="true" icon-name="gtk-select-color">
<vbox>
<frame dBm to mW>
<entry>
<variable>cuki</variable>
<action type="refresh">cukik</action>
<action>/tmp/FuF.sh ablak</action>
</entry>
</frame>
<frame result>
<entry auto-refresh="true">
<variable>cukik</variable>
<input file>/tmp/cukik.txt</input>
</entry>
</frame>
<frame mW to dBm>
<entry auto-refresh="true">
<variable>cukix</variable>
<action>/tmp/FuF.sh ajto</action>
</entry>
</frame>
<hbox>
<button ok></button>
<button cancel></button>
</hbox>
</vbox>
</window>
'
gtkdialog --program=MAIN_DIALOG
rm /tmp/FuF.sh
rm /tmp/cukik.txt
- dBm_mW.gif (115.52 KiB) Viewed 1411 times
The 1st script is a Desktop or file streamer over ffmpeg multicast and cvlc broadcast capabilities. This gtkdialog script's main deps are: ffmpeg, x11-utils, xmessage, wmctrl, gtkdialog and vlc and cvlc mostly run on the rest of puppy linuxes and or MX and antix derivatives or on those Devuan and or Debian systems which matches with the earilier listed deps.
If file given then file will be streamed, if this field is blank then the mic and the entire screen will be streamed. If both video and audio codec entries are given, then AuidoVideo stream will be started, if only one of them isn't blank then that given codec audio or video will start only, and if mouse hovering over the codecs' fields then tooltip will appear with the available ffmpeg codecs over both fields audio and video. Any further combinations are depends on the user. For example if only ffmpeg multicast are given, then the address beginning at the IP address with (at) sign
if it will be streamed over another machine, it is possible with this syntax. And of course with the correct steps over http stream in VLC.
In this case the multicast target IP address must be the streamer PC's IP address, and as the above exmaple shows, the udp ip which will be streamed over the Streamer PC with (at) sign before the IP address, with Streaming steps over the streamer machine's VLC. Do not forget to Port Forward the streamer PC-s LAN IP and port number on the correct way, to let it public over the World Wide Web. Do not forget the script is streaming it over http if clvc was a choosen option.
Every cvlc stream is over http and port 12000
Every udp multicast stream with ffmpeg can be modified in the field. If you edit the shell script you can choose these presets at the top:
Code: Select all
export frame_rate="5"
export video_bitrate="1900k"
export audio_bitrate="96k"
Enjoy!
2nd script is a gtkdialog shell script which is for calculate between mW and dBm with. This version is the newest, and corrected.
Enjoy!