From: Chris R. <ran...@ya...> - 2012-01-01 22:21:23
|
Roland, If this were actually a ffmpeg bug, wouldn't the following command yield identical results? $ ffplay -threads 2 <movie file> Similarly for: $ mplayer -lavdopts threads=2 <movie file> I'm no ffmpeg expert, but I'm thinking that there must be something more going on. Cheers, Chris ________________________________ From: Roland Scheidegger <rsc...@hi...> To: Chris Rankin <ran...@ya...> Cc: "xin...@li..." <xin...@li...> Sent: Sunday, 1 January 2012, 18:59 Subject: Re: [xine-devel] [PATCH] Fix multithreaded initialization with API change Chris, frankly I'm seeing similar issues sometimes. As far as I can tell the reason for this is that multithreaded (frame-based) decoding still doesn't really work in a stable way (so a ffmpeg bug). Without the patch you simply don't get any multithreaded decoding which will cause these issues to disappear. But this is really the equivalent of setting thread count to 1. But hiding this bug by just silently not enabling multithreaded decoding seems not the right thing to do (and clearly it wasn't done on purpose). Roland Am 31.12.2011 13:11, schrieb Chris Rankin: > Roland, > > I have tested this patch locally with a H.264 movie trailer, and it > causes lots of errors on the console like these: > > [h264 @ 0xb23be360] AVC: nal size 1891941506 > [h264 @ 0xb23be360] AVC: nal size 1891941506 > [h264 @ 0xb23be360] no frame! > [h264 @ 0xb23796e0] AVC: nal size 1144403958 > [h264 @ 0xb23796e0] AVC: nal size 1144403958 > [h264 @ 0xb23796e0] no frame! > [h264 @ 0xb23be360] AVC: nal size 806848447 > [h264 @ 0xb23be360] AVC: nal size 806848447 > [h264 @ 0xb23be360] no frame! > [h264 @ 0xb23796e0] AVC: nal size -897927973 > [h264 @ 0xb23796e0] AVC: nal size -897927973 > [h264 @ 0xb23796e0] no frame! > [h264 @ 0xb23be360] AVC: nal size -1555011007 > [h264 @ 0xb23be360] AVC: nal size -1555011007 > [h264 @ 0xb23be360] no frame! > > The trailer seems to play without any artifacts, except that xine > complains that it is dropping too many frames. Without the patch, the > trailer plays fine. > > I am testing on a box with two physical CPUs, and with the following > line in my .xine/config file: > > video.processing.ffmpeg_thread_count:2 > > Cheers, > Chris > > *From:* Roland Scheidegger <rsc...@hi...> > *To:* xin...@li... > *Sent:* Wednesday, 21 December 2011, 20:39 > *Subject:* [xine-devel] [PATCH] Fix multithreaded initialization with > API change > > # HG changeset patch > # User Roland Scheidegger <rsc...@hi... > <mailto:rsc...@hi...>> > # Date 1324499001 -3600 > # Node ID 58e9f9c91a0eebada08912e0a14c2deaaab917d7 > # Parent dc1a30e82601af99013a3ed6b74310753790f969 > Fix multithreaded initialization with API change > > thread count needs to be set before avcodec_open otherwise it will be stuck > with a single thread at least for h264 (might also want to use avcodec_open2 > instead?) > > diff -r dc1a30e82601 -r 58e9f9c91a0e src/combined/ffmpeg/ff_video_decoder.c > --- a/src/combined/ffmpeg/ff_video_decoder.c Thu Dec 15 16:07:46 2011 > +0200 > +++ b/src/combined/ffmpeg/ff_video_decoder.c Wed Dec 21 21:23:21 2011 > +0100 > @@ -329,6 +329,13 @@ > if (this->class->choose_speed_over_accuracy) > this->context->flags2 |= CODEC_FLAG2_FAST; > > +#ifdef DEPRECATED_AVCODEC_THREAD_INIT > + if (this->class->thread_count > 1) { > + if (this->codec->id != CODEC_ID_SVQ3) > + this->context->thread_count = this->class->thread_count; > + } > +#endif > + > pthread_mutex_lock(&ffmpeg_lock); > if (avcodec_open (this->context, this->codec) < 0) { > pthread_mutex_unlock(&ffmpeg_lock); > @@ -356,14 +363,13 @@ > } > } > > +#ifndef DEPRECATED_AVCODEC_THREAD_INIT > if (this->class->thread_count > 1) { > if (this->codec->id != CODEC_ID_SVQ3 > -#ifndef DEPRECATED_AVCODEC_THREAD_INIT > - && avcodec_thread_init(this->context, this->class->thread_count) != -1 > -#endif > - ) > + && avcodec_thread_init(this->context, this->class->thread_count) != -1) > this->context->thread_count = this->class->thread_count; > } > +#endif > > this->context->skip_loop_filter = > skip_loop_filter_enum_values[this->class->skip_loop_filter_enum]; > > > ------------------------------------------------------------------------------ > Write once. Port to many. > Get the SDK and tools to simplify cross-platform app development. Create > new or port existing apps to sell to consumers worldwide. Explore the > Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > http://p.sf.net/sfu/intel-appdev > _______________________________________________ > xine-devel mailing list > xin...@li... <mailto:xin...@li...> > https://lists.sourceforge.net/lists/listinfo/xine-devel > > |