Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > rtmpdump
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 10-17-2012, 01:25 AM
RedPenguin RedPenguin is offline
Member
 
Join Date: Feb 2012
Posts: 85
RedPenguin is on a distinguished road
Default

Killing RTMPsrv/RTMPdump inside Windows


I have successfully created a batch file to open RTMPDumpHelper and browser.

The problem I have is I tried to use taskkill and Cygwin tools to kill rtmpsrv and rtmpdump.

The problem is it apparently only kills rtmpsrv but not the rtmpdump that is started.

I randomly use rtmpdump in other batch files around same time so I can't just try killing any rtmpdump.

Anybody know if there is a way to watch for the exact PID or something, cause only way so far is kill it when I get a chance causing unnecessary extra recording.
Reply With Quote
  #2  
Old 10-17-2012, 08:17 AM
svnpenn svnpenn is offline
Banned
 
Join Date: Apr 2011
Location: Dallas
Posts: 757
svnpenn is on a distinguished road
Default

Re: Killing RTMPsrv/RTMPdump inside Windows


If you get my build of RtmpSrv, you can use the "--printonly" option.

Code:
$ rtmpsrv --help
This is just a stub for an RTMP server. It doesn't do anything beyond
obtaining the connection parameters from the client.

-h, --help              Prints this help screen.
-c, --port port         Overrides the port in the rtmp url
-i, --printonly         Print RtmpDump command and exit
-z, --debug             Debug level command output.
-N, --version           Print version information and exit
github.com/svnpenn/rtmpdump/downloads
Reply With Quote
  #3  
Old 10-23-2012, 05:17 PM
RedPenguin RedPenguin is offline
Member
 
Join Date: Feb 2012
Posts: 85
RedPenguin is on a distinguished road
Default

Re: Killing RTMPsrv/RTMPdump inside Windows


I see how your rtmpsrv works but I'm not quite sure how I can still kill it afterwards.

I mean I still think I would have to find some way to find out exactly which rtmpdump is running for my recording and kill only that one.
Reply With Quote
  #4  
Old 10-23-2012, 05:42 PM
svnpenn svnpenn is offline
Banned
 
Join Date: Apr 2011
Location: Dallas
Posts: 757
svnpenn is on a distinguished road
Default

Re: Killing RTMPsrv/RTMPdump inside Windows


Quote:
Originally Posted by RedPenguin View Post
I see how your rtmpsrv works but I'm not quite sure how I can still kill it afterwards. I mean I still think I would have to find some way to find out exactly which rtmpdump is running for my recording and kill only that one.
It is clear you have misunderstood the "--printonly" option. It does not invoke RtmpDump. Running RtmpSrv with the printonly option merely prints the first RtmpDump command detected and exits.
Reply With Quote
  #5  
Old 10-23-2012, 09:08 PM
RedPenguin RedPenguin is offline
Member
 
Join Date: Feb 2012
Posts: 85
RedPenguin is on a distinguished road
Default

Re: Killing RTMPsrv/RTMPdump inside Windows


Quote:
Originally Posted by svnpenn View Post
It is clear you have misunderstood the "--printonly" option. It does not invoke RtmpDump. Running RtmpSrv with the printonly option merely prints the first RtmpDump command detected and exits.
Well I understand that part but I was temporarily confused on how to kill the rtmpdump I start afterwards with the output.
Reply With Quote
  #6  
Old 10-23-2012, 09:20 PM
svnpenn svnpenn is offline
Banned
 
Join Date: Apr 2011
Location: Dallas
Posts: 757
svnpenn is on a distinguished road
Default

Re: Killing RTMPsrv/RTMPdump inside Windows


Quote:
Well I understand that part but I was temporarily confused on how to kill the rtmpdump I start afterwards with the output.
Cygwin has long known issues with non-Cygwin binaries, AKA RtmpDump. If you want to kill RtmpDump with Cygwin, you need to do one of these

Quote:
# Instead of invoking like this
rtmpdump -o a.flv -r rtmp://server.com/app/playpath
# Invoke like this, then hit Ctrl+C to stop
timeout 1d rtmpdump -o a.flv -r rtmp://server.com/app/playpath

# Set RtmpDump to simply stop after certain time
rtmpdump -o a.flv -r rtmp://server.com/app/playpath -B 10

# Invoke RtmpDump under cmd.exe instead of Bash
rtmpdump -o a.flv -r rtmp://server.com/app/playpath

# Compile RtmpDump as a Cygwin binary instead of Native Windows binary
rtmpdump -o a.flv -r rtmp://server.com/app/playpath

# Kill RtmpDump using Cygwin commands
ps -W | awk /rtmpdump/'{print$4;exit}' | xargs kill -f

# Use Windows Task Manager to kill
rtmpdump.exe
Reply With Quote
  #7  
Old 10-26-2012, 11:26 PM
RedPenguin RedPenguin is offline
Member
 
Join Date: Feb 2012
Posts: 85
RedPenguin is on a distinguished road
Default

Re: Killing RTMPsrv/RTMPdump inside Windows


Thank you so much.

I finally came up with a working idea from your solutions.

I realized with "ps -W" I can find out exactly which rtmpdump is running and kill only the one going to RTMPDumpHelper and not the other one on the system recording other stuff at any given moment.
Reply With Quote
  #8  
Old 10-30-2012, 05:09 PM
hyc hyc is offline
RTMPdump team
 
Join Date: Dec 2009
Posts: 169
hyc will become famous soon enoughhyc will become famous soon enough
Default

Re: Killing RTMPsrv/RTMPdump inside Windows


Quote:
Originally Posted by svnpenn View Post
Cygwin has long known issues with non-Cygwin binaries, AKA RtmpDump. If you want to kill RtmpDump with Cygwin, you need to do one of these
I wrote a fix for this years ago.

http://thread.gmane.org/gmane.comp.g...793/focus=3797

Seems like it may not have been committed, unfortunately.

http://sourceforge.net/tracker/index...&at id=302435
Reply With Quote
  #9  
Old 10-30-2012, 05:55 PM
Woebegone Woebegone is offline
Junior Member
 
Join Date: Oct 2012
Posts: 1
Woebegone is on a distinguished road
Default

Re: Killing RTMPsrv/RTMPdump inside Windows


I use Cygwin as well. I often have multiple streams running, so "ps" doesn't do it for me. I found the following command allows me to pick the right rtmpdump stream to kill:

WMIC.exe PROCESS get CommandLine,ProcessId

I parse out the lines and grep the particular stream I want dead. Then kill -9 on the correct pid works pretty well for me. The only downside is the (partial) stream doesn't get finished, so stream viewers will think it's a live stream. I'm sure a quick trip through ffmpeg would clear that up, though. (I haven't actually tried, cause I throw away the streams I kill.)
Reply With Quote
  #10  
Old 10-30-2012, 06:15 PM
svnpenn svnpenn is offline
Banned
 
Join Date: Apr 2011
Location: Dallas
Posts: 757
svnpenn is on a distinguished road
Default

Re: Killing RTMPsrv/RTMPdump inside Windows


Quote:
Originally Posted by hyc View Post
I wrote a fix for this years ago.

http://thread.gmane.org/gmane.comp.g...793/focus=3797

Seems like it may not have been committed, unfortunately.

http://sourceforge.net/tracker/index...&at id=302435
If you have the gumption, it would do much better on the Cygwin mailing list, not MinGW. For this glaring "error" to be allowed after so many years is telling.
Reply With Quote
Reply Post New Thread
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 07:09 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons