To Speed Up thumbnail creation - picture & video

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

To Speed Up thumbnail creation - picture & video

FFmpeg-users mailing list
Hello,

We have been using FFMPEG library to create the following thumbnails from
videos:
a. picture
b. video - for example a 60secs video thumbnail.

Our video sizes are about 200 - 300 MB. We are using a PHP program to
transfer command to the shell for FFMPEG executable to generate the
thumbnails.

The videos exists on AWS S3, and we are fetching them using S3 signature
url, generating the thumbs and uploading back.

We have noticed that FFMPEG takes quite sometime to create the thumbnails,
which is creating a wait time on the part of the interface.

Please let us know if there could be a way, we can fasten this process.
Do such params exist in FFMPEG ?

The time for creation on a local system using S3 is given hereunder:

To create a picture:
real 0m37.618s
user 0m17.791s
sys 0m0.783s

To create a video thumb:
real 3m6.979s
user 2m29.448s
sys 0m4.621s

The commands used for the purpose are as hereunder:
To create a picture:
"ffmpeg -i '".$s3_key_url."' -r 1 -vframes 1 -an -s $thumbnail_size -ss 05
$extracted_thumbnail_location 2>&1"

To create a videothumb of 60 secs:
"ffmpeg -ss 00 -t 60 -i '".$s3_key_url."' -vf scale=$video_scale -strict -2
$extracted_video_location 2>&1"

The logs of the respective commands are as follows:
For picture:
---------------
ffmpeg -i '
https://cnp892.s3.amazonaws.com/main/010420_Downtown_SD_Waterfront_2.mov?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZD5VS7Z66QJB56WV%2F20200505%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200505T065154Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Signature=14930fed30d72ef3afbb06ec0ac70cae5e741e067b4c0da5108b1b49e17ce665'
-r 1 -vframes 1 -an -s 640X360 -ss 05
/data/html/wpsite/wp_5_2_5/wp-content/uploads/VaspmTempsu/010420_Downtown_SD_Waterfront_2_preview.jpg
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg
developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1
--build-suffix=-ffmpeg --toolchain=hardened
--libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu
--cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping
--disable-decoder=libopenjpeg --disable-decoder=libschroedinger
--enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libflite --enable-libfontconfig
--enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm
--enable-libmodplug --enable-libmp3lame --enable-libopenjpeg
--enable-libopus --enable-libpulse --enable-librtmp
--enable-libschroedinger --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi
--enable-openal --enable-opengl --enable-x11grab --enable-libdc1394
--enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264
--enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[https @ 0xd03fe0] HTTP error 416 Requested Range Not Satisfiable
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '
https://cnp892.s3.amazonaws.com/main/010420_Downtown_SD_Waterfront_2.mov?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZD5VS7Z66QJB56WV%2F20200505%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200505T065154Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Signature=14930fed30d72ef3afbb06ec0ac70cae5e741e067b4c0da5108b1b49e17ce665
':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2020-01-13 23:36:24
  Duration: 00:00:33.99, start: 0.000000, bitrate: 49379 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
bt709), 3840x2160 [SAR 1:1 DAR 16:9], 49376 kb/s, 23.98 fps, 23.98 tbr, 24k
tbn, 48k tbc (default)
    Metadata:
      creation_time   : 2020-01-13 23:36:24
      handler_name    : Core Media Data Handler
      encoder         : H.264
      timecode        : 00:00:00:00
    Stream #0:1(und): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2020-01-13 23:36:24
      handler_name    : Core Media Data Handler
      timecode        : 00:00:00:00
[swscaler @ 0x1103300] deprecated pixel format used, make sure you did set
range correctly
Output #0, image2, to
'/data/html/wpsite/wp_5_2_5/wp-content/uploads/VaspmTempsu/010420_Downtown_SD_Waterfront_2_preview.jpg':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    encoder         : Lavf56.40.101
    Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 640x360 [SAR 1:1 DAR
16:9], q=2-31, 200 kb/s, 1 fps, 1 tbn, 1 tbc (default)
    Metadata:
      creation_time   : 2020-01-13 23:36:24
      handler_name    : Core Media Data Handler
      timecode        : 00:00:00:00
      encoder         : Lavc56.60.100 mjpeg
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.1 q=6.4 Lsize=N/A time=00:00:01.00 bitrate=N/A
video:47kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown

