Recherche avancée

Médias (91)

Autres articles (79)

  • 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 (14278)

  • How to solve file path error while using ffprobe to find length of video file in python ?

    4 février 2018, par Mitchell Faas

    So, I’m trying to find the length of a video file by the methods discussed here : How to get the duration of a video in Python ?, Using ffmpeg to obtain video durations in python. But in doing so I run in to a problem which I haven’t been able to solve : I get

    FileNotFoundError:[WinError 2] The system cannot find the file specified

    after trying a bunch of troubleshooting steps I’ve started running in IPython and in cmd seperately to see where things might break down. Using a stripped down version of this code in IPython gives me

    In [11]: subprocess.Popen([ffmpeg_path+'ffprobe'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    Out[11]:

    which seems to be fine, as is CMD at this point. So to adding slight complexity :

    In [17]: subprocess.Popen([ffmpeg_path+'ffprobe -i "F:/tst.mp4"'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    ---------------------------------------------------------------------------
    FileNotFoundError                         Traceback (most recent call last)
    in <module>()
    ----> 1 subprocess.Popen([ffmpeg_path+'ffprobe -i "F:/tst.mp4"'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

    C:\Python\Anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
       705                                 c2pread, c2pwrite,
       706                                 errread, errwrite,
    --> 707                                 restore_signals, start_new_session)
       708         except:
       709             # Cleanup if the child failed starting.

    C:\Python\Anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
       988                                          env,
       989                                          cwd,
    --> 990                                          startupinfo)
       991             finally:
       992                 # Child is launched. Close the parent's copy of those pipe

    FileNotFoundError: [WinError 2] The system cannot find the file specified
    </module>

    This crashes IPython. Running the very same command ffprobe -i "F:/tst.mp4" in CMD works like a charm.

    Here’s what I tried : Changing / to \ and \ , adding and removing quotes around the file path, changing the path to C :\tst.mp4.

    Running the command os.system(ffmpeg_path+'ffprobe -i "F:/tst.mp4") does work.

    What could possibly be going wrong here ?

  • Stacking different length videos not working with ffmpeg and -itsoffset

    3 avril 2019, par Lucas Madalozzo

    I developed a video conferencing app that records the video streams separately, and I am now looking for a way to merge them. At the moment I am experimenting with -itsoffset and hstack to stack 2 videos side by side using this command :

    ffmpeg \
    -itsoffset 17 -i smaller.mp4 \
    -itsoffset 0 -i bigger.mp4 \
    -filter_complex hstack=inputs=2 \
    -c:v libx264 -crf 23 out.mp4

    The result is a side by side video where both streams remain frozen for 17 seconds then start playing, even the bigger.mp4 video that should start at time 0.

    Any help would be really appreciated !

    ffmpeg verbose :

    ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 4.9.2 (Debian 4.9.2-10+deb8u1)
     configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libspeex --enab                                                                                                                                       le-shared --enable-pthreads --enable-libopenjpeg --enable-nonfree --enable-libopus --enable-libvorbis --enable-libvpx
     libavutil      56. 22.100 / 56. 22.100
     libavcodec     58. 35.100 / 58. 35.100
     libavformat    58. 20.100 / 58. 20.100
     libavdevice    58.  5.100 / 58.  5.100
     libavfilter     7. 40.101 /  7. 40.101
     libswscale      5.  3.100 /  5.  3.100
     libswresample   3.  3.100 /  3.  3.100
     libpostproc    55.  3.100 / 55.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'smaller.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf58.20.100
     Duration: 00:00:05.16, start: 0.000000, bitrate: 444 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x360 [SAR 1:1 DAR 4:3], 330 kb/s, 32 fps, 32 tbr, 16384 tbn, 64 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 103 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'bigger.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.36.100
     Duration: 00:00:22.03, start: 0.000000, bitrate: 290 kb/s
       Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x360 [SAR 1:1 DAR 4:3], 177 kb/s, 32 fps, 32 tbr, 16384 tbn, 64 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 103 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    File 'out.mp4' already exists. Overwrite ? [y/N] y
    Stream mapping:
     Stream #0:0 (h264) -> hstack:input0 (graph 0)
     Stream #1:0 (h264) -> hstack:input1 (graph 0)
     hstack (graph 0) -> Stream #0:0 (libx264)
     Stream #0:1 -> #0:1 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [libx264 @ 0x206ed00] using SAR=1/1
    [libx264 @ 0x206ed00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x206ed00] profile High, level 3.1
    [libx264 @ 0x206ed00] 264 - core 146 - 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=3 lookahead_threads=1 sliced_thre                                                                                                                                       ads=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 scene                                                                                                                                       cut=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 'out.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf58.20.100
       Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 960x360 [SAR 1:1 DAR 8:3], q=-1--1, 32 fps, 16384 tbn, 32 tbc (default)
       Metadata:
         encoder         : Lavc58.35.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) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
         encoder         : Lavc58.35.100 aac
    frame=  709 fps=130 q=-1.0 Lsize=     573kB time=00:00:22.12 bitrate= 212.2kbits/s dup=544 drop=0 speed=4.05x
    video:478kB audio:81kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.445685%
    [libx264 @ 0x206ed00] frame I:3     Avg QP:16.86  size: 38355
    [libx264 @ 0x206ed00] frame P:190   Avg QP:18.22  size:  1633
    [libx264 @ 0x206ed00] frame B:516   Avg QP:16.23  size:   123
    [libx264 @ 0x206ed00] consecutive B-frames:  1.3%  2.8%  6.8% 89.1%
    [libx264 @ 0x206ed00] mb I  I16..4:  6.6% 54.8% 38.6%
    [libx264 @ 0x206ed00] mb P  I16..4:  0.4%  1.5%  0.2%  P16..4:  8.7%  4.0%  1.9%  0.0%  0.0%    skip:83.3%
    [libx264 @ 0x206ed00] mb B  I16..4:  0.0%  0.1%  0.0%  B16..8:  4.2%  0.3%  0.0%  direct: 0.0%  skip:95.4%  L0:37.2% L1:58.9% BI: 4.0%
    [libx264 @ 0x206ed00] 8x8 transform intra:66.2% inter:63.4%
    [libx264 @ 0x206ed00] coded y,uvDC,uvAC intra: 66.1% 65.6% 21.6% inter: 1.7% 1.1% 0.0%
    [libx264 @ 0x206ed00] i16 v,h,dc,p: 21% 26% 11% 42%
    [libx264 @ 0x206ed00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 23% 13%  5%  7%  8%  7%  7%  6%
    [libx264 @ 0x206ed00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 24%  9%  6%  7%  7%  6%  7%  7%
    [libx264 @ 0x206ed00] i8c dc,h,v,p: 46% 25% 20%  9%
    [libx264 @ 0x206ed00] Weighted P-Frames: Y:1.1% UV:0.0%
    [libx264 @ 0x206ed00] ref P L0: 66.0% 19.4% 12.0%  2.6%  0.0%
    [libx264 @ 0x206ed00] ref B L0: 87.2% 11.8%  1.0%
    [libx264 @ 0x206ed00] ref B L1: 95.2%  4.8%
    [libx264 @ 0x206ed00] kb/s:176.52
    [aac @ 0x204aa00] Qavg: 247.398
  • ffmpeg : trim / concat results in different length videos

    4 mai 2019, par Mads Lee Jensen

    Im experimenting with the trim and concat filters.

    I wanted to simply split up a video into X chunks, and concat it again. I expected the result would be a video with same frames / duration.

    So i have a video encoded with 1 fps and contains 3 frames, the duration of this video is 3 seconds.

    i run the following script

    ffmpeg -y -i fps.mp4 -an -filter_complex "[0:v]trim=0:1[v1];[0:v]trim=1:2[v2];[0:v]trim=2:3[v3];[v1][v2][v3]  concat=n=3:v=1 [out]" -map [out] out.mp4

    The result is a video with a duration of 4 seconds to inspect the problem i called :

    ffprobe -print_format json -show_frames out.mp4

    It shows that there is now 4 frames ?? (here is the dump)

    ffprobe version 4.1.3 Copyright (c) 2007-2019 the FFmpeg developers
     built with Apple LLVM version 10.0.1 (clang-1001.0.46.3)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.3 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-12.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-12.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
     libavutil      56. 22.100 / 56. 22.100
     libavcodec     58. 35.100 / 58. 35.100
     libavformat    58. 20.100 / 58. 20.100
     libavdevice    58.  5.100 / 58.  5.100
     libavfilter     7. 40.101 /  7. 40.101
     libavresample   4.  0.  0 /  4.  0.  0
     libswscale      5.  3.100 /  5.  3.100
     libswresample   3.  3.100 /  3.  3.100
     libpostproc    55.  3.100 / 55.  3.100
    {
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf58.20.100
     Duration: 00:00:04.00, start: 0.000000, bitrate: 4 kb/s
       Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 100x100, 2 kb/s, 1 fps, 1 tbr, 16384 tbn, 2 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       "frames": [
           {
               "media_type": "video",
               "stream_index": 0,
               "key_frame": 1,
               "pkt_pts": 0,
               "pkt_pts_time": "0.000000",
               "pkt_dts": 0,
               "pkt_dts_time": "0.000000",
               "best_effort_timestamp": 0,
               "best_effort_timestamp_time": "0.000000",
               "pkt_duration": 16384,
               "pkt_duration_time": "1.000000",
               "pkt_pos": "48",
               "pkt_size": "857",
               "width": 100,
               "height": 100,
               "pix_fmt": "yuv444p",
               "pict_type": "I",
               "coded_picture_number": 0,
               "display_picture_number": 0,
               "interlaced_frame": 0,
               "top_field_first": 0,
               "repeat_pict": 0,
               "chroma_location": "left"
           },
           {
               "media_type": "video",
               "stream_index": 0,
               "key_frame": 0,
               "pkt_pts": 16384,
               "pkt_pts_time": "1.000000",
               "pkt_dts": 16384,
               "pkt_dts_time": "1.000000",
               "best_effort_timestamp": 16384,
               "best_effort_timestamp_time": "1.000000",
               "pkt_duration": 16384,
               "pkt_duration_time": "1.000000",
               "pkt_pos": "1053",
               "pkt_size": "146",
               "width": 100,
               "height": 100,
               "pix_fmt": "yuv444p",
               "pict_type": "B",
               "coded_picture_number": 2,
               "display_picture_number": 0,
               "interlaced_frame": 0,
               "top_field_first": 0,
               "repeat_pict": 0,
               "chroma_location": "left"
           },
           {
               "media_type": "video",
               "stream_index": 0,
               "key_frame": 0,
               "pkt_pts": 32768,
               "pkt_pts_time": "2.000000",
               "best_effort_timestamp": 32768,
               "best_effort_timestamp_time": "2.000000",
               "pkt_duration": 16384,
               "pkt_duration_time": "1.000000",
               "pkt_pos": "1199",
               "pkt_size": "19",
               "width": 100,
               "height": 100,
               "pix_fmt": "yuv444p",
               "pict_type": "B",
               "coded_picture_number": 3,
               "display_picture_number": 0,
               "interlaced_frame": 0,
               "top_field_first": 0,
               "repeat_pict": 0,
               "chroma_location": "left"
           },
           {
               "media_type": "video",
               "stream_index": 0,
               "key_frame": 0,
               "pkt_pts": 49152,
               "pkt_pts_time": "3.000000",
               "best_effort_timestamp": 49152,
               "best_effort_timestamp_time": "3.000000",
               "pkt_duration": 16384,
               "pkt_duration_time": "1.000000",
               "pkt_pos": "905",
               "pkt_size": "148",
               "width": 100,
               "height": 100,
               "pix_fmt": "yuv444p",
               "pict_type": "P",
               "coded_picture_number": 1,
               "display_picture_number": 0,
               "interlaced_frame": 0,
               "top_field_first": 0,
               "repeat_pict": 0,
               "chroma_location": "left"
           }
       ]
    }

    I tried different things, and everything seems to work fine if i split a 2 second video (still 1 fps) up and concat again. But something goes wrong when going beyond that ?

    Here is output from ffmpeg -i fps.mp4

    ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
     built with Apple LLVM version 10.0.1 (clang-1001.0.46.3)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.3 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-12.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-12.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
     libavutil      56. 22.100 / 56. 22.100
     libavcodec     58. 35.100 / 58. 35.100
     libavformat    58. 20.100 / 58. 20.100
     libavdevice    58.  5.100 / 58.  5.100
     libavfilter     7. 40.101 /  7. 40.101
     libavresample   4.  0.  0 /  4.  0.  0
     libswscale      5.  3.100 /  5.  3.100
     libswresample   3.  3.100 /  3.  3.100
     libpostproc    55.  3.100 / 55.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'scripts/fps.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf58.20.100
     Duration: 00:00:03.00, start: 0.000000, bitrate: 7 kb/s
       Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), gbrp(tv, gbr/unknown/unknown), 100x100, 4 kb/s, 1 fps, 1 tbr, 16384 tbn, 2 tbc (default)
       Metadata:
         handler_name    : VideoHandler