A
A
Alexander Belyakov2016-01-29 21:52:04
Nginx
Alexander Belyakov, 2016-01-29 21:52:04

exec ffmpeg is not running. What is the reason?

The nginx + rtmp-module + ffmpeg build has the following applications:

application live {
                  live on;
                  exec ffmpeg -i rtmp://localhost/live/$name -filter_complex "[0:v] crop=640:380:0:0" -f flv -y rtmp://localhost/eur/$name;
                  record off;
}

application eur {
                 live on;
                 hls on;
                 hls_path /tmp/eur;
                 hls_fragment 5s;
                 record off;
}

With this ffmpeg command, when viewing rtmp://ipaddress/eur, there is a black screen. And if you replace this command with any other, for example, simpler:
exec ffmpeg -i rtmp://localhost/live/$name -c copy -f flv rtmp://localhost/eur/$name;

everything works fine and rtmp://ipaddress/eur is broadcast from /live. However, this does not suit me. I need to cut sometimes. Actually the question is: where did I make a mistake in the filter or why does it not work?
PS: I'm not good at ffmpeg. Like on the documentation and examples I do.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Belyakov, 2016-02-01
@parce56

The problem was solved! The reason lay in the settings of the OBS video encoder and the audio stream parameters. In order for everything to work properly, you need to change the audio frequency to 44100 Hz. Oddly enough, it helped. Another launch of ffmpeg'a must be performed from the config. Testing through the console does not give any results at all. Writes immediate exit requested. And yes, of course, the crop command itself.

exec ffmpeg -i rtmp://localhost/live/$name -filter:v "crop=640:360:0:0" -r 16 -c:a copy -f flv rtmp:/localhost/eur/$name;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question