real 0m37.618s
user 0m17.791s
sys 0m0.783s


For video:
--------------
ffmpeg -ss 00 -t 60 -i '
https://cnp892.s3.amazonaws.com/main/010420_Downtown_SD_Waterfront_2.mov?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZD5VS7Z66QJB56WV%2F20200506%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200506T063632Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Signature=b22ed0c2db7154c0e533a875b32cd1b4b96878361a3e6ab8f0c341bdc8ecd120'
-vf scale=640:360 -strict -2
/data/html/wpsite/wp_5_2_5/wp-content/uploads/VaspmTempsu/010420_Downtown_SD_Waterfront_2_preview_tmp.mp4
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg
developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1
--build-suffix=-ffmpeg --toolchain=hardened
--libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu
--cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping
--disable-decoder=libopenjpeg --disable-decoder=libschroedinger
--enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libflite --enable-libfontconfig
--enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm
--enable-libmodplug --enable-libmp3lame --enable-libopenjpeg
--enable-libopus --enable-libpulse --enable-librtmp
--enable-libschroedinger --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi
--enable-openal --enable-opengl --enable-x11grab --enable-libdc1394
--enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264
--enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[https @ 0x126afa0] HTTP error 416 Requested Range Not Satisfiable
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '
https://cnp892.s3.amazonaws.com/main/010420_Downtown_SD_Waterfront_2.mov?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZD5VS7Z66QJB56WV%2F20200506%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200506T063632Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Signature=b22ed0c2db7154c0e533a875b32cd1b4b96878361a3e6ab8f0c341bdc8ecd120
':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2020-01-13 23:36:24
  Duration: 00:00:33.99, start: 0.000000, bitrate: 49379 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
bt709), 3840x2160 [SAR 1:1 DAR 16:9], 49376 kb/s, 23.98 fps, 23.98 tbr, 24k
tbn, 48k tbc (default)
    Metadata:
      creation_time   : 2020-01-13 23:36:24
      handler_name    : Core Media Data Handler
      encoder         : H.264
      timecode        : 00:00:00:00
    Stream #0:1(und): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2020-01-13 23:36:24
      handler_name    : Core Media Data Handler
      timecode        : 00:00:00:00
[libx264 @ 0x12b2960] using SAR=1/1
[libx264 @ 0x12b2960] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x12b2960] profile High, level 3.0
[libx264 @ 0x12b2960] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec
- Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1
ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1
weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40
intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0
qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to
'/data/html/wpsite/wp_5_2_5/wp-content/uploads/VaspmTempsu/010420_Downtown_SD_Waterfront_2_preview_tmp.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    encoder         : Lavf56.40.101
    Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021),
yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 23.98 fps, 24k tbn, 23.98 tbc
(default)
    Metadata:
      creation_time   : 2020-01-13 23:36:24
      handler_name    : Core Media Data Handler
      timecode        : 00:00:00:00
      encoder         : Lavc56.60.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame=  815 fps=4.9 q=-1.0 Lsize=    5573kB time=00:00:33.90
bitrate=1346.3kbits/s
video:5562kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.187583%
[libx264 @ 0x12b2960] frame I:4     Avg QP:21.82  size: 63742
[libx264 @ 0x12b2960] frame P:407   Avg QP:24.15  size: 12739
[libx264 @ 0x12b2960] frame B:404   Avg QP:29.67  size:   631
[libx264 @ 0x12b2960] consecutive B-frames:  0.9% 99.1%  0.0%  0.0%
[libx264 @ 0x12b2960] mb I  I16..4:  7.9% 19.5% 72.6%
[libx264 @ 0x12b2960] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4: 38.0% 25.6%
21.7%  0.0%  0.0%    skip:14.6%
[libx264 @ 0x12b2960] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 30.1%  2.3%
 0.7%  direct: 1.3%  skip:65.5%  L0:30.1% L1:51.7% BI:18.2%
