mbox series

[FFmpeg-devel,0/2] avformat movenc add flag to allow disabling limit on timescale

Message ID 20200504162428.85535-1-hello.vectronic@gmail.com
Headers show
Series avformat movenc add flag to allow disabling limit on timescale | expand

Message

vectronic May 4, 2020, 4:24 p.m. UTC
I needed to encode to mov/mp4 with a timebase of 1/600 and the output was not as expected.

I discovered the reason is a silent limiting of a track timebase added here:

https://github.com/FFmpeg/FFmpeg/commit/b02493e47668e66757b72a7163476e590edfea3a

The patch attached provides a new flag to disable the timebase limit, and in the case that the limit
is applied, a debug message is logged to prevent future user confusion.

vectronic (2):
  avformat movenc add flag to disable silent limit on timescale
  avformat movenc add flag to disable silent limit on timescale

 libavformat/movenc.c | 8 ++++++--
 libavformat/movenc.h | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

Comments

Gyan Doshi May 4, 2020, 4:56 p.m. UTC | #1
On 04-05-2020 09:54 pm, vectronic wrote:
> I needed to encode to mov/mp4 with a timebase of 1/600 and the output was not as expected.

What was the unexpected output?

You can use video_track_timescale to set any custom scale.

Gyan
vectronic May 4, 2020, 9:46 p.m. UTC | #2
> On 4 May 2020, at 17:56, Gyan Doshi <ffmpeg@gyani.pro> wrote:
> 
> 
> 
> On 04-05-2020 09:54 pm, vectronic wrote:
>> I needed to encode to mov/mp4 with a timebase of 1/600 and the output was not as expected.
> 
> What was the unexpected output?
> 
> You can use video_track_timescale to set any custom scale.
> 
> Gyan

The unexpected output is that if you request a timebase of 600 as an argument for ffmpeg on the command line, the output timebase is forced to be greater than 10000.

As far as I can see there is no documentation or message logged that the following logic is applied which means the output differs to what a user has requested and expects:

while(track->timescale < 10000)
    track->timescale *= 2;

I believe video_track_timescale applies to all tracks - so you unable to specify timescales per track?

Nick
Gyan Doshi May 5, 2020, 5:19 a.m. UTC | #3
On 05-05-2020 03:16 am, vectronic wrote:
>
>> On 4 May 2020, at 17:56, Gyan Doshi <ffmpeg@gyani.pro> wrote:
>>
>>
>>
>> On 04-05-2020 09:54 pm, vectronic wrote:
>>> I needed to encode to mov/mp4 with a timebase of 1/600 and the output was not as expected.
>> What was the unexpected output?
>>
>> You can use video_track_timescale to set any custom scale.
>>
>> Gyan
> The unexpected output is that if you request a timebase of 600 as an argument for ffmpeg on the command line, the output timebase is forced to be greater than 10000.
>
> As far as I can see there is no documentation or message logged that the following logic is applied which means the output differs to what a user has requested and expects:
>
> while(track->timescale < 10000)
>      track->timescale *= 2;
>
> I believe video_track_timescale applies to all tracks - so you unable to specify timescales per track?

I believe your flag also disables the scale clamping for all video 
tracks. In that case, better to extend the min value of 
video_track_timescaleĀ  to -1 to implement this instead of a new flag.

Gyan
vectronic May 11, 2020, 1:14 p.m. UTC | #4
> On 5 May 2020, at 06:19, Gyan Doshi <ffmpeg@gyani.pro> wrote:
> 
> 
> 
> On 05-05-2020 03:16 am, vectronic wrote:
>> 
>>> On 4 May 2020, at 17:56, Gyan Doshi <ffmpeg@gyani.pro> wrote:
>>> 
>>> 
>>> 
>>> On 04-05-2020 09:54 pm, vectronic wrote:
>>>> I needed to encode to mov/mp4 with a timebase of 1/600 and the output was not as expected.
>>> What was the unexpected output?
>>> 
>>> You can use video_track_timescale to set any custom scale.
>>> 
>>> Gyan
>> The unexpected output is that if you request a timebase of 600 as an argument for ffmpeg on the command line, the output timebase is forced to be greater than 10000.
>> 
>> As far as I can see there is no documentation or message logged that the following logic is applied which means the output differs to what a user has requested and expects:
>> 
>> while(track->timescale < 10000)
>>     track->timescale *= 2;
>> 
>> I believe video_track_timescale applies to all tracks - so you unable to specify timescales per track?
> 
> I believe your flag also disables the scale clamping for all video tracks. In that case, better to extend the min value of video_track_timescale  to -1 to implement this instead of a new flag.
> 
> Gyan
> 

Hello Gyan,

I updated the patch with your feedback here: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=1138

Do you have any further feedback?

Thanks,

