diff mbox

[FFmpeg-devel] lavf/dashenc: Remove global_sidx from movenc params for live streaming.

Message ID 20181128111123.15841-1-andrey.semashev@gmail.com
State New
Headers show

Commit Message

Andrey Semashev Nov. 28, 2018, 11:11 a.m. UTC
The global_sidx flag causes errors like the following in movenc when media
segment removal is enabled via windos_size or remove_at_exit:

Non-consecutive fragments, writing incorrect sidx
Unable to re-open  output file for the second pass (faststart)
---
 libavformat/dashenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeyapal, Karthick Nov. 28, 2018, 4:25 p.m. UTC | #1
On 11/28/18 4:41 PM, Andrey Semashev wrote:
> The global_sidx flag causes errors like the following in movenc when media

> segment removal is enabled via windos_size or remove_at_exit:

>

> Non-consecutive fragments, writing incorrect sidx

> Unable to re-open  output file for the second pass (faststart)

Removing global_sidx flag adds sidx atom to each moof fragment adding significant bitrate overhead. 
Instead I have submitted a patch to handle this case cleanly in movenc. http://ffmpeg.org/pipermail/ffmpeg-devel/2018-November/236873.html
Please try the above patch and let me know if that will work for you. 
> ---

>  libavformat/dashenc.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c

> index 6ce70e0076..cb49641b4e 100644

> --- a/libavformat/dashenc.c

> +++ b/libavformat/dashenc.c

> @@ -1141,7 +1141,7 @@ static int dash_init(AVFormatContext *s)

>  

