Recherche avancée

Médias (3)

Mot : - Tags -/collection

Autres articles (57)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

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

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

Sur d’autres sites (6705)

  • 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

  • trying to play corrupted mpeg-ts video using android video view

    20 avril 2015, par asafb

    i am having issue playing partial content of mepg-ts files

    the video files cannot be changed / reformatted / remuxed etc

    server setup :
    contains mpeg-ts video files with h264/acc
    has script that when requested using parameters returns on of the videos "cut"
    according to parameters

    -player :

    (i have no problem playing the full videos "uncut")
    i am trying to play this using android videoview,
    during researching i have found that vlc is the only player able to play the "cut" videos (aka windows mediaplayer, google exoplayer and chrome html5 video player are unable to play)
    running vlc at debug mode revealed error when playing cut video :
    ts error : MPEG-4 descriptor not found
    remuxing the partial content using ffmepg fixes the video

    solutions tried till now :
    1.tried remuxing on the fly using android MediaExtractor and MediaMuxer - but then found out that its not possiable doing that on the fly and anyway that MediaExtractor is unable to open "cut" video
    2.tried getting the first 10K of the full video and then append them to the rest of the "cut" video - the behvior stays the same (vlc able to play while rest wont)

    video files info :

    General
    Count : 278
    Count of stream of this kind : 1
    Kind of stream : General
    Kind of stream : General
    Stream identifier : 0
    ID : 55427
    ID : 55427 (0xD883)
    Count of video streams : 1
    Count of audio streams : 1
    Video_Format_List : AVC
    Video_Format_WithHint_List : AVC
    Codecs Video : AVC
    Audio_Format_List : AAC
    Audio_Format_WithHint_List : AAC
    Audio codecs : AAC LC
    Complete name : 20150416-12.mpg
    File name : 20150416-12
    File extension : mpg
    Format : MPEG-TS
    Format : MPEG-TS
    Format/Extensions usually used : ts m2t m2s m4t m4s ts tp trp
    Commercial name : MPEG-TS
    Internet media type : video/MP2T
    Codec : MPEG-TS
    Codec : MPEG-TS
    Codec/Extensions usually used : ts m2t m2s m4t m4s ts tp trp
    File size : 338329600
    File size : 323 MiB
    File size : 323 MiB
    File size : 323 MiB
    File size : 323 MiB
    File size : 322.7 MiB
    Duration : 27322.311111
    Duration : 27s 322ms
    Duration : 27s 322ms
    Duration : 27s 322ms
    Duration : 00:00:27.322
    Overall bit rate : 1567617
    Overall bit rate : 1 568 Kbps
    Delay : 5542662.322222
    Delay : 1h 32mn
    Delay : 1h 32mn 22s 662ms
    Delay : 1h 32mn
    Delay : 01:32:22.662
    File last modification date : UTC 2015-04-16 09:29:29
    File last modification date (local) : 2015-04-16 12:29:29

    Video
    Count : 205
    Count of stream of this kind : 1
    Kind of stream : Video
    Kind of stream : Video
    Stream identifier : 0
    ID : 68
    ID : 68 (0x44)
    Menu ID : 1
    Menu ID : 1 (0x1)
    Format : AVC
    Format/Info : Advanced Video Codec
    Format/Url : http://developers.videolan.org/x264.html
    Commercial name : AVC
    Format profile : Baseline@L3.0
    Format settings : 3 Ref Frames
    Format settings, CABAC : No
    Format settings, CABAC : No
    Format settings, ReFrames : 3
    Format settings, ReFrames : 3 frames
    Format settings, GOP : M=1, N=25
    Internet media type : video/H264
    Codec ID : 27
    Codec : AVC
    Codec : AVC
    Codec/Family : AVC
    Codec/Info : Advanced Video Codec
    Codec/Url : http://developers.videolan.org/x264.html
    Codec profile : Baseline@L3.0
    Codec settings : 3 Ref Frames
    Codec settings, CABAC : No
    Codec_Settings_RefFrames : 3
    Duration : 4100
    Duration : 4s 100ms
    Duration : 4s 100ms
    Duration : 4s 100ms
    Duration : 00:00:04.100
    Nominal bit rate : 1300000
    Nominal bit rate : 1 300 Kbps
    Width : 704
    Width : 704 pixels
    Height : 576
    Height : 576 pixels
    Pixel aspect ratio : 1.455
    Display aspect ratio : 1.778
    Display aspect ratio : 16:9
    Frame rate : 25.000
    Frame rate : 25.000 fps
    Frame count : 102
    Standard : PAL
    Resolution : 8
    Resolution : 8 bits
    Colorimetry : 4:2:0
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8
    Bit depth : 8 bits
    Scan type : Progressive
    Scan type : Progressive
    Interlacement : PPF
    Interlacement : Progressive
    Bits/(Pixel*Frame) : 0.128
    Writing library : x264 - core 115
    Writing library : x264 core 115
    Writing library/Name : x264
    Writing library/Version : core 115
    Encoding settings : cabac=0 / ref=3 / deblock=1:0:0 / analyse=0x1:0x11 / me=dia / subme=1 / 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=0 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=25 / keyint_min=2 / scenecut=40 / intra_refresh=0 / rc_lookahead=5 / rc=cbr / mbtree=1 / bitrate=1300 / ratetol=10.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / vbv_maxrate=1300 / vbv_bufsize=2000 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00

    Audio
    Count : 173
    Count of stream of this kind : 1
    Kind of stream : Audio
    Kind of stream : Audio
    Stream identifier : 0
    ID : 69
    ID : 69 (0x45)
    Menu ID : 1
    Menu ID : 1 (0x1)
    Format : AAC
    Format/Info : Advanced Audio Codec
    Commercial name : AAC
    Format version : Version 4
    Format profile : LC
    Muxing mode : ADTS
    Codec ID : 15
    Codec : AAC LC
    Codec : AAC LC
    Duration : 27322
    Duration : 27s 322ms
    Duration : 27s 322ms
    Duration : 27s 322ms
    Duration : 00:00:27.322
    Bit rate mode : VBR / VBR
    Bit rate mode : Variable / Variable
    Minimum bit rate : 99375
    Minimum bit rate : 99.4 Kbps
    Maximum bit rate : 159750
    Maximum bit rate : 160 Kbps
    Channel(s) : 2
    Channel(s) : 2 channels
    Channel positions : Front : L R
    Channel positions : 2/0/0
    Sampling rate : 48000
    Sampling rate : 48.0 KHz
    Samples count : 1311456
    Compression mode : Lossy
    Compression mode : Lossy

    i prefer finding solution without the need of NDK

    anyone has an idea how to tackle this issue ?
    Thanks

  • FFMPEG does HTTP range request only once (HTML5 MediaStream/WebM)

    17 décembre 2018, par Youssef Gamil

    The Issue

    I am trying to pass HTML5 MediaStream coming from a browser’s webcam to a Socket.IO namespace which is buffered and be accessible to FFMPEG through HTTP endpoint in form of HTTP partial/range requests. Although, it works on perfectly on Firefox/Chrome.

    Here, I have wrapped a sample and pushed it to a GitHub repo

    Environment

    Install

    • npm i from the project directory

    Run

    • npm start : to start the express server
    • Open http://localhost:3000 in Firefox or Chrome, and accept the webcam access dialog.
    • npm run ffmpeg -i http://localhost:3000/view output.webm : TODO : this doesn’t output the full stream
      • http://localhost:3000/view will be visible once it was opened in Firefox/Chrome and they’ll keep requesting till the end of stream or server down.
      • note, npm run ffmpeg ... is a just a shortcut to ffmpeg executable dependency which should be installed at startup in node_modules/@ffmpeg-installer/linux-x64/ffmpeg (which may differ depending on your OS)

    FFMPEG Log

    What I get after running ffmpeg -v trace -i http://localhost:3000/view -y tmp.mp4 :

    Reading option '-v' ... matched as option 'v' (set logging level) with argument 'trace'.
    Reading option '-i' ... matched as input url with argument 'http://localhost:3000/view'.
    Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
    Reading option 'tmp.mp4' ... matched as output url.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option v (set logging level) with argument trace.
    Applying option y (overwrite output files) with argument 1.
    Successfully parsed a group of options.
    Parsing a group of options: input url http://localhost:3000/view.
    Successfully parsed a group of options.
    Opening an input file: http://localhost:3000/view.
    [NULL @ 0x65f1c40] Opening 'http://localhost:3000/view' for reading
    [http @ 0x65f2540] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
    [tcp @ 0x65f4000] Original list of addresses:
    [tcp @ 0x65f4000] Address 127.0.0.1 port 3000
    [tcp @ 0x65f4000] Interleaved list of addresses:
    [tcp @ 0x65f4000] Address 127.0.0.1 port 3000
    [tcp @ 0x65f4000] Starting connection attempt to 127.0.0.1 port 3000
    [tcp @ 0x65f4000] Successfully connected to 127.0.0.1 port 3000
    [http @ 0x65f2540] request: GET /view HTTP/1.1
    User-Agent: Lavf/58.18.104
    Accept: */*
    Range: bytes=0-
    Connection: close
    Host: localhost:3000
    Icy-MetaData: 1


    [http @ 0x65f2540] header='HTTP/1.1 206 Partial Content'
    [http @ 0x65f2540] http_code=206
    [http @ 0x65f2540] header='X-Powered-By: Express'
    [http @ 0x65f2540] header='Access-Control-Allow-Origin: *'
    [http @ 0x65f2540] header='Content-Range: bytes 0-1391616/1073741824'
    [http @ 0x65f2540] header='Accept-Ranges: bytes'
    [http @ 0x65f2540] header='Content-Length: 1391616'
    [http @ 0x65f2540] header='Connection: close'
    [http @ 0x65f2540] header='Content-Type: video/webm'
    [http @ 0x65f2540] header='Date: Mon, 17 Dec 2018 10:15:14 GMT'
    [http @ 0x65f2540] header=''
    Probing matroska,webm score:100 size:2048
    Probing mp3 score:1 size:2048
    [matroska,webm @ 0x65f1c40] Format matroska,webm probed with size=2048 and score=100
    st:0 removing common factor 1000000 from timebase
    st:1 removing common factor 1000000 from timebase
    [matroska,webm @ 0x65f1c40] Before avformat_find_stream_info() pos: 317 bytes read:3837 seeks:0 nb_streams:2
    [matroska,webm @ 0x65f1c40] All info found
    [matroska,webm @ 0x65f1c40] rfps: 29.750000 0.016025
    [matroska,webm @ 0x65f1c40] rfps: 29.833333 0.013167
    [matroska,webm @ 0x65f1c40] rfps: 29.916667 0.012378
    [matroska,webm @ 0x65f1c40] rfps: 30.000000 0.013659
    [matroska,webm @ 0x65f1c40] rfps: 29.970030 0.012960
    [matroska,webm @ 0x65f1c40] stream 0: start_time: 0.000 duration: -9223372036854776.000
    [matroska,webm @ 0x65f1c40] stream 1: start_time: -0.001 duration: -9223372036854776.000
    [matroska,webm @ 0x65f1c40] format: start_time: -0.001 duration: -9223372036854.775 bitrate=0 kb/s
    [matroska,webm @ 0x65f1c40] After avformat_find_stream_info() pos: 467388 bytes read:469955 seeks:0 frames:115
    Input #0, matroska,webm, from 'http://localhost:3000/view':
     Metadata:
       encoder         : QTmuxingAppLibWebM-0.0.1
     Duration: N/A, start: -0.001000, bitrate: N/A
       Stream #0:0(eng), 41, 1/1000: Video: vp8, 1 reference frame, yuv420p(progressive), 640x480, 0/1, SAR 1:1 DAR 4:3, 1k tbr, 1k tbn, 1k tbc (default)
       Stream #0:1(eng), 74, 1/1000: Audio: opus, 48000 Hz, stereo, fltp, delay 312 (default)
    Successfully opened the file.
    Parsing a group of options: output url tmp.mp4.