[libx264 @ 0x12b2960] 8x8 transform intra:19.2% inter:45.7%
[libx264 @ 0x12b2960] coded y,uvDC,uvAC intra: 87.1% 96.4% 86.6% inter:
26.4% 17.5% 4.9%
[libx264 @ 0x12b2960] i16 v,h,dc,p:  7% 55%  3% 35%
[libx264 @ 0x12b2960] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 41% 14%  4%  4%
 3%  8%  4%  8%
[libx264 @ 0x12b2960] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 26%  9%  5%  6%
 5% 10%  5%  9%
[libx264 @ 0x12b2960] i8c dc,h,v,p: 39% 40% 12%  9%
[libx264 @ 0x12b2960] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x12b2960] ref P L0: 60.4% 14.1% 17.6%  7.9%
[libx264 @ 0x12b2960] ref B L0: 70.9% 29.1%
[libx264 @ 0x12b2960] kb/s:1340.28

real 3m6.979s
user 2m29.448s
sys 0m4.621s



--
======================================================
Best Regards,

Arunava Banerjee
Sr. Web Developer,
Capital Numbers Infotech Pvt.Ltd.
Gmail: [hidden email]
======================================================
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: To Speed Up thumbnail creation - picture & video

Carl Eugen Hoyos-2


> Am 22.06.2020 um 07:23 schrieb Arunava Banerjee via ffmpeg-user <[hidden email]>:
>
> ffmpeg version 2.8.15

This will be five years old soon, please test current FFmpeg git head.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: To Speed Up thumbnail creation - picture & video

FFmpeg-users mailing list
Hello,

Thanks for the suggestions.

Currently, for ubuntu 16.04, we are able to install only the FFMPEG 4
version.

Will test on that surely and revert.


Regards

On Mon, Jun 22, 2020 at 12:41 PM Carl Eugen Hoyos <[hidden email]>
wrote:

>
>
> > Am 22.06.2020 um 07:23 schrieb Arunava Banerjee via ffmpeg-user <
> [hidden email]>:
> >
> > ffmpeg version 2.8.15
>
> This will be five years old soon, please test current FFmpeg git head.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".



--
======================================================
Best Regards,

Arunava Banerjee
Sr. Web Developer,
Capital Numbers Infotech Pvt.Ltd.
Gmail: [hidden email]
======================================================
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: To Speed Up thumbnail creation - picture & video

FFmpeg-users mailing list
Hello,

Could a link with more recent versions of FFMPEG be provided?

We could find the version as described on the following link:
https://tecadmin.net/install-ffmpeg-on-linux/ --  It is version 4.2.2.


On Mon, Jun 22, 2020 at 1:12 PM Arunava Banerjee <
[hidden email]> wrote:

>
> Hello,
>
> Thanks for the suggestions.
>
> Currently, for ubuntu 16.04, we are able to install only the FFMPEG 4
> version.
>
> Will test on that surely and revert.
>
>
> Regards
>
> On Mon, Jun 22, 2020 at 12:41 PM Carl Eugen Hoyos <[hidden email]>
> wrote:
>
>>
>>
>> > Am 22.06.2020 um 07:23 schrieb Arunava Banerjee via ffmpeg-user <
>> [hidden email]>:
>> >
>> > ffmpeg version 2.8.15
>>
>> This will be five years old soon, please test current FFmpeg git head.
>>
>> Carl Eugen
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
>
> --
> ======================================================
> Best Regards,
>
> Arunava Banerjee
> Sr. Web Developer,
> Capital Numbers Infotech Pvt.Ltd.
> Gmail: [hidden email]
> ======================================================
>


