[Libav-user] multithreaded use of sws_scale

Martin Belleau mbelleau at capellasystems.net
Wed Sep 20 01:44:55 EEST 2017


I also noticed that vf_scale.c has an option to use multiple slices, but 
I don't have code yet to exercise ffmpeg video filters, and I don't know 
how to configure it to use slices using ffmpeg.exe command line.


On 9/19/2017 3:30 PM, Martin Belleau wrote:
>
> I was able to get sliced scaling to work, using a different SwsContext 
> for each slice.
>
> The problem is I can only use two slices, otherwise I run into the 
> 'Slices start in the middle!' error.  The line of code that detects 
> that error is:
>
> if (c->sliceDir == 0 && srcSliceY != 0 && srcSliceY + srcSliceH != 
> c->srcH)
>
> I'm not sure about sliceDir (I think it's about handling of 
> upside-down slices?) but basically either srcSliceY has to be 0 
> (meaning your slice starts from the very top of the source), or 
> srcSliceY plus srcSliceH has to be c->srcH (meaning your slice ends at 
> the very top of the source).
>
> Is that 2 slice limit a known and expected limitation?
>
>
> On 9/18/2017 8:09 PM, J Decker wrote:
>> I would think you would want different SwsContexts for each thread.  
>> Otherwise you'd set the parameters for the first thread, and then the 
>> second thread would override those parameters used in the structure.
>>
>>
>>
>> On Mon, Sep 18, 2017 at 10:19 AM, Martin Belleau 
>> <mbelleau at capellasystems.net <mailto:mbelleau at capellasystems.net>> wrote:
>>
>>     I see that sws_scale has srcSliceY and srcSliceH, which should
>>     allow to perform scaling of different slices in parallel.
>>
>>     Is there any sample code which demonstrates how to use it?
>>
>>     Should the same SwsContext be used to scale all the slices?
>>
>>     _______________________________________________
>>     Libav-user mailing list
>>     Libav-user at ffmpeg.org <mailto:Libav-user at ffmpeg.org>
>>     http://ffmpeg.org/mailman/listinfo/libav-user
>>     <http://ffmpeg.org/mailman/listinfo/libav-user>
>>
>>
>>
>>
>> _______________________________________________
>> Libav-user mailing list
>> Libav-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/libav-user
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170919/051f9ae7/attachment.html>


More information about the Libav-user mailing list