Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

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

Autres articles (40)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (10503)

  • Generating synthetic testsrc video counting at 10 fps, first frame is duplicated

    19 février 2020, par Rotem

    I am trying to generate synthetic video using FFmpeg.

    I want the frame rate to be 10 fps, and I want testsrc counter to advance every frame.

    Problem :
    When the output file is mp4, the first video frame is duplicated 10 times.

    Question :
    Is it a bug in FFmpeg, or a problem in the command line arguments ?


    I am using the following command :

    ffmpeg -y -r 10 -f lavfi -i testsrc=duration=10:size=192x108:rate=1 -c:v libx264 vid.mp4
    • The reason for setting rate=1 is for the counter to advance on each frame.
      The generated source pattern is designed to advance the counter every second.
    • The reason for setting -r 10 before the input, is for "remuxing" the video at 10 fps, and ignoring the timestamps of the input.

    I found the syntax in the following post : Using ffmpeg to change framerate :

    Remux with new framerate

    ffmpeg -y -r 24 -i seeing_noaudio.h264 -c copy seeing.mp4

    When the output file is AVI it’s working correctly (first frame is not duplicated) :

    ffmpeg -y -r 10 -f lavfi -i testsrc=duration=10:size=192x108:rate=1 -c:v libx264 vid.avi

    When generating AVI at 1 fps, and Remux to mp4 at 10 fps, there is a different problem :
    The first and second frames are duplicated twice, and the last frame is missing.
    Here are the commands :

    ffmpeg -y -f lavfi -i testsrc=duration=10:size=92x54:rate=1 -c:v libx264 -r 1 vid.avi
    ffmpeg -y -r 10 -i vid.avi -c:v copy -r 10 vid.mp4

    Parsing the mp4 video to PNG images :

    ffmpeg -i vid.mp4 %02d.png  

    Result :
    enter image description here
    The first frame is duplicated 10 times.


    Parsing the AVI video to PNG images :
    Result :
    enter image description here
    There are 10 frames as expected.

  • runtime/cgo : pthread_create failed : Resource temporarily unavailable

    15 février 2020, par nadermx

    I currently have this function, that pipes multiple youtubedl commands thru ffmpeg, and then pipes the output of ffmpeg to an HTTP client.

    func pipeThruFfmpegToMp4(vi *VideoInfo, rw web.ResponseWriter) error {
       var ffmpeg *exec.Cmd
       ffmpeg = exec.Command(
           "ffmpeg",
           "-i", "-",
           "-i", "pipe:3",
           "-c:v", "copy", "-c:a", "copy",
           "-preset", "veryfast",
           "-metadata", fmt.Sprintf(`title=%s`, vi.GetTitle()),
           "-movflags", "frag_keyframe+empty_moov",
           "-f", "mp4",
           "-")


       youtubevideo := exec.Command(YoutubeDLPath, "-c", "-f", fmt.Sprintf("%s/bestvideo[ext=mp4]/bestvideo/best", vi.GetFormat()), "--no-cache-dir", "--restrict-filenames", "--hls-prefer-native", "-o", "-", fmt.Sprintf("%s", vi.GetVideoUrl()))
       fmt.Println(youtubevideo)

       youtube := exec.Command(YoutubeDLPath, "-c", "-f", "bestaudio[ext=m4a]/bestaudio/best", "--no-cache-dir", "--restrict-filenames", "--hls-prefer-native", "-o", "-", fmt.Sprintf("%s", vi.GetVideoUrl()))
       fmt.Println(youtube)

       var ytvbuf, ytbuf, ffbuf bytes.Buffer
       youtubevideo.Stderr = &ytvbuf
       youtube.Stderr = &ytbuf
       ffmpeg.Stderr = &ffbuf

       video, err := youtubevideo.StdoutPipe()
       if err != nil {
           log.Printf("pipeThruFfmpegToMp4: %v\n", err)
           return err
       }

       pipe3, err := youtube.StdoutPipe()
       if err != nil {
           log.Printf("pipeThruFfmpegToMp4: %v\n", err)
           return err
       }

       ffmpeg.Stdin = video
       ffmpeg.ExtraFiles = []*os.File{pipe3.(*os.File)}
       ffmpeg.Stdout = rw

       // Headers sent, no turning back now
       rw.Header().Set("Content-Type", "video/mp4")
       rw.Header().Set("Content-Disposition", fmt.Sprintf("attachment;filename=\"%s.mp4\"", vi.GetSlug()))
       rw.Flush()

       ffmpeg.Start()
       youtubevideo.Start()
       youtube.Start()
       ffmpeg.Wait()
       youtubevideo.Wait()
       youtube.Wait()

       // check ytvbuf, ytbuf, ffbuf for stderr errors

       if ffbuf.Len() != 0 {
           rollbar.Error(rollbar.ERR, err, &rollbar.Field{"stderr", ffbuf.String()})
           log.Printf("pipeThruFfmpegToMp4: %v\n", ffbuf.String())
       }
       if ytvbuf.Len() != 0 {
           rollbar.Error(rollbar.ERR, err, &rollbar.Field{"stderr", ytvbuf.String()})
           log.Printf("pipeThruYouTubevDLToMp4: %v\n", ytvbuf.String())
       }
       if ytbuf.Len() != 0 {
           rollbar.Error(rollbar.ERR, err, &rollbar.Field{"stderr", ytbuf.String()})
           log.Printf("pipeThruYouTubeDLToMp4: %v\n", ytbuf.String())
       }

       return nil
    }

    The problem is that everything runs fine, but after a while the ram starts filling up on the server, till it gets to the point that it errors out with runtime/cgo: pthread_create failed: Resource temporarily unavailable

    I’m unsure if it’s a memory leak, or if either instance of youtube-dl is not closing right or if ffmpeg isn’t closing right and just consuming more and more ram as the program runs more, until the program crashes with this error

    runtime/cgo: pthread_create failed: Resource temporarily unavailable
    SIGABRT: abort
    PC=0x7f083501fe97 m=128 sigcode=18446744073709551610

    goroutine 0 [idle]:
    runtime: unknown pc 0x7f083501fe97
    stack: frame={sp:0x7f05ff7fd7d0, fp:0x0} stack=[0x7f05feffe288,0x7f05ff7fde88)
    00007f05ff7fd6d0:  00007f05ff7fd700  0000ffff00001fa0
    00007f05ff7fd6e0:  00007f05ff7fdbe0  00007f05f8000da0
    00007f05ff7fd6f0:  0000000000000000  000000000093032c
    00007f05ff7fd700:  0000000000000000  00007f0835600ec3
    00007f05ff7fd710:  0000000000000005  0000000000000000
    00007f05ff7fd720:  000000c0000ce120  00007f0834ff1ce0
    00007f05ff7fd730:  00007f05ff7fdaf0  00007f083560870a
    00007f05ff7fd740:  0000000000000000  0000000000000000
    00007f05ff7fd750:  0000000000000000  00007f05ff7fdbe0
    00007f05ff7fd760:  2525252525252525  2525252525252525
    00007f05ff7fd770:  000000ffffffffff  0000000000000000
    00007f05ff7fd780:  000000ffffffffff  0000000000000000
    00007f05ff7fd790:  000000c00010d1a0  000000c000953740
    00007f05ff7fd7a0:  000000c0000ce120  000000c000cf2300
    00007f05ff7fd7b0:  000000c00010d260  000000c001f4e180
    00007f05ff7fd7c0:  000000c001f4e000  000000c00169f680
    00007f05ff7fd7d0: <0000000000000000  000000c001f34180
    00007f05ff7fd7e0:  6e75720000000000  6f67632f656d6974
    00007f05ff7fd7f0:  0000000000000000  0000000000000000
    00007f05ff7fd800:  000000c000cf2300  000000c00010d260
    00007f05ff7fd810:  000000c001f4e180  000000c001f4e000
    00007f05ff7fd820:  000000c00169f680  000000c00169f500
    00007f05ff7fd830:  000000c001f34180  000000c001f34000
    00007f05ff7fd840:  000000c000c92780  000000c001ec2600
    00007f05ff7fd850:  fffffffe7fffffff  ffffffffffffffff
    00007f05ff7fd860:  ffffffffffffffff  ffffffffffffffff
    00007f05ff7fd870:  ffffffffffffffff  ffffffffffffffff
    00007f05ff7fd880:  ffffffffffffffff  ffffffffffffffff
    00007f05ff7fd890:  ffffffffffffffff  ffffffffffffffff
    00007f05ff7fd8a0:  ffffffffffffffff  ffffffffffffffff
    00007f05ff7fd8b0:  ffffffffffffffff  ffffffffffffffff
    00007f05ff7fd8c0:  ffffffffffffffff  ffffffffffffffff
    runtime: unknown pc 0x7f083501fe97
    stack: frame={sp:0x7f05ff7fd7d0, fp:0x0} stack=[0x7f05feffe288,0x7f05ff7fde88)
    00007f05ff7fd6d0:  00007f05ff7fd700  0000ffff00001fa0
    00007f05ff7fd6e0:  00007f05ff7fdbe0  00007f05f8000da0
    00007f05ff7fd6f0:  0000000000000000  000000000093032c
    00007f05ff7fd700:  0000000000000000  00007f0835600ec3
    00007f05ff7fd710:  0000000000000005  0000000000000000

    I’ve also tried building the binary with CGO_ENABLED=0 even though I don’t even have a import "c" but that also ends up erroring out as well with

    runtime: failed to create new OS thread (have 21 already; errno=11)
    runtime: may need to increase max user processes (ulimit -u)
    fatal error: newosproc

    my limit’s are already very generouse, which maybe could also be a problem ? Or do I maybe have to increase the pipe size ?

    $ ulimit -a
    core file size          (blocks, -c) 0
    data seg size           (kbytes, -d) unlimited
    scheduling priority             (-e) 0
    file size               (blocks, -f) unlimited
    pending signals                 (-i) 192907
    max locked memory       (kbytes, -l) 16384
    max memory size         (kbytes, -m) unlimited
    open files                      (-n) 100000
    pipe size            (512 bytes, -p) 8
    POSIX message queues     (bytes, -q) 819200
    real-time priority              (-r) 0
    stack size              (kbytes, -s) 65536
    cpu time               (seconds, -t) unlimited
    max user processes              (-u) 63883
    virtual memory          (kbytes, -v) unlimited

    Either way, I apprecate any and all the help I can get on this. Here is a link to the entire program and here is a thread in the golang-nuts forum regarding this questions

  • Python FFmpeg : Setting VBR and BT.709

    14 décembre 2019, par Cryptonaut

    I’m using this Python library to programmatically generate a short video using an image (.png) as input. The video needs to match the specifications of another video created by someone else.

    The key differences between my output and the other are the following (these are the media attributes I desire to have) :

    How would I achieve VBR ? It was my understanding ProRes 422 HQ natively used unconstrained VBR yet my output specifies CBR.

    Secondly, as can be seen from my code, I’m attempting to conform to BT.709. However, my media information output does not specify this. What am I doing incorrectly ?

    Here’s my code :

       image = ffmpeg.input(input_image, t='00:00:10', framerate='24000/1001', loop='1', probesize='42M')

       output = ffmpeg.output(image, output_video,
       f='mov',
       vcodec='prores_ks',
       vprofile='3',
       pix_fmt='yuv422p10le',
       g='48',
       video_track_timescale='24000',
       movflags='use_metadata_tags',
       timecode='00:00:00:00',
       color_primaries='bt709',
       color_trc='bt709',
       colorspace='bt709',
       qcomp='1',
       # BT.709 issue solved by adding the bsf option as seen via the line below
       bsf='prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709',
       vf='scale=in_range=full:in_color_matrix=bt709:out_range=full:out_color_matrix=bt709')

       output.run()

    Here’s the media information produced by my output :

    {
      "media":{
         "@ref":"Redacted",
         "track":[
            {
               "@type":"General",
               "VideoCount":"1",
               "OtherCount":"1",
               "FileExtension":"mov",
               "Format":"MPEG-4",
               "Format_Profile":"QuickTime",
               "CodecID":"qt  ",
               "CodecID_Version":"0000.02",
               "CodecID_Compatible":"qt  ",
               "FileSize":"196366623",
               "Duration":"10.010",
               "OverallBitRate":"156936362",
               "FrameRate":"23.976",
               "FrameCount":"240",
               "StreamSize":"2463",
               "HeaderSize":"28",
               "DataSize":"196364172",
               "FooterSize":"2423",
               "IsStreamable":"No",
               "File_Created_Date":"UTC 2019-12-13 19:26:37.150",
               "File_Created_Date_Local":"2019-12-13 19:26:37.150",
               "File_Modified_Date":"UTC 2019-12-13 19:27:20.303",
               "File_Modified_Date_Local":"2019-12-13 19:27:20.303"
            },
            {
               "@type":"Video",
               "StreamOrder":"0",
               "ID":"1",
               "Format":"ProRes",
               "Format_Version":"0",
               "Format_Profile":"422 HQ",
               "CodecID":"apch",
               "Duration":"10.010",
               "BitRate_Mode":"CBR",
               "BitRate":"156934237",
               "Width":"1920",
               "Height":"1080",
               "Sampled_Width":"1920",
               "Sampled_Height":"1080",
               "PixelAspectRatio":"1.000",
               "DisplayAspectRatio":"1.778",
               "Rotation":"0.000",
               "FrameRate_Mode":"CFR",
               "FrameRate":"23.976",
               "FrameCount":"240",
               "ColorSpace":"YUV",
               "ChromaSubsampling":"4:2:2",
               "ScanType":"Progressive",
               "Delay":"0.000",
               "StreamSize":"196364160",
               "Encoded_Library":"Lavc",
               "colour_description_present":"Yes",
               "colour_description_present_Source":"Stream",
               "colour_primaries_Source":"Stream",
               "transfer_characteristics_Source":"Stream",
               "matrix_coefficients_Source":"Stream"
            },
            {
               "@type":"Other",
               "StreamOrder":"1",
               "ID":"2",
               "Type":"Time code",
               "Format":"QuickTime TC",
               "Duration":"10.010",
               "FrameRate":"23.976",
               "TimeCode_FirstFrame":"00:00:00:00",
               "TimeCode_Striped":"Yes",
               "Language":"en",
               "Default":"No"
            }
         ]
      }
    }

    Here’s the media information spec I’m trying to match :

    {
      "media":{
         "@ref":"Redacted",
         "track":[
            {
               "@type":"General",
               "VideoCount":"1",
               "OtherCount":"1",
               "FileExtension":"mov",
               "Format":"MPEG-4",
               "Format_Profile":"QuickTime",
               "CodecID":"qt  ",
               "CodecID_Version":"2005.03",
               "CodecID_Compatible":"qt  ",
               "FileSize":"1397430682",
               "Duration":"70.737",
               "OverallBitRate_Mode":"VBR",
               "OverallBitRate":"158042403",
               "FrameRate":"23.976",
               "FrameCount":"1696",
               "StreamSize":"9898",
               "HeaderSize":"28",
               "DataSize":"1397420796",
               "FooterSize":"9858",
               "IsStreamable":"No",
               "Encoded_Date":"UTC 2019-04-29 22:26:32",
               "Tagged_Date":"UTC 2019-04-29 22:26:32",
               "File_Created_Date":"UTC 2019-12-12 16:52:57.215",
               "File_Created_Date_Local":"2019-12-12 16:52:57.215",
               "File_Modified_Date":"UTC 2019-12-12 17:25:58.903",
               "File_Modified_Date_Local":"2019-12-12 17:25:58.903",
               "Encoded_Application":"DVP Factory r561 (2019-04-25), Host: dvp07"
            },
            {
               "@type":"Video",
               "StreamOrder":"0",
               "ID":"1",
               "Format":"ProRes",
               "Format_Version":"0",
               "Format_Profile":"422 HQ",
               "CodecID":"apch",
               "Duration":"70.737",
               "Duration_LastFrame":"-0.000",
               "BitRate_Mode":"VBR",
               "BitRate":"158040381",
               "Width":"1920",
               "Height":"1080",
               "Sampled_Width":"1920",
               "Sampled_Height":"1080",
               "PixelAspectRatio":"1.000",
               "DisplayAspectRatio":"1.778",
               "Rotation":"0.000",
               "FrameRate_Mode":"CFR",
               "FrameRate":"23.976",
               "FrameCount":"1696",
               "ColorSpace":"YUV",
               "ChromaSubsampling":"4:2:2",
               "ScanType":"Progressive",
               "Delay":"0.000",
               "StreamSize":"1397420784",
               "Encoded_Library":"agi0",
               "Language":"en",
               "Encoded_Date":"UTC 2019-04-29 22:26:32",
               "Tagged_Date":"UTC 2019-04-29 22:26:32",
               "colour_description_present":"Yes",
               "colour_description_present_Source":"Container / Stream",
               "colour_primaries":"BT.709",
               "colour_primaries_Source":"Container",
               "colour_primaries_Original_Source":"Stream",
               "transfer_characteristics":"BT.709",
               "transfer_characteristics_Source":"Container",
               "transfer_characteristics_Original_Source":"Stream",
               "matrix_coefficients":"BT.709",
               "matrix_coefficients_Source":"Container / Stream"
            },
            {
               "@type":"Other",
               "StreamOrder":"1",
               "ID":"2",
               "Type":"Time code",
               "Format":"QuickTime TC",
               "Duration":"70.737",
               "FrameRate":"23.976",
               "TimeCode_FirstFrame":"00:00:00:00",
               "TimeCode_Striped":"Yes",
               "Language":"en",
               "extra":{
                  "Encoded_Date":"UTC 2019-04-29 22:26:32",
                  "Tagged_Date":"UTC 2019-04-29 22:26:32"
               }
            }
         ]
      }
    }