--
======================================================
Best Regards,

Arunava Banerjee
Sr. Web Developer,
Capital Numbers Infotech Pvt.Ltd.
Gmail: [hidden email]
======================================================
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: To Speed Up thumbnail creation - picture & video

Brainiarc7
On Mon, 22 Jun 2020, 11:04 Arunava Banerjee via ffmpeg-user, <
[hidden email]> wrote:

> Hello,
>
> Could a link with more recent versions of FFMPEG be provided?
>
> We could find the version as described on the following link:
> https://tecadmin.net/install-ffmpeg-on-linux/ --  It is version 4.2.2.
>
>
> On Mon, Jun 22, 2020 at 1:12 PM Arunava Banerjee <
> [hidden email]> wrote:
>
> >
> > Hello,
> >
> > Thanks for the suggestions.
> >
> > Currently, for ubuntu 16.04, we are able to install only the FFMPEG 4
> > version.
> >
> > Will test on that surely and revert.
> >
> >
> > Regards
> >
> > On Mon, Jun 22, 2020 at 12:41 PM Carl Eugen Hoyos <[hidden email]>
> > wrote:
> >
> >>
> >>
> >> > Am 22.06.2020 um 07:23 schrieb Arunava Banerjee via ffmpeg-user <
> >> [hidden email]>:
> >> >
> >> > ffmpeg version 2.8.15
> >>
> >> This will be five years old soon, please test current FFmpeg git head.
> >>
> >> Carl Eugen
> >> _______________________________________________
> >> ffmpeg-user mailing list
> >> [hidden email]
> >> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >>
> >> To unsubscribe, visit link above, or email
> >> [hidden email] with subject "unsubscribe".
> >
> >
> >
> > --
> > ======================================================
> > Best Regards,
> >
> > Arunava Banerjee
> > Sr. Web Developer,
> > Capital Numbers Infotech Pvt.Ltd.
> > Gmail: [hidden email]
> > ======================================================
> >
>
>
> --
> ======================================================
> Best Regards,
>
> Arunava Banerjee
> Sr. Web Developer,
> Capital Numbers Infotech Pvt.Ltd.
> Gmail: [hidden email]
> ======================================================
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".



Do you have access to an NVIDIA GPU accelerated workflow on AWS?

You may be able to get far better results by combining the use of
scale_cuda (or scale_npp) filter(s) paired with the thumbnail_cuda filter
for GPU accelerated thumbnail generation.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: To Speed Up thumbnail creation - picture & video

Reindl Harald
In reply to this post by FFmpeg-users mailing list


Am 22.06.20 um 10:04 schrieb Arunava Banerjee via ffmpeg-user:
> Could a link with more recent versions of FFMPEG be provided?

https://ffmpeg.org/releases/

[builduser@buildserver:~]$ rpm -q ffmpeg-latest
ffmpeg-latest-4.3.0-1.1.fc31.20200616.rh.x264.0.158.0000.native.x86_64



[builduser@buildserver:~]$ cat /rpmbuild/SPECS/ffmpeg-latest.spec
#############################################################################################################################
# command 'rpmbuild -bb ffmpeg-latest.spec --with production' will tune
for current hardware while default stays compatible #
#############################################################################################################################

%global ffmpeg_snapshot 20200616
%global x264_snapshot   20200311
%global x264_version    0.158.0000
%global pgo_build       1

%if %{?_with_production:1}%{!?_with_production:0}
 %global rpmsuffix native
 %global build_native_release 1
 %global optflags $(sed "s/sandybridge/native/g" <<< "%{optflags}")
%else
 %global rpmsuffix %{mtune2}
 %global build_native_release 0
 %global optflags $(sed "s/sandybridge/%{mtune2}/g" <<< "%{optflags}")
%endif

