Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (13)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Qualité du média après traitement

    21 juin 2013, par

    Le bon réglage du logiciel qui traite les média est important pour un équilibre entre les partis ( bande passante de l’hébergeur, qualité du média pour le rédacteur et le visiteur, accessibilité pour le visiteur ). Comment régler la qualité de son média ?
    Plus la qualité du média est importante, plus la bande passante sera utilisée. Le visiteur avec une connexion internet à petit débit devra attendre plus longtemps. Inversement plus, la qualité du média est pauvre et donc le média devient dégradé voire (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

Sur d’autres sites (4741)

  • FFMPEG does not add images to audio

    20 février 2018, par Googlebot

    I want to create a slideshow with a background music by ffmpeg, and use the command

    ffmpeg -f concat -safe 0 -i map.txt -i audio.flac -vsync vfr -pix_fmt yuv420p -strict -2 video.mp4

    and map.txt is like

    file '1.jpg'
    duration 15
    file '2.jpg'
    duration 60

    The result is a video with the audio and blank background. If I run the above command without audio as

    ffmpeg -f concat -safe 0 -i map.txt -pix_fmt yuv420p -strict -2 video.mp4

    a perfect video of the images (the intended slideshow) is generated (but obviously without audio).

    I reckon the problem is related to synchronising the audio and images.

    This is the terminal output for the first command

    ffmpeg -f concat -safe 0 -i map.txt -i audio.flac -vsync vfr -pix_fmt yuv420p -strict -2 video.mp4
    ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 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
    [mjpeg @ 0x1cc8d40] Changeing bps to 8
    Input #0, concat, from 'map.txt':
     Duration: 00:05:48.00, start: 0.000000, bitrate: 0 kb/s
       Stream #0:0: Video: mjpeg, gray(bt470bg/unknown/unknown), 1920x1080 [SAR 72:72 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
    Input #1, flac, from 'audio.flac':
     Metadata:
       TITLE           : Speak to Me
       ARTIST          : Creator
       ALBUM           : Acoustic Hits
       track           : 14
       GENRE           : Pop
       DATE            : 2011
     Duration: 00:03:31.02, start: 0.000000, bitrate: 1026 kb/s
       Stream #1:0: Audio: flac, 44100 Hz, stereo, s16
    [libx264 @ 0x1ccdf80] using SAR=1/1
    [libx264 @ 0x1ccdf80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x1ccdf80] profile High, level 4.0
    [libx264 @ 0x1ccdf80] 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=12 lookahead_threads=2 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=25 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 'video.mp4':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
       Metadata:
         encoder         : Lavc56.60.100 libx264
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp (16 bit), 128 kb/s
       Metadata:
         encoder         : Lavc56.60.100 aac
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
     Stream #1:0 -> #0:1 (flac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [mjpeg @ 0x7fe688001ba0] Changeing bps to 8
    frame=    2 fps=0.7 q=-1.0 Lsize=    3593kB time=00:03:31.02 bitrate= 139.5kbits/s    
    video:147kB audio:3410kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.036417%
    [libx264 @ 0x1ccdf80] frame I:1     Avg QP: 2.55  size: 33683
    [libx264 @ 0x1ccdf80] frame P:1     Avg QP:19.33  size:116022
    [libx264 @ 0x1ccdf80] mb I  I16..4: 89.7%  1.1%  9.3%
    [libx264 @ 0x1ccdf80] mb P  I16..4:  0.9%  1.8% 30.1%  P16..4:  1.4%  1.5%  0.9%  0.0%  0.0%    skip:63.4%
    [libx264 @ 0x1ccdf80] 8x8 transform intra:2.1% inter:15.2%
    [libx264 @ 0x1ccdf80] coded y,uvDC,uvAC intra: 19.7% 0.0% 0.0% inter: 2.8% 0.0% 0.0%
    [libx264 @ 0x1ccdf80] i16 v,h,dc,p: 97%  2%  2%  0%
    [libx264 @ 0x1ccdf80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 12% 39%  1%  1%  2%  1%  2%  4%
    [libx264 @ 0x1ccdf80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 16% 16%  3%  4%  6%  5%  5%  4%
    [libx264 @ 0x1ccdf80] i8c dc,h,v,p: 100%  0%  0%  0%
    [libx264 @ 0x1ccdf80] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x1ccdf80] kb/s:20.65

    UPDATE (following the comment suggestion)

    ffmpeg -f concat -safe 0 -i map.txt -i audio.flac -vsync vfr -r 5 -pix_fmt yuv420p -strict -2 video.mp4
    ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 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
    [mjpeg @ 0x1fe9d80] Changeing bps to 8
    Input #0, concat, from 'map.txt':
     Duration: 00:02:28.00, start: 0.000000, bitrate: 0 kb/s
       Stream #0:0: Video: mjpeg, gray(bt470bg/unknown/unknown), 1920x1080 [SAR 72:72 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
    Input #1, flac, from 'audio.flac':
     Metadata:
       TITLE           : Speak to Me
       ARTIST          : Creator
       ALBUM           : Acoustic Hits
       track           : 14
       GENRE           : Pop
       DATE            : 2011
     Duration: 00:03:31.02, start: 0.000000, bitrate: 1026 kb/s
       Stream #1:0: Audio: flac, 44100 Hz, stereo, s16
    [libx264 @ 0x1feefc0] using SAR=1/1
    [libx264 @ 0x1feefc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x1feefc0] profile High, level 4.0
    [libx264 @ 0x1feefc0] 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=12 lookahead_threads=2 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=5 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 'video.mp4':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 5 fps, 10240 tbn, 5 tbc
       Metadata:
         encoder         : Lavc56.60.100 libx264
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp (16 bit), 128 kb/s
       Metadata:
         encoder         : Lavc56.60.100 aac
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
     Stream #1:0 -> #0:1 (flac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [mjpeg @ 0x7f74cc001ba0] Changeing bps to 8
    frame=    2 fps=0.7 q=-1.0 Lsize=    3593kB time=00:03:31.02 bitrate= 139.5kbits/s    
    video:147kB audio:3410kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.036417%
    [libx264 @ 0x1feefc0] frame I:1     Avg QP: 2.55  size: 33683
    [libx264 @ 0x1feefc0] frame P:1     Avg QP:19.33  size:116022
    [libx264 @ 0x1feefc0] mb I  I16..4: 89.7%  1.1%  9.3%
    [libx264 @ 0x1feefc0] mb P  I16..4:  0.9%  1.8% 30.1%  P16..4:  1.4%  1.5%  0.9%  0.0%  0.0%    skip:63.4%
    [libx264 @ 0x1feefc0] 8x8 transform intra:2.1% inter:15.2%
    [libx264 @ 0x1feefc0] coded y,uvDC,uvAC intra: 19.7% 0.0% 0.0% inter: 2.8% 0.0% 0.0%
    [libx264 @ 0x1feefc0] i16 v,h,dc,p: 97%  2%  2%  0%
    [libx264 @ 0x1feefc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 12% 39%  1%  1%  2%  1%  2%  4%
    [libx264 @ 0x1feefc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 16% 16%  3%  4%  6%  5%  5%  4%
    [libx264 @ 0x1feefc0] i8c dc,h,v,p: 100%  0%  0%  0%
    [libx264 @ 0x1feefc0] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x1feefc0] kb/s:20.65
  • Output Video frames are scrolling vertically when reading from rtmp source using python ffmpeg subprocess

    24 février 2018, par nkottapalli

    This is what I’m trying to do :

    (1) Read rtmp stream with ffmpeg(python subprocess) and piping to rawvideo

    (2) processing rawvideo pipe from (1) to opencv readable image using numpy

    (3) process the image from (2) using opencv for whatever application

    (4) Display or (Stream)to processed image from (3)

    This is the code I’ve written :

    FFMPEG_BIN = 'ffmpeg'

    #SOURCE -> rtmp://yourdomain/rtmpappname/streamkey
    SOURCE = 'YOUR RTMP INPUT STREAM HERE URL'

    #DESTINATION -> rtmp://yourdomain/rtmpappname/streamkey
    DESTINATION = 'YOUR RTMP PROCESSED OUTPUT STREAM URL'

    #frame width and height of source stream
    FRAME_WIDTH = 1280
    FRAME_HEIGHT = 720

    import subprocess as sp

    #read from rtmp source and output to rawvideo pipe
    cmd_video_only_in = [ FFMPEG_BIN, '-i', SOURCE, '-f', 'image2pipe', '-pix_fmt', 'bgr24', '-vcodec', 'rawvideo','-']
    video_input_stream = sp.Popen(cmd_video_only_in, stdout=sp.PIPE, bufsize=FRAME_WIDTH*FRAME_HEIGHT*3, shell=False)

    #(Optional) stream opencv processed frames to DESTINATION url with audio mapped from source, audio-video sync can be achieved by changing
    #the float value 2.00 of -itsoffset to what suits you
    #cmd_processed_stream_out = [FFMPEG_BIN,'-y','-thread_queue_size', '1024','-f', 'rawvideo', '-pix_fmt', 'bgr24', '-video_size', str(FRAME_WIDTH)+'X'+str(FRAME_HEIGHT),'-i','-','-itsoffset','2.00','-i', SOURCE,'-map','0:v:0','-map','1:a:0','-vcodec','libx264','-pix_fmt','yuv420p','-acodec','copy','-preset','ultrafast','-f','flv',DESTINATION]
    #processed_output_stream = sp.Popen(cmd_processed_stream_out, stdin=sp.PIPE, shell=False)

    import cv2
    import numpy as np
    import time

    while (True):
       raw_image = video_input_stream.stdout.read(FRAME_WIDTH*FRAME_HEIGHT*3)
       image = np.fromstring(raw_image, dtype='uint8')
       image = image.reshape((FRAME_HEIGHT,FRAME_WIDTH,3))
       #Process the image
       #any opencv based image processing can be done here eg. object detection, feature extraction, etc.,

       #Display output
       cv2.imshow('OUTPUT', image)

       #(Optional)send the processed image frames (output) to DESITNATION rtmp url
       #processed_output_stream.stdin.write(image.tostring())

       video_input_stream.stdout.flush()
       if cv2.waitKey(25) & 0xFF == ord('q'):
           video_input_stream.terminate()
           processed_output_stream.stdin.close()
           processed_output_stream.terminate()
           break

    The output frames which i’m trying to Display (using cv2.imshow) or Stream to rtmp destination are scrolling vertically from bottom to top. How do I solve this vertical scrolling issue ?

    EDIT1 : FULL LOG - streaming output to DESTINATION URL :

    $python3 processing.py
    ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 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
    ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 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
    Metadata:
     Server                NGINX RTMP (github.com/arut/nginx-rtmp-module)
     width                 1280.00
     height                720.00
     displayWidth          1280.00
     displayHeight         720.00
     duration              0.00
     framerate             25.00
     fps                   25.00
     videodatarate         0.00
     videocodecid          7.00
     audiodatarate         0.00
     audiocodecid          10.00
    Input #0, live_flv, from 'SOURCE URL':
     Metadata:
       Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
       displayWidth    : 1280
       displayHeight   : 720
       fps             : 25
       profile         :
       level           :
     Duration: 00:00:00.00, start: 10435.038000, bitrate: N/A
       Stream #0:0: Video: h264 (Main), yuv420p, 1280x720, 25 fps, 25 tbr, 1k tbn, 2k tbc
       Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp
    Output #0, image2pipe, to 'pipe:':
     Metadata:
       Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
       displayWidth    : 1280
       displayHeight   : 720
       fps             : 25
       profile         :
       level           :
       encoder         : Lavf56.40.101
       Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24, 1280x720, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
       Metadata:
         encoder         : Lavc56.60.100 rawvideo
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
    Press [q] to stop, [?] for help
    Input #0, rawvideo, from 'pipe:':
     Duration: N/A, start: 0.000000, bitrate: 552960 kb/s
       Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24, 1280x720, 552960 kb/s, 25 tbr, 25 tbn, 25 tbc
    Metadata:
     Server                NGINX RTMP (github.com/arut/nginx-rtmp-module)
     width                 1280.00
     height                720.00
     displayWidth          1280.00
     displayHeight         720.00
     duration              0.00
     framerate             25.00
     fps                   25.00
     videodatarate         0.00
     videocodecid          7.00
     audiodatarate         0.00
     audiocodecid          10.00
    Input #1, live_flv, from 'SOURCE URL':
     Metadata:
       Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
       displayWidth    : 1280
       displayHeight   : 720
       fps             : 25
       profile         :
       level           :
     Duration: 00:00:00.00, start: 10438.591000, bitrate: N/A
       Stream #1:0: Video: h264 (Main), yuv420p, 1280x720, 25 fps, 25 tbr, 1k tbn, 2k tbc
       Stream #1:1: Audio: aac (LC), 44100 Hz, stereo, fltp
    [libx264 @ 0x19c1820] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x19c1820] profile Constrained Baseline, level 3.1
    [libx264 @ 0x19c1820] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
    [flv @ 0x19c0880] Codec for stream 1 does not use global headers but container format requires global headers
    Output #0, flv, to 'DESINATION URL':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1280x720, q=-1--1, 25 fps, 1k tbn, 25 tbc
       Metadata:
         encoder         : Lavc56.60.100 libx264
       Stream #0:1: Audio: aac ([10][0][0][0] / 0x000A), 44100 Hz, stereo
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
     Stream #1:1 -> #0:1 (copy)
    frame=    3 fps=1.0 q=-0.0 size=    8100kB time=00:00:00.12 bitrate=552960.0kbits/[live_flv @ 0x19b1900] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    frame=   45 fps=0.0 q=20.0 size=     427kB time=00:00:01.28 bitrate=2730.9kbits/s
    frame=  123 fps= 34 q=-0.0 size=  332100kB time=00:00:04.92 bitrate=552960.0kbits/
    frame=   58 fps= 57 q=21.0 size=     608kB time=00:00:01.80 bitrate=2766.4kbits/s
    frame=  136 fps= 33 q=-0.0 size=  367200kB time=00:00:05.44 bitrate=552960.0kbits/
    frame=   70 fps= 46 q=20.0 size=     737kB time=00:00:02.28 bitrate=2648.5kbits/s
    frame=  149 fps= 32 q=-0.0 size=  402300kB time=00:00:05.96 bitrate=552960.0kbits/
  • using ffmpeg for development, libavutil/error environment not OK

    26 février 2018, par luoyanghero

    I want to build a latest ffmpeg development library. I refered the docker script
    https://github.com/jrottenberg/ffmpeg/blob/master/docker-images/3.4/Dockerfile’,
    and I changed the docker file to a shell file. Download all source files,
    compile all dependency source and ffmpeg 3.4.1 source.
    The following is my changed shell script.

    #!/bin/sh
    export           PKG_CONFIG_PATH=/opt/ffmpeg/lib/pkgconfig
              LD_LIBRARY_PATH=/opt/ffmpeg/lib
              PREFIX=/opt/ffmpeg
              MAKEFLAGS="-j4"

    export         FFMPEG_VERSION=3.4.1    
    export         FDKAAC_VERSION=0.1.5    
    export         LAME_VERSION=3.99.5    
    export         LIBASS_VERSION=0.13.7  
    export         OGG_VERSION=1.3.2      
    export         OPENCOREAMR_VERSION=0.1.4
    export         OPUS_VERSION=1.2        
    export         OPENJPEG_VERSION=2.1.2
    export         THEORA_VERSION=1.1.1  
    export         VORBIS_VERSION=1.3.5  
    export         VPX_VERSION=1.6.1    
    export         X264_VERSION=20170226-2245-stable
    export         X265_VERSION=2.3          
    export         XVID_VERSION=1.3.4      
    export         FREETYPE_VERSION=2.5.5  
    export         FRIBIDI_VERSION=0.19.7
    export         FONTCONFIG_VERSION=2.12.4
    export         LIBVIDSTAB_VERSION=1.1.0
               SRC=/usr/local

               OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692  libogg-1.3.2.tar.gz"
               OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9  opus-1.2.tar.gz"
               VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce  libvorbis-1.3.5.tar.gz"
               THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b  libtheora-1.1.1.tar.gz"
               XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f  xvidcore-1.3.4.tar.gz"
               FREETYPE_SHA256SUM="5d03dd76c2171a7601e9ce10551d52d4471cf92cd205948e60289251daddffa8  freetype-2.5.5.tar.gz"
               LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb  v1.1.0.tar.gz"
               LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7  0.13.7.tar.gz"
               FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8  0.19.7.tar.gz"


           apt-get -y update
           apt-get install -y  --no-install-recommends ca-certificates expat libgomp1
           apt-get autoremove -y
           apt-get clean -y
    apt-get install -y --no-install-recommends autoconf
    apt-get install -y --no-install-recommends automake
    apt-get install -y --no-install-recommends cmake
    apt-get install -y --no-install-recommends curl
    apt-get install -y --no-install-recommends bzip2
    apt-get install -y --no-install-recommends libexpat1-dev
    apt-get install -y --no-install-recommends g++
    apt-get install -y --no-install-recommends gcc
    apt-get install -y --no-install-recommends git
    apt-get install -y --no-install-recommends gperf
    apt-get install -y --no-install-recommends libtool
    apt-get install -y --no-install-recommends make
    apt-get install -y --no-install-recommends nasm
    apt-get install -y --no-install-recommends perl
    apt-get install -y --no-install-recommends pkg-config
    apt-get install -y --no-install-recommends python
    apt-get install -y --no-install-recommends libssl-dev
    apt-get install -y --no-install-recommends yasm
    apt-get install -y --no-install-recommends zlib1g-dev

    ############LIB env
    ## opencore-amr https://sourceforge.net/projects/opencore-amr/
    ####OnLine    
    #        DIR=/tmp/opencore-amr && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sL https://downloads.sf.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \
    #        tar -zx --strip-components=1 && \
    #        ./configure --prefix="${PREFIX}" --enable-shared  && \
    #        make && \
    #        make install && \
    #        rm -rf ${DIR}
    ##curl -sL https://downloads.sf.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.4.tar.gz | tar -zx --strip-components=1

    ####OffLine    
           DIR=opencore-amr-${OPENCOREAMR_VERSION} && \
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           ./configure --prefix="${PREFIX}" --enable-shared  && \
           make && \
           make install && \
           cd ..
    ### x264 http://www.videolan.org/developers/x264.html
    #    
    #        DIR=/tmp/x264 && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \
    #        tar -jx --strip-components=1 && \
    #        ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \
    #        make && \
    #        make install && \
    #        rm -rf ${DIR}
    ####OffLine    
           DIR=x264-snapshot-${X264_VERSION}
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.bz2 && \
           cd ./${DIR} && \
           ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \
           make && \
           make install && \
           cd ..
    #### x265 http://x265.org/
    #    
    #        DIR=/tmp/x265 && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sL https://download.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz  | \
    #        tar -zx && \
    #        cd x265_${X265_VERSION}/build/linux && \
    #        sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\/opt\/ffmpeg/" multilib.sh && \
    #        sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \
    #        ./multilib.sh && \
    #        make -C 8bit install
    ###        rm -rf ${DIR}
    ####OffLine    
           DIR=x265_${X265_VERSION}
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR}/build/linux && \
           sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\/opt\/ffmpeg/" multilib.sh && \
           sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \
           ./multilib.sh && \
           make -C 8bit install
           cd ../../../
    #### libogg https://www.xiph.org/ogg/
    #    
    #        DIR=/tmp/ogg && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \
    #        echo ${OGG_SHA256SUM} | sha256sum --check && \
    #        tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \
    #        ./configure --prefix="${PREFIX}" --enable-shared  && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}
    ####OffLine    
           DIR=libogg-${OGG_VERSION}
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           ./configure --prefix="${PREFIX}" --enable-shared  && \
           make && \
           make install && \
           cd ..
    #### libopus https://www.opus-codec.org/
    #    
    #        DIR=/tmp/opus && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \
    #        echo ${OPUS_SHA256SUM} | sha256sum --check && \
    #        tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \
    #        autoreconf -fiv && \
    #        ./configure --prefix="${PREFIX}" --enable-shared && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}
    ####OffLine    
           DIR=opus-${OPUS_VERSION}
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           autoreconf -fiv && \
           ./configure --prefix="${PREFIX}" --enable-shared && \
           make && \
           make install && \
           cd ..
    #### libvorbis https://xiph.org/vorbis/
    #    
    #        DIR=/tmp/vorbis && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \
    #        echo ${VORBIS_SHA256SUM} | sha256sum --check && \
    #        tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \
    #        ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}
    ####OffLine    
           DIR=libvorbis-${VORBIS_VERSION}
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \
           make && \
           make install && \
           cd ..
    #### libtheora http://www.theora.org/
    #    
    #        DIR=/tmp/theora && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \
    #        echo ${THEORA_SHA256SUM} | sha256sum --check && \
    #        tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \
    #        ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}
    ####OffLine    
           DIR=libtheora-${THEORA_VERSION}
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \
           make && \
           make install && \
           cd ..
    #### libvpx https://www.webmproject.org/code/
    #    
    #        DIR=/tmp/vpx && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \
    #        tar -zx --strip-components=1 && \
    #        ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-pic --enable-shared \
    #        --disable-debug --disable-examples --disable-docs --disable-install-bins  && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}

    #####OffLine    
           DIR=libvpx-1.6.1
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-pic --enable-shared \
           --disable-debug --disable-examples --disable-docs --disable-install-bins  && \
           make && \
           make install && \
           cd ..
    #### libmp3lame http://lame.sourceforge.net/
    #    
    #        DIR=/tmp/lame && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sL https://downloads.sf.net/project/lame/lame/${LAME_VERSION%.*}/lame-${LAME_VERSION}.tar.gz | \
    #        tar -zx --strip-components=1 && \
    #        ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --enable-pic --disable-frontend && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}

    ####OffLine    
           DIR=lame-3.99.5
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --enable-pic --disable-frontend && \
           make && \
           make install && \
           cd ..
    #### xvid https://www.xvid.com/
    #    
    #        DIR=/tmp/xvid && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \
    #        echo ${XVID_SHA256SUM} | sha256sum --check && \
    #        tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \
    #        cd xvidcore/build/generic && \
    #        ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --datadir="${DIR}" --enable-shared --enable-shared && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}

    ####OffLine    
           DIR=xvidcore
           BASE_DIR=`pwd`
           rm -rf ./${DIR}-1.3.4
           tar -xvf ./${DIR}-1.3.4.tar.gz && \
           cd ./${DIR} && \
           cd ./build/generic && \
           ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --datadir="${BASE_DIR}/${DIR}" --enable-shared --enable-shared && \
           make && \
           make install && \
           cd ../../../
    #### fdk-aac https://github.com/mstorsjo/fdk-aac
    #    
    #        DIR=/tmp/fdk-aac && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \
    #        tar -zx --strip-components=1 && \
    #        autoreconf -fiv && \
    #        ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}

    ####OffLine    
           BASE_DIR=`pwd`
           DIR=fdk-aac-0.1.5
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           autoreconf -fiv && \
           ./configure --prefix="${PREFIX}" --enable-shared --datadir="${BASE_DIR}/${DIR}" && \
           make && \
           make install && \
           cd ..
    ## openjpeg https://github.com/uclouvain/openjpeg

    #        DIR=/tmp/openjpeg && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \
    #        tar -zx --strip-components=1 && \
    #        cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}

    ####OffLine    
           DIR=openjpeg-2.1.2
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
           make && \
           make install && \
           cd ..
    ### freetype https://www.freetype.org/
    ##RUN  \
    ##        DIR=/tmp/freetype && \
    ##        mkdir -p ${DIR} && \
    ##        cd ${DIR} && \
    ##        curl -sLO http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \
    ##        echo ${FREETYPE_SHA256SUM} | sha256sum --check && \
    ##        tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \
    ##        ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
    ##        make && \
    ##        make install && \
    ##        rm -rf ${DIR}

    ###OffLine    
           DIR=freetype-${FREETYPE_VERSION}
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
           make && \
           make install && \
           cd ..

    ### libvstab https://github.com/georgmartius/vid.stab
    #
    #        DIR=/tmp/vid.stab && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz &&\
    #        echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \
    #        tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \
    #        cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}

    ####OffLine    
           DIR=vid.stab
           rm -rf ./${DIR}-1.1.0
           tar -xvf ./${DIR}_v1.1.0.tar.gz && \
           cd ./${DIR}-1.1.0 && \
           cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
           make && \
           make install && \
           cd ..
    ### fridibi https://www.fribidi.org/
    # + https://github.com/fribidi/fribidi/issues/8
    #
    #        DIR=/tmp/fribidi && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \
    #        echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \
    #        tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \
    #        sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib/' Makefile.am && \
    #        ./bootstrap --no-config && \
    #        ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
    #        make && \
    #        make install
    #        rm -rf ${DIR}

    ####OffLine    
           DIR=fribidi-0.19.7 && \
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.gz && \
           cd ./${DIR} && \
           sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib/' Makefile.am && \
           ./bootstrap --no-config && \
           ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
           make && \
           make install && \
           cd ..
    ### fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/

    #        DIR=/tmp/fontconfig && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 &&\
    #        tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \
    #        ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}

    ####OffLine    
           DIR=fontconfig-2.12.4 && \
           rm -rf ./${DIR}
           tar -xvf ./${DIR}.tar.bz2 && \
           cd ./${DIR} && \
           ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
           make && \
           make install && \
           cd ..
    ## libass https://github.com/libass/libass
    #need add PKG_CONFIG_PATH
    #
    #        DIR=/tmp/libass && \
    #        rm -rf ${DIR} && \
    #        mkdir -p ${DIR} && \
    #        cd ${DIR} && \
    #        curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz &&\
    #        echo ${LIBASS_SHA256SUM} | sha256sum --check && \
    #        tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \
    #        ./autogen.sh && \
    #        ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
    #        make && \
    #        make install
    ##        rm -rf ${DIR}

    ####OffLine    
           DIR=libass && \
           rm -rf ./${DIR}-0.13.7
           tar -xvf ./${DIR}_0.13.7.tar.gz && \
           cd ./${DIR}-0.13.7 && \
           ./autogen.sh && \
           ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
           make && \
           make install && \
           cd ..
    ### ffmpeg https://ffmpeg.org/

    #####OffLine
           DIR=ffmpeg341 && \
           mkdir -p ${DIR} && cd ${DIR} && \
           rm -rf ffmpeg-${FFMPEG_VERSION} && \
           tar -xvf ffmpeg-${FFMPEG_VERSION}.tar.gz && \
           cd ffmpeg-${FFMPEG_VERSION} && \
           ./configure \
           --enable-debug \
           --enable-doc \
           --disable-ffplay \
           --enable-shared \
           --enable-avresample \
           --enable-libopencore-amrnb \
           --enable-libopencore-amrwb \
           --enable-gpl \
           --enable-libass \
           --enable-libfreetype \
           --enable-libvidstab \
           --enable-libmp3lame \
           --enable-libopenjpeg \
           --enable-libopus \
           --enable-libtheora \
           --enable-libvorbis \
           --enable-libvpx \
           --enable-libx265 \
           --enable-libxvid \
           --enable-libx264 \
           --enable-nonfree \
           --enable-openssl \
           --enable-libfdk_aac \
           --enable-postproc \
           --enable-small \
           --enable-version3 \
           --extra-cflags="-I${PREFIX}/include" \
           --extra-ldflags="-L${PREFIX}/lib" \
           --extra-libs=-ldl \
           --prefix="${PREFIX}" && \
           make && \
           make install && \
           make distclean && \
           hash -r && \
           cd tools && \
           make qt-faststart && \
           cp qt-faststart ${PREFIX}/bin
            cd ../../

    I try to run my compiled ffmpeg, it is OK.

    #

    export LD_LIBRARY_PATH=/opt/ffmpeg/lib/
    /opt/ffmpeg/bin/ffmpeg -i "/home/luoy/Videos/芳华.2017.TC720P独家高清中字.mp4" -ss 00:00:00 -t 00:00:01 -f image2 -y "./2_%04d.bmp"
    ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
    built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.6) 20160609
    configuration: --enable-debug --enable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libass --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib --extra-libs=-ldl --prefix=/opt/ffmpeg
    libavutil 55. 78.100 / 55. 78.100
    libavcodec 57.107.100 / 57.107.100
    libavformat 57. 83.100 / 57. 83.100
    libavdevice 57. 10.100 / 57. 10.100
    libavfilter 6.107.100 / 6.107.100
    libavresample 3. 7. 0 / 3. 7. 0
    libswscale 4. 8.100 / 4. 8.100
    libswresample 2. 9.100 / 2. 9.100
    libpostproc 54. 7.100 / 54. 7.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/luoy/Videos/芳华.2017.TC720P独家高清中字.mp4':
    Metadata:
    major_brand : isom
    minor_version : 1
    compatible_brands: isomavc1
    creation_time : 2017-12-15T16:28:00.000000Z
    encoder : Lite MP4 Tool v2.3
    Duration: 02:09:09.24, start: 0.000000, bitrate: 1587 kb/s
    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 1280x720, 1456 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
    creation_time : 2017-12-15T16:28:00.000000Z
    handler_name : Imported with GPAC 0.4.6-DEV (internal rev. 5)
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
    creation_time : 2017-12-15T16:28:45.000000Z
    handler_name : GPAC ISO Audio Handler
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 (native) -> bmp (native))
    Press [q] to stop, [?] for help
    Output #0, image2, to './2_%04d.bmp':
    Metadata:
    major_brand : isom
    minor_version : 1
    compatible_brands: isomavc1
    encoder : Lavf57.83.100
    Stream #0:0(und): Video: bmp, bgr24, 1280x720, q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
    Metadata:
    creation_time : 2017-12-15T16:28:00.000000Z
    handler_name : Imported with GPAC 0.4.6-DEV (internal rev. 5)
    encoder : Lavc57.107.100 bmp
    frame= 24 fps=0.0 q=-0.0 Lsize=N/A time=00:00:01.00 bitrate=N/A dup=1 drop=0 speed= 5.6x
    video:64801kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

    #

    Now I write a simple code, save as a 0_hello_world.c file.

    #

    #include "libavcodec/avcodec.h"
    #include "libavformat/avformat.h"
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include "libavutil/error.h"
    int main(int argc, const char *argv[])
    {
    av_register_all();
    int response = 0;
    char *pchar;
    // pchar = av_err2str(response);
    return 0;
    }

    #

    Use the follow command for make, it’s OK.

    #

    gcc -g -Wall -o build/hello_world -lz 0_hello_world.c
    -lavformat -lavcodec -lswscale
    -I/opt/ffmpeg/include -L/opt/ffmpeg/lib

    #

    But when I use the "av_err2str" function(uncomment this line) :
    ’pchar = av_err2str(response) ;’
    compile show the following error :

    #

    gcc -g -Wall -o build/hello_world -lz 0_hello_world.c
    -lavformat -lavcodec -lswscale
    -I/opt/ffmpeg/include -L/opt/ffmpeg/lib
    0_hello_world.c: In function ‘main’:
    0_hello_world.c:16:9: warning: variable ‘pchar’ set but not used [-Wunused-but-set-variable]
    char *pchar;
    ^
    /usr/bin/ld: /tmp/ccgJJ9CV.o: undefined reference to symbol 'av_strerror@@LIBAVUTIL_55'
    /opt/ffmpeg/lib/libavutil.so.55: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    Makefile:10: recipe for target 'hello_world' failed
    make: *** [hello_world] Error 1

    #

    As I know "av_register_all" use the "libavformat/avformat.h" header ; "av_err2str" use the "libavutil/error.h" header.
    Both the two headers I have included, why "av_err2str" is not OK ?
    I guess this is my environment not OK. How can I find the error ?
    I have checked my LD_LIBRARY_PATH, it is OK.

    #

    $ echo $LD_LIBRARY_PATH
    /opt/ffmpeg/lib: