Re: [Libav-user] Speeding up H264 decoding
W dniu 07.09.2016 o 17:59, Kristijonas Malisauskas pisze: First thing i would suggest doing is setting your AVCodecContext to use more threads for ex: videoCtx->thread_count = 4; I've done that and have a significant decoding speedup with some files but now some other mp4 files fail with: [libx264 @ 0x3751e20] invalid DTS: PTS is less than DTS [mp4 @ 0x35a05e0] pts (1548) < dts (2408) in stream 1 I'm using a modified transcoding.c example that handles my sample mp4 file correctly with thread_count=1 and fails with 0 , >1 or "auto". What has to be taken into consideration when using multithreaded decoding? -- Regards Przemyław Sobala ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
> First thing i would suggest doing is setting your AVCodecContext to use more > threads > > for ex: videoCtx->thread_count = 4; > > On Wed, Sep 7, 2016 at 3:05 PM, Simon Brown > mailto:simon.k.br...@gmail.com>> wrote: > I'm running a decode operation using doc/examples/demuxing_decoding.c I'm > running on an Arm A9 with Neon enabled. Sending a 1280x720p stream at 24fps > it can only decode about 15fps. Is there any way of speeding up the decode > operation? Depends on the version of ffmpeg. I have found that previous to ffmpeg 3.0, setting the decode threads to 4 sped up decoding enormously (on a server class system with 32+ cpu cores running Ubuntu). Since ffmpeg 3.0 however, we had to revert to setting the threads to 0 on that same system (allow ffmpeg to decide how many decode threads to use) because using 4 decode threads was running too slow. David Henry ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
2016-09-08 15:24 GMT+02:00 Simon Brown : > When I set the thread_count correctly (using a dict, setting to "auto" and > before the codec was opened) based on a later reply it made a significant > difference to speed. So my guess would be that it defaults to 1 CPU core > or 1 thread. Thanks for (testing and) explaining! Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
On 8 September 2016 at 14:12, Carl Eugen Hoyos wrote: > 2016-09-07 17:59 GMT+02:00 Kristijonas Malisauskas : > > First thing i would suggest doing is setting your > > AVCodecContext to use more threads > > > > for ex: videoCtx->thread_count = 4; > > I believe default is to use all cpu cores. > > Please do not top-post here, Carl Eugen Apologies - I was following what other people were doing - re top-posting. When I set the thread_count correctly (using a dict, setting to "auto" and before the codec was opened) based on a later reply it made a significant difference to speed. So my guess would be that it defaults to 1 CPU core or 1 thread. Simon ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
2016-09-07 17:59 GMT+02:00 Kristijonas Malisauskas : > First thing i would suggest doing is setting your > AVCodecContext to use more threads > > for ex: videoCtx->thread_count = 4; I believe default is to use all cpu cores. Please do not top-post here, Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
@Nikita: No, it's built into an FPGA. @Puneet: That's working much better now. I've also managed to include the Neon libraries correctly and have noticed a decent speed improvement, so am much happier. Now, of course, I need to make it twice as fast again, but that's going to need a different CPU, I think. Cheers, Simon On 8 September 2016 at 11:44, Nikita Orlov wrote: > I see. Do you have exactly model name of cpu? > > 08.09.2016, 13:40, "Simon Brown" : > > That's excellent - thank you. I had changed number of threads, but only > after the codec was opened. > > > > The CPU is a dual core Cortex-A9 running at 950MHz. There is no > hardware coprocessor, so was hoping to eek out what I could from this. > > > > I know FFMpeg has some Neon options (and the libraries have been built > with HAVE_NEON=1, but does anyone know how much of the H.264 decoder has > Neon code, if any? > > > > Cheers, > > Simon > > > > On 8 September 2016 at 11:11, Puneet Kapoor > wrote: > >> I had a similar question sometime back. > >> Try following this thread: https://ffmpeg.org/ > pipermail/libav-user/2016-July/009365.html see if it helps you. > >> > >> Cheers > >> > >> On Thu, Sep 8, 2016 at 11:36 AM, Nikita Orlov > wrote: > >>> Hi! > >>> > >>> Which cpu do you use? Most probably there is hardware decoder. Current > cpu usually can decode 4K@30 > >>> some FullHD@30 at least. > >>> > >>> Another thing, that maybe can suit your case, is to prepare video > optimized for decode. > >>> Very simple optimization is to use simplest profile - baseline. I > believe that there are some other options > >>> to increase decoding speed, you have to google them. > >>> > >>> 08.09.2016, 00:41, "Simon Brown" : > Thank you - I tried that, but got no noticeable difference. > > On 7 September 2016 at 16:59, Kristijonas Malisauskas < > k...@sportcaster.dk> wrote: > > First thing i would suggest doing is setting your AVCodecContext to > use more threads > > > > for ex: videoCtx->thread_count = 4; > > > > On Wed, Sep 7, 2016 at 3:05 PM, Simon Brown > wrote: > >> I'm running a decode operation using doc/examples/demuxing_decoding.c > I'm running on an Arm A9 with Neon enabled. Sending a 1280x720p stream at > 24fps it can only decode about 15fps. Is there any way of speeding up the > decode operation? > >> > >> Regards, > >> Simon > >> ___ > >> Libav-user mailing list > >> Libav-user@ffmpeg.org > >> http://ffmpeg.org/mailman/listinfo/libav-user > > > > ___ > > Libav-user mailing list > > Libav-user@ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > , > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > >>> > >>> -- > >>> Nikita Orlov > >>> Skype: nik_stet > >>> QQ: 2717846083 > >>> > >>> ___ > >>> Libav-user mailing list > >>> Libav-user@ffmpeg.org > >>> http://ffmpeg.org/mailman/listinfo/libav-user > >> > >> ___ > >> Libav-user mailing list > >> Libav-user@ffmpeg.org > >> http://ffmpeg.org/mailman/listinfo/libav-user > > > > , > > > > ___ > > Libav-user mailing list > > Libav-user@ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > -- > Nikita Orlov > Skype: nik_stet > QQ: 2717846083 > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
I see. Do you have exactly model name of cpu? 08.09.2016, 13:40, "Simon Brown" : > That's excellent - thank you. I had changed number of threads, but only > after the codec was opened. > > The CPU is a dual core Cortex-A9 running at 950MHz. There is no hardware > coprocessor, so was hoping to eek out what I could from this. > > I know FFMpeg has some Neon options (and the libraries have been built with > HAVE_NEON=1, but does anyone know how much of the H.264 decoder has Neon > code, if any? > > Cheers, > Simon > > On 8 September 2016 at 11:11, Puneet Kapoor wrote: >> I had a similar question sometime back. >> Try following this thread: >> https://ffmpeg.org/pipermail/libav-user/2016-July/009365.html see if it >> helps you. >> >> Cheers >> >> On Thu, Sep 8, 2016 at 11:36 AM, Nikita Orlov wrote: >>> Hi! >>> >>> Which cpu do you use? Most probably there is hardware decoder. Current cpu >>> usually can decode 4K@30 >>> some FullHD@30 at least. >>> >>> Another thing, that maybe can suit your case, is to prepare video optimized >>> for decode. >>> Very simple optimization is to use simplest profile - baseline. I believe >>> that there are some other options >>> to increase decoding speed, you have to google them. >>> >>> 08.09.2016, 00:41, "Simon Brown" : Thank you - I tried that, but got no noticeable difference. On 7 September 2016 at 16:59, Kristijonas Malisauskas wrote: > First thing i would suggest doing is setting your AVCodecContext to use > more threads > > for ex: videoCtx->thread_count = 4; > > On Wed, Sep 7, 2016 at 3:05 PM, Simon Brown > wrote: >> I'm running a decode operation using doc/examples/demuxing_decoding.c >> I'm running on an Arm A9 with Neon enabled. Sending a 1280x720p stream >> at 24fps it can only decode about 15fps. Is there any way of speeding >> up the decode operation? >> >> Regards, >> Simon >> ___ >> Libav-user mailing list >> Libav-user@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user , ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user >>> >>> -- >>> Nikita Orlov >>> Skype: nik_stet >>> QQ: 2717846083 >>> >>> ___ >>> Libav-user mailing list >>> Libav-user@ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >> >> ___ >> Libav-user mailing list >> Libav-user@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > > , > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -- Nikita Orlov Skype: nik_stet QQ: 2717846083 ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
That's excellent - thank you. I had changed number of threads, but only after the codec was opened. The CPU is a dual core Cortex-A9 running at 950MHz. There is no hardware coprocessor, so was hoping to eek out what I could from this. I know FFMpeg has some Neon options (and the libraries have been built with HAVE_NEON=1, but does anyone know how much of the H.264 decoder has Neon code, if any? Cheers, Simon On 8 September 2016 at 11:11, Puneet Kapoor wrote: > I had a similar question sometime back. > Try following this thread: https://ffmpeg.org/pipermail/libav-user/2016- > July/009365.html see if it helps you. > > Cheers > > On Thu, Sep 8, 2016 at 11:36 AM, Nikita Orlov > wrote: > >> Hi! >> >> Which cpu do you use? Most probably there is hardware decoder. Current >> cpu usually can decode 4K@30 >> some FullHD@30 at least. >> >> Another thing, that maybe can suit your case, is to prepare video >> optimized for decode. >> Very simple optimization is to use simplest profile - baseline. I believe >> that there are some other options >> to increase decoding speed, you have to google them. >> >> 08.09.2016, 00:41, "Simon Brown" : >> >> Thank you - I tried that, but got no noticeable difference. >> >> On 7 September 2016 at 16:59, Kristijonas Malisauskas >> wrote: >> >> First thing i would suggest doing is setting your AVCodecContext to use >> more threads >> >> for ex: videoCtx->thread_count = 4; >> >> On Wed, Sep 7, 2016 at 3:05 PM, Simon Brown >> wrote: >> >> I'm running a decode operation using doc/examples/demuxing_decoding.c >> I'm running on an Arm A9 with Neon enabled. Sending a 1280x720p stream at >> 24fps it can only decode about 15fps. Is there any way of speeding up the >> decode operation? >> >> Regards, >> Simon >> ___ >> Libav-user mailing list >> Libav-user@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> >> ___ >> Libav-user mailing list >> Libav-user@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> , >> >> ___ >> Libav-user mailing list >> Libav-user@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> >> >> -- >> Nikita Orlov >> Skype: nik_stet >> QQ: 2717846083 >> >> >> ___ >> Libav-user mailing list >> Libav-user@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
I had a similar question sometime back. Try following this thread: https://ffmpeg.org/pipermail/libav-user/2016-July/009365.html see if it helps you. Cheers On Thu, Sep 8, 2016 at 11:36 AM, Nikita Orlov wrote: > Hi! > > Which cpu do you use? Most probably there is hardware decoder. Current cpu > usually can decode 4K@30 > some FullHD@30 at least. > > Another thing, that maybe can suit your case, is to prepare video > optimized for decode. > Very simple optimization is to use simplest profile - baseline. I believe > that there are some other options > to increase decoding speed, you have to google them. > > 08.09.2016, 00:41, "Simon Brown" : > > Thank you - I tried that, but got no noticeable difference. > > On 7 September 2016 at 16:59, Kristijonas Malisauskas > wrote: > > First thing i would suggest doing is setting your AVCodecContext to use > more threads > > for ex: videoCtx->thread_count = 4; > > On Wed, Sep 7, 2016 at 3:05 PM, Simon Brown > wrote: > > I'm running a decode operation using doc/examples/demuxing_decoding.c I'm > running on an Arm A9 with Neon enabled. Sending a 1280x720p stream at > 24fps it can only decode about 15fps. Is there any way of speeding up the > decode operation? > > Regards, > Simon > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > , > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > > -- > Nikita Orlov > Skype: nik_stet > QQ: 2717846083 > > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
Hi! Which cpu do you use? Most probably there is hardware decoder. Current cpu usually can decode 4K@30some FullHD@30 at least. Another thing, that maybe can suit your case, is to prepare video optimized for decode.Very simple optimization is to use simplest profile - baseline. I believe that there are some other optionsto increase decoding speed, you have to google them. 08.09.2016, 00:41, "Simon Brown" :Thank you - I tried that, but got no noticeable difference.On 7 September 2016 at 16:59, Kristijonas Malisauskaswrote:First thing i would suggest doing is setting your AVCodecContext to use more threadsfor ex: videoCtx->thread_count = 4;On Wed, Sep 7, 2016 at 3:05 PM, Simon Brown wrote:I'm running a decode operation using doc/examples/demuxing_decoding.c I'm running on an Arm A9 with Neon enabled. Sending a 1280x720p stream at 24fps it can only decode about 15fps. Is there any way of speeding up the decode operation? Regards,Simon___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user ,___Libav-user mailing listLibav-user@ffmpeg.orghttp://ffmpeg.org/mailman/listinfo/libav-user -- Nikita OrlovSkype: nik_stetQQ: 2717846083 ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
Thank you - I tried that, but got no noticeable difference. On 7 September 2016 at 16:59, Kristijonas Malisauskas wrote: > First thing i would suggest doing is setting your AVCodecContext to use > more threads > > for ex: videoCtx->thread_count = 4; > > On Wed, Sep 7, 2016 at 3:05 PM, Simon Brown > wrote: > >> I'm running a decode operation using doc/examples/demuxing_decoding.c >> I'm running on an Arm A9 with Neon enabled. Sending a 1280x720p stream at >> 24fps it can only decode about 15fps. Is there any way of speeding up the >> decode operation? >> >> Regards, >> Simon >> >> ___ >> Libav-user mailing list >> Libav-user@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Speeding up H264 decoding
First thing i would suggest doing is setting your AVCodecContext to use more threads for ex: videoCtx->thread_count = 4; On Wed, Sep 7, 2016 at 3:05 PM, Simon Brown wrote: > I'm running a decode operation using doc/examples/demuxing_decoding.c I'm > running on an Arm A9 with Neon enabled. Sending a 1280x720p stream at > 24fps it can only decode about 15fps. Is there any way of speeding up the > decode operation? > > Regards, > Simon > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user