Summary:           Hyper fast Audio and Video encoder (static build)
Name:              ffmpeg-latest
Version:           4.3.0
Release:
1.%{build_native_release}%{?dist}.x264.%{x264_version}.%{rpmsuffix}
License:           GPLv3+
URL:               http://ffmpeg.org/
Source0:           ffmpeg-%{ffmpeg_snapshot}.tar.xz
Source1:           x264-%{x264_snapshot}.tar.xz
Source2:           ffmpeg-snapshot-latest.sh
Source3:           x264-snapshot-latest.sh
Source4:           720x400.yuv
BuildRequires:     bzip2-devel
BuildRequires:     imlib2-devel
BuildRequires:     lame-devel
BuildRequires:     libtheora-devel
BuildRequires:     libvpx-devel
BuildRequires:     openssl-devel
BuildRequires:     x265-devel
BuildRequires:     nasm
BuildRequires:     yasm
BuildRequires:     zlib-devel
Provides:          ffmpeg

%description
A complete, cross-platform solution to record, convert and stream audio
and video

%package           manpages
Summary:           Manpages for ffmpeg-latest
BuildArch:         noarch
%description       manpages

%prep
%setup -q -n ffmpeg-%{ffmpeg_snapshot}

%build
# build x264-static with profile-guided-optimization for current
architecture
tar xJf %{SOURCE1}
pushd x264-%{x264_snapshot}
./configure \
 --prefix=/rpmbuild/BUILD/ffmpeg-%{ffmpeg_snapshot} \
 --exec-prefix=/rpmbuild/BUILD/ffmpeg-%{ffmpeg_snapshot}/x264-static \
 --bindir=/rpmbuild/BUILD/ffmpeg-%{ffmpeg_snapshot}/x264-static \
 --libdir=/rpmbuild/BUILD/ffmpeg-%{ffmpeg_snapshot}/x264-static \
 --includedir=/rpmbuild/BUILD/ffmpeg-%{ffmpeg_snapshot}/x264-static \
 --extra-cflags="%{optflags} %{O3_flags} -w" \
 --extra-ldflags="-Wl,--as-needed -Wl,-z,now -Wl,-z,relro
-Wl,-z,noexecstack %{optflags} %{O3_flags} -w" \
 --enable-static \
 --enable-pic \
 --enable-strip \
 --disable-avs \
 --disable-cli \
 --disable-ffms \
 --disable-gpac \
 --disable-lavf \
 --disable-opencl \
 --disable-swscale
%if %pgo_build
 make fprofiled VIDS="%{SOURCE4}" %{?_smp_mflags}
%else
 make %{?_smp_mflags}
%endif
make install
strip --strip-unneeded --strip-debug
/rpmbuild/BUILD/ffmpeg-%{ffmpeg_snapshot}/x264-static/libx264.a
popd
# build ffmpeg-static and link with x264-static from previous build
mkdir generic
pushd generic
../configure \
 --prefix=%{_prefix}/local \
 --bindir=%{_prefix}/local/bin \
 --mandir=%{_prefix}/local/man \
 --extra-cflags="-I/rpmbuild/BUILD/ffmpeg-%{ffmpeg_snapshot}/x264-static