Nick
Gyan Doshi May 11, 2020, 3:46 p.m. UTC | #5
On 11-05-2020 06:44 pm, vectronic wrote:
>
>> On 5 May 2020, at 06:19, Gyan Doshi <ffmpeg@gyani.pro> wrote:
>>
>>
>>
>> On 05-05-2020 03:16 am, vectronic wrote:
>>>> On 4 May 2020, at 17:56, Gyan Doshi <ffmpeg@gyani.pro> wrote:
>>>>
>>>>
>>>>
>>>> On 04-05-2020 09:54 pm, vectronic wrote:
>>>>> I needed to encode to mov/mp4 with a timebase of 1/600 and the output was not as expected.
>>>> What was the unexpected output?
>>>>
>>>> You can use video_track_timescale to set any custom scale.
>>>>
>>>> Gyan
>>> The unexpected output is that if you request a timebase of 600 as an argument for ffmpeg on the command line, the output timebase is forced to be greater than 10000.
>>>
>>> As far as I can see there is no documentation or message logged that the following logic is applied which means the output differs to what a user has requested and expects:
>>>
>>> while(track->timescale < 10000)
>>>      track->timescale *= 2;
>>>
>>> I believe video_track_timescale applies to all tracks - so you unable to specify timescales per track?
>> I believe your flag also disables the scale clamping for all video tracks. In that case, better to extend the min value of video_track_timescale  to -1 to implement this instead of a new flag.
>>
>> Gyan
>>
> Hello Gyan,
>
> I updated the patch with your feedback here: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=1138
>
> Do you have any further feedback?

Give meĀ  a couple of days to test.

Thanks,,
Gyan
vectronic July 7, 2020, 11:12 a.m. UTC | #6
> On 11 May 2020, at 16:46, Gyan Doshi <ffmpeg@gyani.pro> wrote:
> 
> 
> 
> On 11-05-2020 06:44 pm, vectronic wrote:
>> 
>>> On 5 May 2020, at 06:19, Gyan Doshi <ffmpeg@gyani.pro> wrote:
>>> 
>>> 
>>> 
>>> On 05-05-2020 03:16 am, vectronic wrote:
>>>>> On 4 May 2020, at 17:56, Gyan Doshi <ffmpeg@gyani.pro> wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>> On 04-05-2020 09:54 pm, vectronic wrote:
>>>>>> I needed to encode to mov/mp4 with a timebase of 1/600 and the output was not as expected.
>>>>> What was the unexpected output?
>>>>> 
>>>>> You can use video_track_timescale to set any custom scale.
>>>>> 
>>>>> Gyan
>>>> The unexpected output is that if you request a timebase of 600 as an argument for ffmpeg on the command line, the output timebase is forced to be greater than 10000.
>>>> 
>>>> As far as I can see there is no documentation or message logged that the following logic is applied which means the output differs to what a user has requested and expects:
>>>> 
>>>> while(track->timescale < 10000)
>>>>     track->timescale *= 2;
>>>> 
>>>> I believe video_track_timescale applies to all tracks - so you unable to specify timescales per track?
>>> I believe your flag also disables the scale clamping for all video tracks. In that case, better to extend the min value of video_track_timescale  to -1 to implement this instead of a new flag.
>>> 
>>> Gyan
>>> 
>> Hello Gyan,
>> 
>> I updated the patch with your feedback here: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=1138
>> 
>> Do you have any further feedback?
> 
> Give me  a couple of days to test.
> 
> Thanks,,
> Gyan

Hello Gyan,

Did you end up getting any time to look at this?

Thanks very much,

Nick
Gyan Doshi July 7, 2020, 5:34 p.m. UTC | #7
On 07-07-2020 04:42 pm, vectronic wrote:
>> On 11 May 2020, at 16:46, Gyan Doshi <ffmpeg@gyani.pro> wrote:
>>
>>
>>
>> On 11-05-2020 06:44 pm, vectronic wrote:
>>>> On 5 May 2020, at 06:19, Gyan Doshi <ffmpeg@gyani.pro> wrote:
>>>>
>>>>
>>>>
>>>> On 05-05-2020 03:16 am, vectronic wrote:
>>>>>> On 4 May 2020, at 17:56, Gyan Doshi <ffmpeg@gyani.pro> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 04-05-2020 09:54 pm, vectronic wrote:
>>>>>>> I needed to encode to mov/mp4 with a timebase of 1/600 and the output was not as expected.
>>>>>> What was the unexpected output?
>>>>>>
>>>>>> You can use video_track_timescale to set any custom scale.
>>>>>>
>>>>>> Gyan
>>>>> The unexpected output is that if you request a timebase of 600 as an argument for ffmpeg on the command line, the output timebase is forced to be greater than 10000.
>>>>>
>>>>> As far as I can see there is no documentation or message logged that the following logic is applied which means the output differs to what a user has requested and expects:
>>>>>
>>>>> while(track->timescale < 10000)
>>>>>      track->timescale *= 2;
>>>>>
>>>>> I believe video_track_timescale applies to all tracks - so you unable to specify timescales per track?
>>>> I believe your flag also disables the scale clamping for all video tracks. In that case, better to extend the min value of video_track_timescale  to -1 to implement this instead of a new flag.
>>>>
>>>> Gyan
>>>>
>>> Hello Gyan,
>>>
>>> I updated the patch with your feedback here: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=1138
>>>
>>> Do you have any further feedback?
>> Give me  a couple of days to test.
>>
>> Thanks,,
>> Gyan
> Hello Gyan,
>
> Did you end up getting any time to look at this?

Sorry, life's gotten busier for me. I'll aim to test it this weekend.

Gyan