A
A
accountnujen2021-10-22 03:50:34
PHP
accountnujen, 2021-10-22 03:50:34

Exec (or ffmpeg) ignores the get parameter. How to make him see?

It's not exactly clear who is to blame, but I can't execute the following command from php:

$url = "rtsp://admin:[email protected]:554/cam/realmonitor?&channel=1&subtype=0";
exec("ffmpeg.exe -rtsp_transport tcp -i $url -c copy -map 0 -t 10 out2.mkv 2>&1", $output, $return_var);
p($output);
p($return_var);

In the answer and in the logs krakozyabry, but in the logs there is also such a line
[rtsp @ 000002891c688400] method OPTIONS failed: 404 Not Found
rtsp://admin:[email protected]:554/cam/realmonitor?subtype=0: Server returned 404 Not Found

And if you swap subtype with channel, then the error will be
[rtsp @ 0000021f3c098400] method DESCRIBE failed: 404 Not Found
rtsp://admin:[email protected]:554/cam/realmonitor?channel=1: Server returned 404 Not Found

. That is, the second GET parameter is not applied,
and there is no access to the stream, because there is really nothing at ...realmonitor?subtype=0.

From the console, everything works for me, BUT there was also a snag with a link and I had to specify it in double quotes (I didn’t accept single quotes)

Shell_exec also tried it - it didn’t help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-10-22
@accountnujen

From the console, everything works for me, BUT there was also a snag with the link and I had to specify it in double quotes (I didn’t accept single quotes)

put them like this:
exec("ffmpeg.exe -rtsp_transport tcp -i \"$url\" -c copy -map 0 -t 10 out2.mkv 2>&1", $output, $return_var);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question