2018-06-02, 16:36
(2018-05-31, 19:28)el_gonz87 Wrote:Hi, i've found cause of the issue. Is not FFMPEG problem - problem is in:(2018-05-31, 16:15)Mr Groch Wrote: I have changed this line:I think this is an FFMPEG issue. It may be due to the -v copy parameters, maybe it does not create timestamps appropriately. The fact FFPROBE detects a duration of 0 makes me think the FLV file doesn't have the appropriate data to get a duration. Have you tried actually remuxing? using a video codec and audio codec?
https://github.com/gonzalo-hvega/pvr.ipt...d.cpp#L272
To:
cpp:strParams = strParams + " --"+lineVect[0]+"="+lineVect[1];
And recrding of rtmp streams is now working. So I can confirm that problem is with too many " chars
Now I have problem with duration of those recordings, ffprobe says that duration is 00:00:00. I have tried adding --use_wallclock_as_timestamps 1 -fflags +genpts to output parameters but with no luck...
I must admit I was not able to test rtmp streams as I have none.
https://github.com/gonzalo-hvega/pvr.ipt...d.cpp#L399
ffmpeg in exec_stream_t can't properly exit when executing e_Stream.close(); so it is killed after. The solution is to clean exit ffmpeg - then duration and any other metadata is fine.
My working and tested proposition is in this diff of PVRRecorderThread.cpp file:
diff:@@ -352,6 +352,7 @@ void *PVRRecorderThread:rocess(void)
e_Stream.set_binary_mode(exec_stream_t:_out);
e_Stream.set_wait_timeout(exec_stream_t:_in, g_iStrmTimeout*1000);
e_Stream.set_wait_timeout(exec_stream_t:_out, g_iStrmTimeout*1000);
+ e_Stream.set_wait_timeout(exec_stream_t:_child, g_iStrmTimeout*1000);
e_Stream.start(g_strFFMPEG, strParams);
XBMC->Log(LOG_NOTICE, "Set stream timeout: %d", g_iStrmTimeout);
@@ -395,9 +396,15 @@ void *PVRRecorderThread:rocess(void)
if (nowTimer.Timer.endTime<time(NULL) || nowTimer.Status == PVR_STREAM_IS_STOPPING || nowTimer.Status == PVR_STREAM_STOPPED || nowTimer.bIsDeleted == true)
{
// recording stopped
- e_Stream.close();
- e_Stream.kill();
-
+ // send "q" to ffmpeg for clean exit
+ e_Stream.in() << "q";
+ e_Stream.close_in();
+ if (!e_Stream.close())
+ {
+ e_Stream.kill();
+ XBMC->Log(LOG_NOTICE, "Record command failed to close, killing");
+ }
+
XBMC->Log(LOG_NOTICE, "Recording stopped %s", nowTimer.Timer.strTitle);
// correct duration time & add to cache
@@ -459,9 +466,15 @@ void *PVRRecorderThread:rocess(void)
else if (now-lastRead>=g_iStrmTimeout)
{
// something wrong - data not growing
- e_Stream.close();
- e_Stream.kill();
-
+ // send "q" to ffmpeg for clean exit
+ e_Stream.in() << "q";
+ e_Stream.close_in();
+ if (!e_Stream.close())
+ {
+ e_Stream.kill();
+ XBMC->Log(LOG_NOTICE, "Record command failed to close, killing");
+ }
+
XBMC->Log(LOG_NOTICE, "Recording failed %s", nowTimer.Timer.strTitle);
// correct duration time & add to cache