arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.36k stars 3.51k forks source link

on_record_done is not working #1539

Open VirenderGurgaon opened 4 years ago

VirenderGurgaon commented 4 years ago

Here are config parameters -- on_publish is working fine but not on_record_done .. Please advise, if any change required. A sample php program and configuration will be great help. rtmp { server { listen 1935; chunk_size 4096; notify_method get;

            application live {
                         live on;
                         hls on;
                         hls_path /var/www/findsetgo.in/web/FindSetGo2/fsg_contents/medias/liveStream/;
                         hls_fragment 10;
                         hls_playlist_length 60;
                         on_publish http://www.findsetgo.in/FindSetGo2/fsg_site/coach/fsg_liveVerify.php;

                            #Set this to "record off" if you don't want to save a copy of your broadcasts
                         # The directory in which the recordings will be stored

                            record all;
                            record_path /var/www/findsetgo.in/web/FindSetGo2/fsg_contents/medias/recordings/;
                            record_unique off;
                            record_suffix _%d-%b-%y_%H-%M.flv;
                        #exec_record_done ffmpeg -i $path -c copy $dirname/test.flv;
                        #exec_record_done http://www.findsetgo.in/FindSetGo2/fsg_site/coach/fsg_updateRecord.php;
                        on_record_done http://www.findsetgo.in/FindSetGo2/fsg_site/coach/fsg_updateRecord.php;
            }
    }

}

my PHP Snippet if (!isset($oLearnings)) $oLearnings = new learning();

if (!empty($_GET['name'])) $nameVal=$_GET['name'];

if (!empty($_GET['fsg_key'])) $fsgKey=$_GET['fsg_key'];

//print "Get data---".$nameVal." ".$fsgKey; if (empty($nameVal)) { $nameVal=302; $fileN="302-empty.flv"; } else $fileN="302.flv";

if (empty($fsgKey)) $fsgKey='56e4f';

print "Going to DB"; $retVerify=$oLearnings->updateStream($nameVal,$fsgKey,$fileN);

rhummelmose commented 3 years ago

Have the same issue, any progress?

rhummelmose commented 3 years ago

Have the same issue, any progress?

My issue was that the folder has to exist in advance, otherwise in the debug log it just says that it tries to open the folder but nothing then happens - no error. When it doesn't have write permissions however, it does output an error.

Hope this can help others who come around with the same issue :)