I am trying to control RTT channel channels in real time using powershell and rtmpdump. the streams that I want to track are saved in the "streams.txt" file, which follows the csv format.
Name,feed,file tv1,rtmp://server/live/tv1,tv1.flv tv2,rtmp://server/live/tv1,tv2.flv tv3,rtmp://server/live/tv1,tv3.flv tv4,rtmp://server/live/tv1,tv4.flv
After importing the csv file and converting the data into objects, I move each object and using the feed property, I run the rmtpdump command after this process works, the rest of powershell is stopped.
to decide that I am trying to use a timer, but even they do not solve my problem when rtmpdump captures the first channel inside the loop.
Register-ObjectEvent -InputObject $timer -EventName elapsed –SourceIdentifier thetimer -Action $action $colStats = Import-CSV streams.txt foreach ($objBatter in $colStats) { $timer.start() $objBatter.feed + "," + $objBatter.file .\rtmpdump.exe -r $objBatter.feed -o $objBatter.file }
I need to capture the feed output within 30 seconds of playback, and then kill the rtmpdump process, and in the next iteration of the loop I want to capture the second channel in 30 seconds.
If one thread does not work, it will generate a flv file from 0 bytes, so that later it will receive a notification
source share