Recherche avancée

Médias (1)

Mot : - Tags -/sintel

Autres articles (59)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (9727)

  • ffmpeg conversion from h264 for webserver

    11 juin 2021, par Xav

    I'm working on a system to record videos through RPi (picamera, h264 format), export (rsync) 10s segments of videos to a distant webserver, and trying to concatenate those segment into a single video file to read on the webserver.

    


    Simplified code to record on RPi :

    


    import os
import datetime as dt
import picamera

camera = picamera.PiCamera()
camera.resolution = (1920, 1080)
camera.framerate = 25
duration = 10 #sec

[...]

camera.start_recording(filename, format='h264')
while True:
    filename = get_timestamped_filename()
    camera.split_recording(filename)
    camera.wait_recording(duration)

camera.stop_recording()


    


    For the conversion, I tried many options/searches without success. I can get the video (.ts, .mp4, .ogv, .webm) working on majority of web browser but never on ios/android (chrome/safari).
As example of test & fail with ffmpeg : https://gist.github.com/jaydenseric/220c785d6289bcfd7366

    


    When I don't try to concatenate but only convert those video :

    


    ffmpeg -i input.h264 -profile:v baseline -level 3.0 output.mp4


    


    I have the following output :

    


    ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  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, h264, from 'input.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x480, 25 fps, 25 tbr, 1200k tbn, 50 tbc
File 'output.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x556885757980] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x556885757980] profile Constrained Baseline, level 3.0
[libx264 @ 0x556885757980] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=9 lookahead_threads=1 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=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 'output.mp4':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 720x480, q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.35.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=  195 fps=0.0 q=-1.0 Lsize=     229kB time=00:00:07.76 bitrate= 241.3kbits/s speed=20.4x    
video:227kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.687068%
[libx264 @ 0x556885757980] frame I:1     Avg QP:23.86  size: 24802
[libx264 @ 0x556885757980] frame P:194   Avg QP:22.46  size:  1067
[libx264 @ 0x556885757980] mb I  I16..4: 26.4%  0.0% 73.6%
[libx264 @ 0x556885757980] mb P  I16..4:  1.1%  0.0%  0.4%  P16..4: 20.3%  1.5%  0.6%  0.0%  0.0%    skip:76.1%
[libx264 @ 0x556885757980] coded y,uvDC,uvAC intra: 34.9% 54.4% 12.3% inter: 1.8% 12.4% 0.0%
[libx264 @ 0x556885757980] i16 v,h,dc,p: 45% 14% 17% 23%
[libx264 @ 0x556885757980] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 31% 11%  4%  4%  4%  4%  4%  4%
[libx264 @ 0x556885757980] i8c dc,h,v,p: 51% 17% 28%  4%
[libx264 @ 0x556885757980] ref P L0: 80.0% 10.6%  9.4%
[libx264 @ 0x556885757980] kb/s:237.75


    


    But still, impossible to play on mobile web (iOS, Android)

    


    Is there anything I'm doing wrong, either in the capturing process or conversion ?
Do you have any recommendations ?

    


  • Something wrong with recording video and merging audio and video by using FFmpeg

    16 mars 2014, par VaFancy

    At the beginning, I have to admit that I am a newbie in FFmpeg and also raspbian. Unfortunately, I need to solve this problem as soon as possible.

    I tried to record videos on my Raspberry PI by using PIcamera and USB webcam separately. When I used command :

    ffmpeg -t 10 -f video4linux2 -r 25 -i /dev/video0 out.h264

    However, something was very wrong because there was nothing saved in that video file. I copy the log.

    [video4linux2,v4l2 @ 0x267ad80] The driver changed the time per frame from 1/25 to 1/30
    Input #0, video4linux2,v4l2, from '/dev/video0':
     Duration: N/A, start: 37562.908020, bitrate: 147456 kb/s
       Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    File 'out.h264' already exists. Overwrite ? [y/N] y
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x267ca60] using cpu capabilities: ARMv6
    [libx264 @ 0x267ca60] profile High 4:2:2, level 3.0, 4:2:2 8-bit
    Output #0, h264, to 'out.h264':
     Metadata:
       encoder         : Lavf55.34.101
       Stream #0:0: Video: h264 (libx264), yuv422p, 640x480, q=-1--1, 90k tbn, 25 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo -> libx264)
    Press [q] to stop, [?] for help
    DTS 140730117085, next:18648459 st:0 invalid dropping00.00 bitrate=N/A    
    PTS 140730117085, next:18648459 invalid dropping st:0
    DTS 140740452429, next:6538221 st:0 invalid dropping:00.00 bitrate=N/A    
    PTS 140740452429, next:6538221 invalid dropping st:0
    frame=   44 fps=1.1 q=28.0 size=      18kB time=00:00:00.04 bitrate=3712.6kbits/
    frame=   45 fps=0.8 q=28.0 size=      22kB time=00:00:00.08 bitrate=2262.8kbits/
    frame=   46 fps=0.7 q=28.0 size=      27kB time=00:00:00.12 bitrate=1813.4kbits/
    frame=   47 fps=0.6 q=28.0 size=      30kB time=00:00:00.16 bitrate=1559.2kbits/
    frame=   48 fps=0.5 q=28.0 size=      34kB time=00:00:00.20 bitrate=1397.7kbits/
    frame=   49 fps=0.5 q=28.0 size=      39kB time=00:00:00.24 bitrate=1324.3kbits/
    frame=   50 fps=0.4 q=28.0 size=      42kB time=00:00:00.28 bitrate=1241.7kbits/

    As you can see, the size of each frame was only few kb and fps was so low. Thus each frame was taken by using a long time(4s in this case). Then I test my USB webcam by using command :

    ffplay -f video4linux2 /dev/video0

    The video stream which displayed on the screen was so unnatural. It looked like there was such a long delay between each frame. So the video was hardly moved. The log I have copied :

    pi@raspberrypi ~ $ ffplay -f video4linux2 /dev/video0
    avplay version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2003-2013 the Libav developers
     built on Mar 31 2013 13:58:10 with gcc 4.6.3
    [video4linux2 @ 0x1ad83c0] Estimating duration from bitrate, this may be inaccurate
    Input #0, video4linux2, from '/dev/video0':
     Duration: N/A, start: 36107.154598, bitrate: 147456 kb/s
       Stream #0.0: Video: rawvideo, yuyv422, 640x480, 147456 kb/s, 30 tbr, 1000k tbn, 30 tbc
    [avsink @ 0x1ad9960] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
    [scale @ 0x1ad9d20] w:640 h:480 fmt:yuyv422 -> w:640 h:480 fmt:yuv420p flags:0x4
    36163.33 A-V:  0.000 s:0.0 aq=    0KB vq= 3000KB sq=    0B f=8/8

    The final problem is that no sound was added in video file when I tried to add some in. I used the command :

    avconv -i /home/pi/Desktop/test.mp4 -i /home/pi/Desktop/test.mp3 -map 0:0 -vcodec copy -map 1:0 -acodec copy output.h264

    I have checked separately that the video and audio were both able to play. However the merged file only had video but no audio. The log is shown below, it seems that the process was succeed.

    pi@raspberrypi ~ $ avconv -i /home/pi/Desktop/test.mp4 -i /home/pi/Desktop/test.mp3 -map 0:0 -vcodec copy -map 1:0 -acodec copy output.h264
    avconv version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2000-2013 the Libav developers
     built on Mar 31 2013 13:58:10 with gcc 4.6.3
    [h264 @ 0x1aa6680] max_analyze_duration reached
    [h264 @ 0x1aa6680] Estimating duration from bitrate, this may be inaccurate
    Input #0, h264, from '/home/pi/Desktop/test.mp4':
     Duration: N/A, bitrate: N/A
       Stream #0.0: Video: h264 (High), yuv420p, 640x480, 25 fps, 25 tbr, 1200k tbn, 2400k tbc
    [mp3 @ 0x1aaa120] Estimating duration from bitrate, this may be inaccurate
    Input #1, mp3, from '/home/pi/Desktop/test.mp3':
     Metadata:
       title           : We Are Legend (Original Mix)
       artist          : Dimitri Vegas & Like Mike & Steve Aoki
       album           : SPINNIN RECORDS
       encoded_by      : iTunes 11.1.5
       TBP             : 128
       genre           : Progressive House
       date            : 2013
     Duration: 00:00:11.14, start: 0.000000, bitrate: 191 kb/s
       Stream #1.0: Audio: mp3, 48000 Hz, stereo, s16, 192 kb/s
    File 'output.h264' already exists. Overwrite ? [y/N] y
    Output #0, h264, to 'output.h264':
     Metadata:
       encoder         : Lavf53.21.1
       Stream #0.0: Video: libx264, yuv420p, 640x480, q=2-31, 90k tbn, 1200k tbc
       Stream #0.1: Audio: libmp3lame, 48000 Hz, stereo, 192 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #1:0 -> #0:1 (copy)
    Press ctrl-c to stop encoding
    frame=  144 fps=  0 q=-1.0 Lsize=    1684kB time=5.06 bitrate=2724.7kbits/s    
    video:1566kB audio:119kB global headers:0kB muxing overhead 0.000000%

    Could somebody helps me, please. And sorry for my bad english.

    BTW : When I finally captured 200 frames, it turns out all of them were green.

  • how to remove duplicated frame from 00:00:00,00 to 00:00:00,25 section not overall with mpdecimate filter ?

    19 octobre 2018, par cool jobs

    how to remove duplicated frame from 00:00:00,00 to 00:00:00,25 (00frame 25frames)section not overall with mpdecimate filter ??
    normally H264 video have some duplicated frames on video start section ..

       i have tried like this ,

    1)  ./ffmpeg -i cated_2-3.UMMJI.MTS -map 0:0 -c:v prores_ks -profile:v 1 -qscale:v 8  -s 1920x1080  -r 29.97  -top 1  -c:a pcm_s16le    -map 0:1 -filter:a:0 "pan=mono|c0=c0" -map 0:1 -filter:a:1 "pan=mono|c0=c1"   -metadata:s encoder="Apple ProRes 422 LT"  -filter_complex "[0]split=2[a][b];[a]trim=end_frame=26,mpdecimate[a];[b]trim=start_frame=25,setpts=PTS-STARTPTS[b];[a][b]concat=n=2:v=1:a=0" -vsync vfr -vf blackdetect=d=0.1:pix_th=.1  cated_2-3.UMMJI_MTS_mpdecimate26_section.mov

    and  tried to check black_frame on out prores mov file
    2)./ffmpeg  -i cated_2-3.UMMJI_MTS_mpdecimate26_section.mov  -vf blackdetect=d=0.1:pix_th=.1  test.mov

    then , will be shown like below

    macmini-master:1.  two_file_test khan$ ./ffmpeg  -i cated_2-3.UMMJI_MTS_mpdecimate26_section.mov  -vf blackdetect=d=0.1:pix_th=.1  test.mov
    ffmpeg version N-92108-ge08a876e67-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
     built with Apple LLVM version 10.0.0 (clang-1000.11.45.2)
     configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
     libavutil      56. 19.101 / 56. 19.101
     libavcodec     58. 32.100 / 58. 32.100
     libavformat    58. 18.104 / 58. 18.104
     libavdevice    58.  4.105 / 58.  4.105
     libavfilter     7. 33.100 /  7. 33.100
     libswscale      5.  2.100 /  5.  2.100
     libswresample   3.  2.100 /  3.  2.100
     libpostproc    55.  2.100 / 55.  2.100
    Guessed Channel Layout for Input Stream #0.1 : mono
    Guessed Channel Layout for Input Stream #0.2 : mono
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cated_2-3.UMMJI_MTS_mpdecimate26_section.mov':
     Metadata:
       major_brand     : qt
       minor_version   : 512
       compatible_brands: qt
       encoder         : Lavf58.18.104
     Duration: 00:25:12.58, start: 0.000000, bitrate: 86198 kb/s
       Stream #0:0(eng): Video: prores (apcs / 0x73637061), yuv422p10le(tv, top first), 1920x1080, 84662 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 11988 tbn, 11988 tbc (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Apple ProRes 422 LT
       Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
       Stream #0:2(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (prores (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
    Press [q] to stop, [?] for help
    [libx264 @ 0x7f8eb2804200] using SAR=1/1
    [libx264 @ 0x7f8eb2804200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    [libx264 @ 0x7f8eb2804200] profile High 4:2:2, level 4.0, 4:2:2, 8-bit
    [libx264 @ 0x7f8eb2804200] 264 - core 157 r2935 545de2f - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - 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, mov, to 'test.mov':
     Metadata:
       major_brand     : qt
       minor_version   : 512
       compatible_brands: qt
       encoder         : Lavf58.18.104
       Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Lavc58.32.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
         encoder         : Lavc58.32.100 aac
    frame= 8224 fps= 21 q=29.0 size=   86528kB time=00:04:34.49 bitrate=2582.3kbits/s dup=19 drop=0 speed=0.689x

    as you can see duplicated frame just changed to black frame , not removed
    this MTS file have 19 duplicated frames !
    also i have checked in FCPX and count how many dupicated frame on out prores mov file ...