[vlc-devel] [PATCH] transcode: Fix multithreaded encoding
Rafaël Carré
rafael.carre at gmail.com
Mon Nov 8 23:32:27 CET 2010
On Mon, 8 Nov 2010 17:42:22 +0200
Ilkka Ollakka <ileoo at videolan.org> wrote:
> On Mon, Nov 08, 2010 at 04:34:29PM +0100, Rafaël Carré wrote:
> > Le 08/11/2010 15:59, Rafaël Carré a écrit :
>
> > > id->p_encoder->i_threads = p_sys->i_threads;
> > >+ /* We pass down the number of desired threads to the encoder
> > >(avcodec/x264)
> > >+ * But why would we want to run encoder asynchronously to the
> > >decoder ?? */
> > >+ p_sys->i_threads = 0;
>
> > Note, this patch is functionally equivalent to removing all the
> > "if(thread >= 1)" code and EncoderThread().
>
> Like mentioned in IRC, I'm more in favor of removing if(thread > 0 )
> and EncoderThread() alltogether, as it would clean up the code. It's
> unlikely anyway that someone would fix current threading code in
> transcode.
>
> > I just thought this smaller patch would help looking at the issue :)
I benchmarked this patch:
time cvlc --ignore-config --no-media-library --no-ffmpeg-hw --no-audio
--no-sout-audio --stop-time=10 big_buck_bunny_1080p_h264.mov --sout
"#transcode{vcodec=h264,threads=4,venc=x264{preset=slow,trellis=2},vb=2000}:std{access=file,dst=$HOME/out.ts}"
vlc://quit
gives:
90,26s user 1,02s system 234% cpu 38,927 total with HEAD
113,34s user 0,54s system 242% cpu 46,971 total with the patch
on i3, 4 cores @ 2.93GHz
--
✍ Rafaël Carré ☺
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20101108/ce56bb7e/attachment.sig>
More information about the vlc-devel
mailing list