Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (77)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (11120)

  • TCL command prompt crashed with the error "ffmpeg.exe stopped working" with tcl version 8.0 and window 7

    9 février 2019, par M. D. P

    TCL command prompt crashed with the error "ffmpeg.exe has stopped working" with tcl version 8.0 and window 7 32 bit. my code file is "live.tcl" which is as follow :

    proc live {} {

    exec ffmpeg -f dshow -s 1280x720 -i "video=Logitech HD Webcam C525" -f sdl2 - >& c:/test/temp.txt &

    }
    live

    On the other hand same my code for video capturing i.e "videocapture.tcl" works on the same tclsh command prompt on windows 7. my tcl code for "videocapture.tcl" is :

    proc videocapture {} {

    exec ffmpeg -f dshow -t 00:00:10 -i "video=Integrated Webcam" c:/test/sample-a.avi >& temp.txt &

    }
    videocapture

    error report is as follow :

    ffmpeg started on 2017-11-22 at 10:56:04
    Report written to "ffmpeg-20171122-105604.log"
    Command line:
    ffmpeg -f dshow -s 1280x720 -i "video=HD Webcam C525" -report -f sdl2 -
    ffmpeg version N-89127-g8f4702a93f Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 7.2.0 (GCC)
     configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
     libavutil      56.  0.100 / 56.  0.100
     libavcodec     58.  3.103 / 58.  3.103
     libavformat    58.  2.100 / 58.  2.100
     libavdevice    58.  0.100 / 58.  0.100
     libavfilter     7.  2.100 /  7.  2.100
     libswscale      5.  0.101 /  5.  0.101
     libswresample   3.  0.101 /  3.  0.101
     libpostproc    55.  0.100 / 55.  0.100
    Splitting the commandline.
    Reading option '-f' ... matched as option 'f' (force format) with argument 'dshow'.
    Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '1280x720'.
    Reading option '-i' ... matched as input url with argument 'video=HD Webcam C525'.
    Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
    Reading option '-f' ... matched as option 'f' (force format) with argument 'sdl2'.
    Reading option '-' ... matched as output url.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option report (generate a report) with argument 1.
    Successfully parsed a group of options.
    Parsing a group of options: input url video=HD Webcam C525.
    Applying option f (force format) with argument dshow.
    Applying option s (set frame size (WxH or abbreviation)) with argument 1280x720.
    Successfully parsed a group of options.
    Opening an input file: video=HD Webcam C525.
    [dshow @ 03dfca20] Selecting pin Capture on video
    dshow passing through packet of type video size  1843200 timestamp 664898760000 orig timestamp 664898643970 graph timestamp 664898760000 diff 116030 HD Webcam C525
    [dshow @ 03dfca20] All info found
    Input #0, dshow, from 'video=HD Webcam C525':
     Duration: N/A, start: 66489.876000, bitrate: N/A
    Stream #0:0, 1, 1/10000000: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720, 10 fps, 10 tbr, 10000k tbn, 10000k tbc
    Successfully opened the file.
    Parsing a group of options: output url -.
    Applying option f (force format) with argument sdl2.
    Successfully parsed a group of options.
    Opening an output file: -.
    Successfully opened the file.
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
    Press [q] to stop, [?] for help
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [rawvideo @ 03e01660] PACKET SIZE: 1843200, STRIDE: 2560
    detected 1 logical cores
    [graph 0 input from stream 0:0 @ 03e06ae0] Setting 'video_size' to value '1280x720'
    [graph 0 input from stream 0:0 @ 03e06ae0] Setting 'pix_fmt' to value '1'
    [graph 0 input from stream 0:0 @ 03e06ae0] Setting 'time_base' to value '1/10000000'
    [graph 0 input from stream 0:0 @ 03e06ae0] Setting 'pixel_aspect' to value '0/1'
    [graph 0 input from stream 0:0 @ 03e06ae0] Setting 'sws_param' to value 'flags=2'
    [graph 0 input from stream 0:0 @ 03e06ae0] Setting 'frame_rate' to value '10000000/1000000'
    [graph 0 input from stream 0:0 @ 03e06ae0] w:1280 h:720 pixfmt:yuyv422 tb:1/10000000 fr:10000000/1000000 sar:0/1 sws_param:flags=2
    [AVFilterGraph @ 03de2780] query_formats: 3 queried, 2 merged, 0 already done, 0 delayed
    dshow passing through packet of type video size  1843200 timestamp 664899770000 orig timestamp 664899643970 graph timestamp 664899770000 diff 126030 HD Webcam C525
    dshow passing through packet of type video size  1843200 timestamp 664900890000 orig timestamp 664900643970 graph timestamp 664900890000 diff 246030 HD Webcam C525
    dshow passing through packet of type video size  1843200 timestamp 664902040000 orig timestamp 664901643970 graph timestamp 664902040000 diff 396030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664902650000 orig timestamp 664902643970 graph timestamp 664902650000 diff 6030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664903610000 orig timestamp 664903643970 graph timestamp 664903610000 diff -33970 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664904570000 orig timestamp 664904643970 graph timestamp 664904570000 diff -73970 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664905520000 orig timestamp 664905643970 graph timestamp 664905520000 diff -123970 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664929720000 orig timestamp 664906643970 graph timestamp 664929720000 diff 23076030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664929760000 orig timestamp 664907643970 graph timestamp 664929760000 diff 22116030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664929790000 orig timestamp 664908643970 graph timestamp 664929790000 diff 21146030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664929820000 orig timestamp 664909643970 graph timestamp 664929820000 diff 20176030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664929870000 orig timestamp 664910643970 graph timestamp 664929870000 diff 19226030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664929910000 orig timestamp 664911643970 graph timestamp 664929910000 diff 18266030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664929940000 orig timestamp 664912643970 graph timestamp 664929940000 diff 17296030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664929980000 orig timestamp 664913643970 graph timestamp 664929980000 diff 16336030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664930030000 orig timestamp 664914643970 graph timestamp 664930030000 diff 15386030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
    dshow passing through packet of type video size  1843200 timestamp 664930070000 orig timestamp 664915643970 graph timestamp 664930070000 diff 14426030 HD Webcam C525
    [dshow @ 03dfca20] real-time buffer [HD Webcam C525] [video input] too full or near too full (121% of size: 3041280 [rtbufsize parameter])! frame dropped!
  • FFMPEG process Killed and raises returncode 137 when executed through python3 subprocess.Popen but runs fine from the command line

    22 novembre 2017, par Stuart Clarke

    I’m not sure if this is the best way to go about this, but I have another question here which I don’t think was asked very well (or more to the point I realised the actual problem and have a simpler way of asking for help). If you can answer this question you’ll have the answer to the other.

    I’m using python 3.5.2 and ffmpeg 3.3.4-2 and have this function to run my ffmpeg commands :

    def ffmpegPro(args):
       err = None
       for i, arg in enumerate(args):
           if(" " in arg or "(" in arg or "[" in arg):
               args[i] = "\"" + arg + "\""
       command = [
           ffmpegcmd, '-y',
           '-loglevel', loglevel
       ] + args
       commandStr = " ".join(command)
       ffmpeg = subprocess.Popen(commandStr, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True, shell=True)
       out, err = ffmpeg.communicate()
       if ffmpeg.returncode != 0:
           print(commandStr + "\n" + "ERROR CODE: " + str(ffmpeg.returncode))
           raise Exception(err)

    When I pass the following args the returncode is 137 and the process is Killed. This only occurs when executed in python, when I run the same command at the command line it executes as expected.

    ['-i', '/var/www/temp/film.mp4', '-vf', 'scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:x=(1920-iw)/2:y=(1080-ih)/2:color=black', '/var/www/temp/videoHD.mp4']

    The resulting command is :

    ffmpeg -y -loglevel verbose -i /var/www/temp/film.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:x=(1920-iw)/2:y=(1080-ih)/2:color=black" /var/www/temp/videoHD.mp4

    When executed through python :

    ERROR CODE: 137
    Traceback (most recent call last):
     File "getInsta2.py", line 740, in <module>
       populate(media_feed, last, saved)
     File "getInsta2.py", line 679, in populate
       videoPost(media, hasVids, thisSaved)
     File "getInsta2.py", line 639, in videoPost
       processVideo(film, final, noMusic, audios, lengths)
     File "getInsta2.py", line 358, in processVideo
       ffmpegPro(args)
     File "getInsta2.py", line 170, in ffmpegPro
       raise Exception(err)
    Exception: ffmpeg version 3.3.4-2~16.04.york0 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='2~16.04.york0' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --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-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --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-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 58.100 / 55. 58.100
     libavcodec     57. 89.100 / 57. 89.100
     libavformat    57. 71.100 / 57. 71.100
     libavdevice    57.  6.100 / 57.  6.100
     libavfilter     6. 82.100 /  6. 82.100
     libavresample   3.  5.  0 /  3.  5.  0
     libswscale      4.  6.100 /  4.  6.100
     libswresample   2.  7.100 /  2.  7.100
     libpostproc    54.  5.100 / 54.  5.100
    [h264 @ 0x7fa3db55a560] Reinit context to 640x368, pix_fmt: yuv420p
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/temp/film.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.71.100
     Duration: 00:06:19.80, start: 0.000000, bitrate: 451 kb/s
       Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 640x358 (640x368), 313 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [h264 @ 0x7fa3db59c700] Reinit context to 640x368, pix_fmt: yuv420p
    [graph_1_in_0_1 @ 0x7fa3db7115e0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
    [Parsed_scale_0 @ 0x7fa3db72e000] w:1920 h:1080 flags:'bicubic' interl:0
    [graph 0 input from stream 0:0 @ 0x7fa3db72f6a0] w:640 h:358 pixfmt:yuv420p tb:1/15360 fr:30/1 sar:0/1 sws_param:flags=2
    [Parsed_scale_0 @ 0x7fa3db72e000] w:640 h:358 fmt:yuv420p sar:0/1 -> w:1920 h:1074 fmt:yuv420p sar:0/1 flags:0x4
    [Parsed_pad_1 @ 0x7fa3db72eac0] w:1920 h:1074 -> w:1920 h:1080 x:0 y:2 color:0x000000FF
    [libx264 @ 0x7fa3db7309e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x7fa3db7309e0] profile High, level 4.0
    [libx264 @ 0x7fa3db7309e0] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=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 '/var/www/temp/videoHD.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.71.100
       Stream #0:0(und): Video: h264 (libx264), 1 reference frame ([33][0][0][0] / 0x0021), yuv420p(left), 1920x1080, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Lavc57.89.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
       Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, delay 1024, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
         encoder         : Lavc57.89.100 aac
    Killed
    </module>

    Note the Killed at the end. This occurs just before any processing begins.

    BUT when run from the command line (cutting and pasting the command as outputted by the code) we get :

    ffmpeg version 3.3.4-2~16.04.york0 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='2~16.04.york0' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --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-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --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-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 58.100 / 55. 58.100
     libavcodec     57. 89.100 / 57. 89.100
     libavformat    57. 71.100 / 57. 71.100
     libavdevice    57.  6.100 / 57.  6.100
     libavfilter     6. 82.100 /  6. 82.100
     libavresample   3.  5.  0 /  3.  5.  0
     libswscale      4.  6.100 /  4.  6.100
     libswresample   2.  7.100 /  2.  7.100
     libpostproc    54.  5.100 / 54.  5.100
    [h264 @ 0x7f68c918f560] Reinit context to 640x368, pix_fmt: yuv420p
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/temp/film.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.71.100
     Duration: 00:06:19.80, start: 0.000000, bitrate: 451 kb/s
       Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 640x358 (640x368), 313 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [h264 @ 0x7f68c91d1700] Reinit context to 640x368, pix_fmt: yuv420p
    [graph_1_in_0_1 @ 0x7f68c93465e0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
    [Parsed_scale_0 @ 0x7f68c9363000] w:1920 h:1080 flags:'bicubic' interl:0
    [graph 0 input from stream 0:0 @ 0x7f68c93646a0] w:640 h:358 pixfmt:yuv420p tb:1/15360 fr:30/1 sar:0/1 sws_param:flags=2
    [Parsed_scale_0 @ 0x7f68c9363000] w:640 h:358 fmt:yuv420p sar:0/1 -> w:1920 h:1074 fmt:yuv420p sar:0/1 flags:0x4
    [Parsed_pad_1 @ 0x7f68c9363ac0] w:1920 h:1074 -> w:1920 h:1080 x:0 y:2 color:0x000000FF
    [libx264 @ 0x7f68c93659e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x7f68c93659e0] profile High, level 4.0
    [libx264 @ 0x7f68c93659e0] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=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 '/var/www/temp/videoHD.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.71.100
       Stream #0:0(und): Video: h264 (libx264), 1 reference frame ([33][0][0][0] / 0x0021), yuv420p(left), 1920x1080, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Lavc57.89.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
       Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, delay 1024, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
         encoder         : Lavc57.89.100 aac
    frame=   46 fps=0.0 q=0.0 size=       0kB time=00:00:01.62 bitrate=   0.0kbits/s
    frame=   59 fps= 46 q=29.0 size=     116kB time=00:00:02.04 bitrate= 464.8kbits/
    frame=   72 fps= 40 q=29.0 size=     203kB time=00:00:02.49 bitrate= 667.2kbits/
    frame=   84 fps= 36 q=29.0 size=     308kB time=00:00:02.88 bitrate= 875.9kbits/
       Blah
       Blah
       Blah
    frame=11351 fps= 21 q=26.0 size=   97572kB time=00:06:18.45 bitrate=2112.1kbits/
    frame=11367 fps= 21 q=29.0 size=   97732kB time=00:06:18.98 bitrate=2112.5kbits/
    frame=11384 fps= 22 q=29.0 size=   97809kB time=00:06:19.56 bitrate=2111.0kbits/
    No more output streams to write to, finishing.
    frame=11392 fps= 21 q=-1.0 Lsize=   98519kB time=00:06:19.77 bitrate=2125.1kbits/s speed=0.715x    
    video:92124kB audio:5986kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.416313%
    Input file #0 (/var/www/temp/film.mp4):
     Input stream #0:0 (video): 11392 packets read (14892948 bytes); 11392 frames decoded;
     Input stream #0:1 (audio): 17803 packets read (6112540 bytes); 17802 frames decoded (18229248 samples);
     Total: 29195 packets (21005488 bytes) demuxed
    Output file #0 (/var/www/temp/videoHD.mp4):
     Output stream #0:0 (video): 11392 frames encoded; 11392 packets muxed (94334785 bytes);
     Output stream #0:1 (audio): 17802 frames encoded (18229248 samples); 17803 packets muxed (6129981 bytes);
     Total: 29195 packets (100464766 bytes) muxed
    [libx264 @ 0x7f68c93659e0] frame I:74    Avg QP:19.08  size: 51540
    [libx264 @ 0x7f68c93659e0] frame P:3506  Avg QP:21.34  size: 19348
    [libx264 @ 0x7f68c93659e0] frame B:7812  Avg QP:24.07  size:  2904
    [libx264 @ 0x7f68c93659e0] consecutive B-frames:  1.3% 20.2%  4.6% 73.9%
    [libx264 @ 0x7f68c93659e0] mb I  I16..4: 19.7% 73.6%  6.7%
    [libx264 @ 0x7f68c93659e0] mb P  I16..4:  3.2%  6.4%  0.1%  P16..4: 52.5%  7.6%  2.6%  0.0%  0.0%    skip:27.6%
    [libx264 @ 0x7f68c93659e0] mb B  I16..4:  0.2%  0.2%  0.0%  B16..8: 23.2%  0.4%  0.0%  direct: 0.5%  skip:75.5%  L0:51.8% L1:46.6% BI: 1.6%
    [libx264 @ 0x7f68c93659e0] 8x8 transform intra:66.4% inter:94.0%
    [libx264 @ 0x7f68c93659e0] coded y,uvDC,uvAC intra: 33.6% 53.4% 7.3% inter: 5.3% 14.2% 0.0%
    [libx264 @ 0x7f68c93659e0] i16 v,h,dc,p: 22% 27%  5% 46%
    [libx264 @ 0x7f68c93659e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 19% 20%  4%  7%  7%  7%  5%  4%
    [libx264 @ 0x7f68c93659e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 28% 11%  3%  9%  7%  6%  3%  2%
    [libx264 @ 0x7f68c93659e0] i8c dc,h,v,p: 49% 21% 20% 10%
    [libx264 @ 0x7f68c93659e0] Weighted P-Frames: Y:0.5% UV:0.1%
    [libx264 @ 0x7f68c93659e0] ref P L0: 63.4%  8.9% 21.4%  6.3%  0.0%
    [libx264 @ 0x7f68c93659e0] ref B L0: 89.3%  9.1%  1.6%
    [libx264 @ 0x7f68c93659e0] ref B L1: 98.1%  1.9%
    [libx264 @ 0x7f68c93659e0] kb/s:1987.38
    [aac @ 0x7f68c9366e80] Qavg: 1160.814

    and the output video is fine.

    Why would this process be killed by python ?

    Thanks,

    Stu

  • Hikvision NVR video conversion ffmpeg

    6 août 2024, par astralmaster

    I have a Hikvision NVR that stores security camera footage that I need to display on a website. I know that Hikvision uses proprietary H.264 codec that makes it impossible to play (coherently) in popular video players, like VLC, unless you install that codec everywhere you play it.

    &#xA;&#xA;

    My plan was to transcode the video using ffmpeg to regular H.264 codec and AAC for audio but the produced file has the same issues as the original - no audio when playing and very disruptive video. &#xA;So the question is, does ffmpeg support encoding from Hikvision video/audio codecs ? Or perhaps should try to convert to different web-capable codecs using ffmpeg ?&#xA;My ffmpeg command looks like this :

    &#xA;&#xA;

    ffmpeg -i C:\1.mp4  -c:v libx264 -preset fast -crf 30 -b:v 200k -c:a aac -strict experimental -movflags faststart -threads 0 C:\2.mp4&#xA;

    &#xA;&#xA;

    EDIT : What's interesting is that ffplay.exe opens and plays the original video files with no problem whatsoever, even on a computer where Hikvision codecs are not isntalled, therefore I figured conversion should be possible as well ?

    &#xA;&#xA;

    Mediainfo output of the video file in question :

    &#xA;&#xA;

    General&#xA;CompleteName                     : C:\DownLoad\1.mp4&#xA;Format                           : MPEG-PS&#xA;FileSize/String                  : 8.60 MiB&#xA;Duration/String                  : 2 h 7 min&#xA;OverallBitRate/String            : 9 395 b/s&#xA;FileExtension_Invalid            : mpeg mpg m2p vob pss evo&#xA;&#xA;Video&#xA;ID/String                        : 224 (0xE0)&#xA;Format                           : AVC&#xA;Format/Info                      : Advanced Video Codec&#xA;Format_Profile                   : Baseline@L4&#xA;Format_Settings                  : 1 Ref Frames&#xA;Format_Settings_CABAC/String     : No&#xA;Format_Settings_RefFrames/String : 1 frame&#xA;Format_Settings_GOP              : M=1, N=30&#xA;Duration/String                  : 2 min 0 s&#xA;Width/String                     : 1 920 pixels&#xA;Height/String                    : 1 080 pixels&#xA;DisplayAspectRatio/String        : 16:9&#xA;FrameRate_Mode/String            : Variable&#xA;ColorSpace                       : YUV&#xA;ChromaSubsampling/String         : 4:2:0&#xA;BitDepth/String                  : 8 bits&#xA;ScanType/String                  : Progressive&#xA;&#xA;Audio&#xA;ID/String                        : 192 (0xC0)&#xA;Format                           : MPEG Audio&#xA;Duration/String                  : 2 h 7 min&#xA;Compression_Mode/String          : Lossy&#xA;Video_Delay/String               : -33 min 40 s&#xA;

    &#xA;&#xA;

    Output of ffmpeg :

    &#xA;&#xA;

    C:\ffmpeg\bin>ffmpeg -i C:\DownLoad\1.mp4  -c:v libx264 -preset fast -crf 30 -b:v 75k -c:a aac -strict experimental -movflags faststart -threads 0 C:\DownLoad\2.mp4&#xA;ffmpeg version N-86537-gae6f6d4 Copyright (c) 2000-2017 the FFmpeg developers&#xA;  built with gcc 7.1.0 (GCC)&#xA;  configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib&#xA;  libavutil      55. 66.100 / 55. 66.100&#xA;  libavcodec     57. 99.100 / 57. 99.100&#xA;  libavformat    57. 73.100 / 57. 73.100&#xA;  libavdevice    57.  7.100 / 57.  7.100&#xA;  libavfilter     6. 94.100 /  6. 94.100&#xA;  libswscale      4.  7.101 /  4.  7.101&#xA;  libswresample   2.  8.100 /  2.  8.100&#xA;  libpostproc    54.  6.100 / 54.  6.100&#xA;Input #0, mpeg, from &#x27;C:\DownLoad\1.mp4&#x27;:&#xA;  Duration: 02:07:57.93, start: 789.820800, bitrate: 9 kb/s&#xA;    Stream #0:0[0x1e0]: Video: h264 (Baseline), yuv420p(progressive), 1920x1080, 25 fps, 25 tbr, 90k tbn, 50 tbc&#xA;    Stream #0:1[0x1c0]: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s&#xA;File &#x27;C:\DownLoad\2.mp4&#x27; already exists. Overwrite ? [y/N] y&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))&#xA;  Stream #0:1 -> #0:1 (pcm_mulaw (native) -> aac (native))&#xA;Press [q] to stop, [?] for help&#xA;[aac @ 0000000002cd0280] Too many bits 8832.000000 > 6144 per frame requested, clamping to max&#xA;[libx264 @ 0000000002514c80] using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX XOP FMA4&#xA;[libx264 @ 0000000002514c80] profile High, level 4.0&#xA;[libx264 @ 0000000002514c80] 264 - core 150 r2833 df79067 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 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=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=30 rc=crf mbtree=1 crf=30.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00&#xA;Output #0, mp4, to &#x27;C:\DownLoad\2.mp4&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf57.73.100&#xA;    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080, q=-1--1, 75 kb/s, 25 fps, 12800 tbn, 25 tbc&#xA;    Metadata:&#xA;      encoder         : Lavc57.99.100 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/75000 buffer size: 0 vbv_delay: -1&#xA;    Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 8000 Hz, mono, fltp, 48 kb/s&#xA;    Metadata:&#xA;      encoder         : Lavc57.99.100 aac&#xA;[mp4 @ 00000000010e9e00] Starting second pass: moving the moov atom to the beginning of the file speed= 116x&#xA;frame= 3269 fps= 66 q=-1.0 Lsize=   11086kB time=01:34:24.38 bitrate=  16.0kbits/s dup=269 drop=0 speed= 115x&#xA;video:10429kB audio:592kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.594114%&#xA;[libx264 @ 0000000002514c80] frame I:14    Avg QP:21.86  size: 59795&#xA;[libx264 @ 0000000002514c80] frame P:833   Avg QP:24.81  size:  8993&#xA;[libx264 @ 0000000002514c80] frame B:2422  Avg QP:28.70  size:   970&#xA;[libx264 @ 0000000002514c80] consecutive B-frames:  1.0%  0.2%  1.4% 97.4%&#xA;[libx264 @ 0000000002514c80] mb I  I16..4: 18.9% 66.3% 14.8%&#xA;[libx264 @ 0000000002514c80] mb P  I16..4:  4.0%  7.7%  0.4%  P16..4: 16.2%  2.0%  0.6%  0.0%  0.0%    skip:69.1%&#xA;[libx264 @ 0000000002514c80] mb B  I16..4:  0.6%  0.2%  0.0%  B16..8:  5.5%  0.1%  0.0%  direct: 0.7%  skip:92.9%  L0:44.0% L1:55.0% BI: 1.0%&#xA;[libx264 @ 0000000002514c80] 8x8 transform intra:59.0% inter:83.3%&#xA;[libx264 @ 0000000002514c80] coded y,uvDC,uvAC intra: 25.3% 36.1% 7.7% inter: 1.0% 2.3% 0.1%&#xA;[libx264 @ 0000000002514c80] i16 v,h,dc,p: 23% 24% 43% 10%&#xA;[libx264 @ 0000000002514c80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 26% 23%  2%  2%  3%  2%  3%  3%&#xA;[libx264 @ 0000000002514c80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 23% 12%  4%  4%  5%  4%  4%  2%&#xA;[libx264 @ 0000000002514c80] i8c dc,h,v,p: 81%  7%  9%  3%&#xA;[libx264 @ 0000000002514c80] Weighted P-Frames: Y:1.0% UV:0.0%&#xA;[libx264 @ 0000000002514c80] ref P L0: 73.6% 26.4%&#xA;[libx264 @ 0000000002514c80] ref B L0: 80.9% 19.1%&#xA;[libx264 @ 0000000002514c80] ref B L1: 90.0% 10.0%&#xA;[libx264 @ 0000000002514c80] kb/s:653.30&#xA;[aac @ 0000000002cd0280] Qavg: 64512.656&#xA;&#xA;C:\ffmpeg\bin>&#xA;

    &#xA;&#xA;

    Download link to sample :

    &#xA;&#xA;

    https://www.dropbox.com/s/9ccptsuiqk2ntsv/1.zip?dl=0

    &#xA;&#xA;

    This sample is exactly 2 minutes long, but VLC will tell you otherwise.

    &#xA;