So I tried the following code:
  Profile *profile1 = new Profile();

  profile1->set_frame_rate(10,1);
  profile1->set_explicit(true);

    Producer producer(*profile1, "small_movie.mp4");

  std::cout<<producer.get_playtime()<<std::endl;

  profile1->set_frame_rate(15,1);
  std::cout<<producer.get_playtime()<<std::endl;

  producer.set_profile(*profile1);
  std::cout<<producer.get_playtime()<<std::endl;


I would have expected it to print "10 15 15" or "10 10 15" but instead I
get "10 10 10", which tends to confirm what Brian pointed out.
So what's the best way to change profile in that case?

Thanks in advance

2017-03-13 16:01 GMT+01:00 Brian Matherly <c...@brianmatherly.com>:

>
> On 3/13/2017 9:17 AM, alcinos wrote:
>
>> Thank you for your answer.
>> So if I understand correctly the logic of the code you've linked, if I
>> create my objects (filter, consumers, producers) with a pointer to the same
>> Profile object, then modifing properties of this profile object (fps, …)
>> has the correct side-effects on all the other objects, is that it ? Besides
>> stopping the consumer(s), are there any pitfalls I should be aware of ?
>>
>
> I expect that you would have some trouble with producers. Some producers
> (e.g. avformat) calculate the length when they are first created. If you
> change the profile to a different frame rate, I'm not sure if the length
> will be re-calculated. You might need to experiment with that.
>
> ~Brian
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to