>          if (os->segment_type == SEGMENT_TYPE_MP4) {

>              if (c->streaming)

> -                av_dict_set(&opts, "movflags", "frag_every_frame+dash+delay_moov+global_sidx", 0);

> +                av_dict_set(&opts, "movflags", "frag_every_frame+dash+delay_moov", 0);

>              else

>                  av_dict_set(&opts, "movflags", "frag_custom+dash+delay_moov", 0);

>          } else {
Andrey Semashev Nov. 29, 2018, 2:58 p.m. UTC | #2
On 11/28/18 7:25 PM, Jeyapal, Karthick wrote:
> 
> On 11/28/18 4:41 PM, Andrey Semashev wrote:
>> The global_sidx flag causes errors like the following in movenc when media
>> segment removal is enabled via windos_size or remove_at_exit:
>>
>> Non-consecutive fragments, writing incorrect sidx
>> Unable to re-open  output file for the second pass (faststart)
> Removing global_sidx flag adds sidx atom to each moof fragment adding significant bitrate overhead.
> Instead I have submitted a patch to handle this case cleanly in movenc. http://ffmpeg.org/pipermail/ffmpeg-devel/2018-November/236873.html
> Please try the above patch and let me know if that will work for you.

Yes, that patch seems to fix the errors. Thanks.

On a slightly unrelated note, during testing, I've also seen different 
errors like these:

[AVFormatContext] Application provided duration: -1 / timestamp: 243456 
is out of range for mov/mp4 format
[AVFormatContext] pts has no value

These happen when media segments are rotated and file deletion is 
enabled. They don't seem to happen on every file rotation, though, and I 
can't find what could be causing them. These errors are present 
regardless of the global_sidx flag or your movenc patch. Do you have an 
idea what could be causing them?
Jeyapal, Karthick Nov. 30, 2018, 5:40 a.m. UTC | #3
On 11/29/18 8:28 PM, Andrey Semashev wrote:
> On 11/28/18 7:25 PM, Jeyapal, Karthick wrote:

>>

>> On 11/28/18 4:41 PM, Andrey Semashev wrote:

>>> The global_sidx flag causes errors like the following in movenc when media

>>> segment removal is enabled via windos_size or remove_at_exit:

>>>

>>> Non-consecutive fragments, writing incorrect sidx

>>> Unable to re-open  output file for the second pass (faststart) 

>> Removing global_sidx flag adds sidx atom to each moof fragment adding significant bitrate overhead.

>> Instead I have submitted a patch to handle this case cleanly in movenc. http://ffmpeg.org/pipermail/ffmpeg-devel/2018-November/236873.html

>> Please try the above patch and let me know if that will work for you. 

>

> Yes, that patch seems to fix the errors. Thanks.

>

> On a slightly unrelated note, during testing, I've also seen different errors like these:

>

> [AVFormatContext] Application provided duration: -1 / timestamp: 243456 is out of range for mov/mp4 format

> [AVFormatContext] pts has no value

>

> These happen when media segments are rotated and file deletion is enabled. They don't seem to happen on every file rotation, though, and I can't find what could be causing them. These errors are present regardless of the global_sidx flag or your movenc patch. Do you have an idea what could be causing them?

No, I have never faced this issue so far. If could share a sample command line for reproducing this issue, I will have a look at it when I am free.
> _______________________________________________

> ffmpeg-devel mailing list

> ffmpeg-devel@ffmpeg.org

> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Jeyapal, Karthick Dec. 4, 2018, 8:49 a.m. UTC | #4
On 11/29/18 8:28 PM, Andrey Semashev wrote:
> On 11/28/18 7:25 PM, Jeyapal, Karthick wrote:

>>

>> On 11/28/18 4:41 PM, Andrey Semashev wrote:

>>> The global_sidx flag causes errors like the following in movenc when media

>>> segment removal is enabled via windos_size or remove_at_exit:

>>>

>>> Non-consecutive fragments, writing incorrect sidx

>>> Unable to re-open  output file for the second pass (faststart) 

>> Removing global_sidx flag adds sidx atom to each moof fragment adding significant bitrate overhead.

>> Instead I have submitted a patch to handle this case cleanly in movenc. http://ffmpeg.org/pipermail/ffmpeg-devel/2018-November/236873.html

>> Please try the above patch and let me know if that will work for you. 

>

> Yes, that patch seems to fix the errors. Thanks.

Hi Andrey,

That patch was not pushed due to some objections. I have submitted a new patch set addressing it. 
http://ffmpeg.org/pipermail/ffmpeg-devel/2018-December/237121.html
Could you please try the above patchset and confirm if everything works as expected?

Regards,
Karthick
>

> On a slightly unrelated note, during testing, I've also seen different errors like these:

>

> [AVFormatContext] Application provided duration: -1 / timestamp: 243456 is out of range for mov/mp4 format

> [AVFormatContext] pts has no value

>

> These happen when media segments are rotated and file deletion is enabled. They don't seem to happen on every file rotation, though, and I can't find what could be causing them. These errors are present regardless of the global_sidx flag or your movenc patch. Do you have an idea what could be causing them?

> _______________________________________________

> ffmpeg-devel mailing list

> ffmpeg-devel@ffmpeg.org

> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Andrey Semashev Dec. 4, 2018, 11:47 a.m. UTC | #5
On 12/4/18 11:49 AM, Jeyapal, Karthick wrote:
> 
> On 11/29/18 8:28 PM, Andrey Semashev wrote:
>> On 11/28/18 7:25 PM, Jeyapal, Karthick wrote:
>>>
>>> On 11/28/18 4:41 PM, Andrey Semashev wrote:
>>>> The global_sidx flag causes errors like the following in movenc when media
>>>> segment removal is enabled via windos_size or remove_at_exit:
>>>>
>>>> Non-consecutive fragments, writing incorrect sidx
>>>> Unable to re-open  output file for the second pass (faststart)
>>> Removing global_sidx flag adds sidx atom to each moof fragment adding significant bitrate overhead.
>>> Instead I have submitted a patch to handle this case cleanly in movenc. http://ffmpeg.org/pipermail/ffmpeg-devel/2018-November/236873.html
>>> Please try the above patch and let me know if that will work for you.
>>
>> Yes, that patch seems to fix the errors. Thanks.
> Hi Andrey,
> 
> That patch was not pushed due to some objections. I have submitted a new patch set addressing it.
> http://ffmpeg.org/pipermail/ffmpeg-devel/2018-December/237121.html
> Could you please try the above patchset and confirm if everything works as expected?

I will test the final version. Though, if it doesn't change the effect 
since the last version then it should work as well.
Andrey Semashev Dec. 5, 2018, 3:08 p.m. UTC | #6
On 12/4/18 2:47 PM, Andrey Semashev wrote:
> On 12/4/18 11:49 AM, Jeyapal, Karthick wrote:
>>
>> On 11/29/18 8:28 PM, Andrey Semashev wrote:
>>> On 11/28/18 7:25 PM, Jeyapal, Karthick wrote:
>>>>
>>>> On 11/28/18 4:41 PM, Andrey Semashev wrote:
>>>>> The global_sidx flag causes errors like the following in movenc 
>>>>> when media
>>>>> segment removal is enabled via windos_size or remove_at_exit:
>>>>>
>>>>> Non-consecutive fragments, writing incorrect sidx
>>>>> Unable to re-openĀ  output file for the second pass (faststart)
>>>> Removing global_sidx flag adds sidx atom to each moof fragment 
>>>> adding significant bitrate overhead.
>>>> Instead I have submitted a patch to handle this case cleanly in 
>>>> movenc. 
>>>> http://ffmpeg.org/pipermail/ffmpeg-devel/2018-November/236873.html
>>>> Please try the above patch and let me know if that will work for you.
>>>
>>> Yes, that patch seems to fix the errors. Thanks.
>> Hi Andrey,
>>
>> That patch was not pushed due to some objections. I have submitted a 
>> new patch set addressing it.
>> http://ffmpeg.org/pipermail/ffmpeg-devel/2018-December/237121.html
>> Could you please try the above patchset and confirm if everything 
>> works as expected?
> 
> I will test the final version. Though, if it doesn't change the effect 
> since the last version then it should work as well.

I have tested v2 with the fixed flags setup as noted by Tobias and don't 
see any errors.
diff mbox

Patch

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 6ce70e0076..cb49641b4e 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1141,7 +1141,7 @@  static int dash_init(AVFormatContext *s)
 
         if (os->segment_type == SEGMENT_TYPE_MP4) {
             if (c->streaming)
-                av_dict_set(&opts, "movflags", "frag_every_frame+dash+delay_moov+global_sidx", 0);
+                av_dict_set(&opts, "movflags", "frag_every_frame+dash+delay_moov", 0);
             else
                 av_dict_set(&opts, "movflags", "frag_custom+dash+delay_moov", 0);
         } else {