%{optflags} %{O3_flags} -flto=%(nproc) -ffat-lto-objects -fwhole-program
-w" \
 --extra-ldflags="-I/rpmbuild/BUILD/ffmpeg-%{ffmpeg_snapshot}/x264-static -L/rpmbuild/BUILD/ffmpeg-%{ffmpeg_snapshot}/x264-static -ldl -Wl,--as-needed -Wl,-z,now -Wl,-z,relro %{optflags} %{O3_flags} -flto=%(nproc) -ffat-lto-objects -fwhole-program -pie -fPIE -w" \
 --ar=gcc-ar \
 --ranlib=true \
 --enable-lto \
 --enable-gpl \
 --enable-libmp3lame \
 --enable-libtheora \
 --enable-libvpx \
 --enable-libx264 \
 --enable-libx265 \
 --enable-nonfree \
 --enable-openssl \
 --enable-pic \
 --enable-runtime-cpudetect \
 --enable-static \
 --enable-version3 \
 --disable-amf \
 --disable-appkit \
 --disable-autodetect \
 --disable-avdevice \
 --disable-avfoundation \
 --disable-coreimage \
 --disable-debug \
 --disable-devices \
 --disable-ffplay \
 --disable-ffprobe \
 --disable-htmlpages \
 --disable-hwaccels \
 --disable-iconv \
 --disable-libdc1394 \
 --disable-libfreetype \
 --disable-libgsm \
 --disable-libopencore-amrnb \
 --disable-libopencore-amrwb \
 --disable-libopencv \
 --disable-libopenjpeg \
 --disable-libopus \
 --disable-librtmp \
 --disable-libspeex \
 --disable-libvorbis \
 --disable-libxcb \
 --disable-libxcb-shape \
 --disable-libxcb-shm \
 --disable-libxcb-xfixes \
 --disable-libxvid \
 --disable-podpages \
 --disable-postproc \
 --disable-protocol=gopher \
 --disable-shared \
 --disable-txtpages \
 --disable-xlib
%{__make} %{?_smp_mflags}
make documentation
popd

%install
pushd generic
make install DESTDIR=%{buildroot}
popd
mkdir %{buildroot}%{_bindir}
ln -s %{_prefix}/local/bin/ffmpeg %{buildroot}%{_bindir}/ffmpeg
rm -rf %{buildroot}%{_prefix}/local/include
%{buildroot}%{_prefix}/local/lib %{buildroot}%{_prefix}/local/lib64
%{buildroot}%{_prefix}/local/share
strip --strip-unneeded %{buildroot}%{_prefix}/local/bin/ffmpeg

%files
%{_prefix}/local/bin/ffmpeg
%{_bindir}/ffmpeg

%files manpages
%{_prefix}/local/man/man1/*
%{_prefix}/local/man/man3/*
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: To Speed Up thumbnail creation - picture & video

Reindl Harald
In reply to this post by Brainiarc7


Am 22.06.20 um 10:09 schrieb Dennis Mungai:
> Do you have access to an NVIDIA GPU accelerated workflow on AWS?
>
> You may be able to get far better results by combining the use of
> scale_cuda (or scale_npp) filter(s) paired with the thumbnail_cuda filter
> for GPU accelerated thumbnail generation

may i suggest that you learn to perate your mail client and not quote
tons of useless signatures so that one don't need to seek your answer
like a needle?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: To Speed Up thumbnail creation - picture & video

Carl Eugen Hoyos-2
In reply to this post by FFmpeg-users mailing list
Am Mo., 22. Juni 2020 um 10:04 Uhr schrieb Arunava Banerjee via
ffmpeg-user <[hidden email]>:

> Could a link with more recent versions of FFMPEG be provided?

Sure:
https://ffmpeg.org/releases/ffmpeg-snapshot-git.tar.bz2

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: To Speed Up thumbnail creation - picture & video

Carl Zwanzig
In reply to this post by FFmpeg-users mailing list
On 6/21/2020 10:23 PM, Arunava Banerjee via ffmpeg-user wrote:

> ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018
That version is positively ancient in software terms. First thing is to get
a current version (the -git head version is recommended, but at least a
4.2.3 build), start from https://ffmpeg.org/download.html.


> The videos exists on AWS S3, and we are fetching them using S3 signature
> url, generating the thumbs and uploading back.
>
> We have noticed that FFMPEG takes quite sometime to create the thumbnails,
> which is creating a wait time on the part of the interface.

How much of that time is moving the data around and how much in ffmpeg? It
may be that your data pipe is slow or that it's being throttled somewhere.
(How long does it take to generate thumbs/etc from/to local storage?) A
second possibility is that your local system is underpowered for the task.
Look to those before suspecting that ffmpeg is slow.

Also, it might be cheaper, let alone faster, to use an amazon EC host to run
ffmpeg and save on the bandwidth costs of down/up-loading the data. You'll
have to run the numbers yourself to figure this out.

Later,

z!


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".