Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (69)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (10177)

  • How do I properly reduce the resolution of a 360 video using ffmpeg ?

    10 avril 2017, par user3799235

    I have tried reduction with the following technique from a scale of 2048:1024 with something like : ffmpeg -i eagle360half.mp4 -vf scale=1024:512 video360_1024.mp4 however the playback then becomes warped and warbly (visually similar to a bad vhs tape). I can only speculate that this has something to do with the meridians and equirectangular projections. How would I properly scale/ reduce resolution of a 360 video using ffmpeg, or is this possible with some other cli tool ?

    Here is the output of mediainfo, ffmpeg, and then mediainfo again :

    #######################MEDIAINFO OUTPUT PRE-ENCODING#################
    $ mediainfo 360timessquare.mp4
    General
    Complete name                            : 360timessquare.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42
    File size                                : 235 MiB
    Duration                                 : 14mn 18s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 2 297 Kbps
    Encoded date                             : UTC 2016-10-21 19:11:41
    Tagged date                              : UTC 2016-10-21 19:11:41
    gsst                                     : 0
    gstd                                     : 858209

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : Main@L3.1
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 3 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 14mn 18s
    Bit rate                                 : 2 168 Kbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 25.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.094
    Stream size                              : 222 MiB (94%)
    Title                                    : ISO Media file produced by Google Inc.
    Encoded date                             : UTC 2016-10-21 19:11:41
    Tagged date                              : UTC 2016-10-21 19:11:41
    Color range                              : Limited
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709

    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 14mn 18s
    Bit rate mode                            : Variable
    Bit rate                                 : 126 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 44.1 KHz
    Compression mode                         : Lossy
    Stream size                              : 12.8 MiB (5%)
    Title                                    : ISO Media file produced by Google Inc.
    Encoded date                             : UTC 2016-10-21 19:11:41
    Tagged date                              : UTC 2016-10-21 19:11:41



    ########################FFMPEG   LOG:#############################
    $ffmpeg -i 360timessquare.mp4 -s 542x320 -o 360timessquare542x320.mp4
    ffmpeg version 2.4 Copyright (c) 2000-2014 the FFmpeg developers
    built on Sep 26 2015 22:27:26 with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
    configuration: --prefix=/usr --bindir=/usr/bin --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libfreetype --enable-fontconfig --enable-libspeex --enable-libtheora --enable-frei0r --enable-libopencv --enable-zlib --enable-shared --disable-htmlpages --disable-podpages --disable-txtpages
    libavutil      54.  7.100 / 54.  7.100
    libavcodec     56.  1.100 / 56.  1.100
    libavformat    56.  4.101 / 56.  4.101
    libavdevice    56.  0.100 / 56.  0.100
    libavfilter     5.  1.100 /  5.  1.100
    libswscale      3.  0.100 /  3.  0.100
    libswresample   1.  1.100 /  1.  1.100
    libpostproc    53.  0.100 / 53.  0.100
    Unrecognized option 'o'.
    Error splitting the argument list: Option not found
    [kevin@clipcentric 360Video]$ ffmpeg -i 360timessquare.mp4 -vf -s 542x320 360timessquare542x320.mp4
    ffmpeg version 2.4 Copyright (c) 2000-2014 the FFmpeg developers
    built on Sep 26 2015 22:27:26 with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
    configuration: --prefix=/usr --bindir=/usr/bin --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libfreetype --enable-fontconfig --enable-libspeex --enable-libtheora --enable-frei0r --enable-libopencv --enable-zlib --enable-shared --disable-htmlpages --disable-podpages --disable-txtpages
    libavutil      54.  7.100 / 54.  7.100
    libavcodec     56.  1.100 / 56.  1.100
    libavformat    56.  4.101 / 56.  4.101
    libavdevice    56.  0.100 / 56.  0.100
    libavfilter     5.  1.100 /  5.  1.100
    libswscale      3.  0.100 /  3.  0.100
    libswresample   1.  1.100 /  1.  1.100
    libpostproc    53.  0.100 / 53.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '360timessquare.mp4':
    Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-10-21 19:11:41
    Duration: 00:14:18.09, start: 0.000000, bitrate: 2296 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 2168 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
    creation_time   : 2016-10-21 19:11:41
    handler_name    : ISO Media file produced by Google Inc.
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
    creation_time   : 2016-10-21 19:11:41
    handler_name    : ISO Media file produced by Google Inc.
    [NULL @ 0x14a0120] Unable to find a suitable output format for '542x320'
    542x320: Invalid argument
    [kevin@clipcentric 360Video]$ ffmpeg -i 360timessquare.mp4 -s 542x320 360timessquare542x320.mp4
    ffmpeg version 2.4 Copyright (c) 2000-2014 the FFmpeg developers
    built on Sep 26 2015 22:27:26 with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
    configuration: --prefix=/usr --bindir=/usr/bin --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libfreetype --enable-fontconfig --enable-libspeex --enable-libtheora --enable-frei0r --enable-libopencv --enable-zlib --enable-shared --disable-htmlpages --disable-podpages --disable-txtpages
    libavutil      54.  7.100 / 54.  7.100
    libavcodec     56.  1.100 / 56.  1.100
    libavformat    56.  4.101 / 56.  4.101
    libavdevice    56.  0.100 / 56.  0.100
    libavfilter     5.  1.100 /  5.  1.100
    libswscale      3.  0.100 /  3.  0.100
    libswresample   1.  1.100 /  1.  1.100
    libpostproc    53.  0.100 / 53.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '360timessquare.mp4':
    Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-10-21 19:11:41
    Duration: 00:14:18.09, start: 0.000000, bitrate: 2296 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 2168 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
    creation_time   : 2016-10-21 19:11:41
    handler_name    : ISO Media file produced by Google Inc.
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
    creation_time   : 2016-10-21 19:11:41
    handler_name    : ISO Media file produced by Google Inc.
    [libx264 @ 0x25f7a60] using SAR=2560/2439
    [libx264 @ 0x25f7a60] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    [libx264 @ 0x25f7a60] profile High, level 2.1
    [libx264 @ 0x25f7a60] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - 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_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 '360timessquare542x320.mp4':
    Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf56.4.101
    Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 542x320 [SAR 2560:2439 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
    creation_time   : 2016-10-21 19:11:41
    handler_name    : ISO Media file produced by Google Inc.
    encoder         : Lavc56.1.100 libx264
    Stream #0:1(und): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s (default)
    Metadata:
    creation_time   : 2016-10-21 19:11:41
    handler_name    : ISO Media file produced by Google Inc.
    encoder         : Lavc56.1.100 libfdk_aac
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
    Stream #0:1 -> #0:1 (aac (native) -> aac (libfdk_aac))
    Press [q] to stop, [?] for help
    frame=21452 fps= 66 q=-1.0 Lsize=   64454kB time=00:14:18.09 bitrate= 615.3kbits/s
    video:50428kB audio:13439kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.918954%
    [libx264 @ 0x25f7a60] frame I:86    Avg QP:19.09  size: 45669
    [libx264 @ 0x25f7a60] frame P:18026 Avg QP:22.11  size:  2541
    [libx264 @ 0x25f7a60] frame B:3340  Avg QP:29.11  size:   572
    [libx264 @ 0x25f7a60] consecutive B-frames: 75.9%  6.9%  9.6%  7.6%
    [libx264 @ 0x25f7a60] mb I  I16..4:  3.4% 30.9% 65.7%
    [libx264 @ 0x25f7a60] mb P  I16..4:  0.1%  0.3%  0.3%  P16..4: 25.1%  6.6%  7.4%  0.0%  0.0%    skip:60.2%
    [libx264 @ 0x25f7a60] mb B  I16..4:  0.0%  0.1%  0.1%  B16..8: 13.3%  2.4%  1.3%  direct: 1.9%  skip:81.0%  L0:25.9% L1:66.1% BI: 8.0%
    [libx264 @ 0x25f7a60] 8x8 transform intra:38.5% inter:48.3%
    [libx264 @ 0x25f7a60] coded y,uvDC,uvAC intra: 81.5% 84.3% 58.6% inter: 14.3% 14.5% 2.8%
    [libx264 @ 0x25f7a60] i16 v,h,dc,p:  7% 49%  7% 37%
    [libx264 @ 0x25f7a60] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 25% 17%  5%  7%  7% 11%  8%  9%
    [libx264 @ 0x25f7a60] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 18% 14%  7%  8% 10% 11%  9%  7%
    [libx264 @ 0x25f7a60] i8c dc,h,v,p: 51% 25% 15%  9%
    [libx264 @ 0x25f7a60] Weighted P-Frames: Y:1.5% UV:0.3%
    [libx264 @ 0x25f7a60] ref P L0: 77.6% 15.9%  5.2%  1.3%  0.0%
    [libx264 @ 0x25f7a60] ref B L0: 94.0%  5.1%  0.9%
    [libx264 @ 0x25f7a60] ref B L1: 96.1%  3.9%
    [libx264 @ 0x25f7a60] kb/s:481.43

    #################POST ENCODING #####################
    $ mediainfo 360timessquare542x320.mp4
    General
    Complete name                            : 360timessquare542x320.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom
    File size                                : 62.9 MiB
    Duration                                 : 14mn 18s
    Overall bit rate                         : 615 Kbps
    Encoded date                             : UTC 1904-01-01 00:00:00
    Tagged date                              : UTC 1904-01-01 00:00:00
    Writing application                      : Lavf56.4.101

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L2.1
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 14mn 18s
    Bit rate                                 : 481 Kbps
    Width                                    : 542 pixels
    Height                                   : 320 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 25.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.111
    Stream size                              : 49.2 MiB (78%)
    Writing library                          : x264 core 142
    Encoding settings                        : 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_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
    Encoded date                             : UTC 1904-01-01 00:00:00
    Tagged date                              : UTC 1904-01-01 00:00:00

    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 14mn 18s
    Bit rate mode                            : Constant
    Bit rate                                 : 128 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 44.1 KHz
    Compression mode                         : Lossy
    Stream size                              : 13.1 MiB (21%)
    Encoded date                             : UTC 1904-01-01 00:00:00
    Tagged date                              : UTC 1904-01-01 00:00:00
  • WebM file not seekable in Chrome when loaded through PHP (other browsers work)

    13 avril 2014, par Zoon

    I am having a mind-boggling problem, I just can't seem to resolve.

    Providing a WebM file through PHP is nothing new in my world, and I even know how to work with HTTP 206 Partial Content. But for some reason Chrome does not like it.

    A simple HTML5 video playback

    <video width="640" height="360" poster="picture/preview/V00000006.jpg" controls="controls" preload="preload">
       <source type="video/webm" src="/video/V00000006.webm">
    </source></video>

    where /video/V00000006.webm is rewritten to a PHP-file in Apache, will playback just fine.
    But in Chrome the seekbar is not effective. When clicking on the seekbar the player will freeze and no longer playback until page is refreshed. Firefox handles it just fine !

    If I change /video/V00000006.webm to be a direct link to the same video it works just fine. I even compared the network requests between the two versions (with and without PHP) and there is barely any difference in the first request, but the second is failing in the PHP-delivered video.

    Initial request and seek request for Apache-delivered video file :

        Request URL :http://mytestserver.net/movie1152x720.webm
        Request Method:GET
        Status Code:206 Partial Content
        Request Headers
        Accept :*/*
        Accept-Encoding:identity ;q=1, * ;q=0
        Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4
        Cache-Control:no-cache
        Connection:keep-alive
        Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail=
        Host:mytestserver.net
        Pragma:no-cache
        Range:bytes=0-
        Referer :http://mytestserver.net/video.html
        User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
        Response Headers
        Accept-Ranges:bytes
        Connection:close
        Content-Length:4446451
        Content-Range:bytes 0-4446450/4446451
        Content-Type:video/webm
        Date:Fri, 11 Apr 2014 13:07:30 GMT
        ETag :"d2d0027-43d8f3-b91417c0"
        Last-Modified:Fri, 11 Apr 2014 12:46:31 GMT
        Server:Apache/2.2.3 (CentOS)
    

    Request URL :http://mytestserver.net/movie1152x720.webm
    Request Method:GET
    Status Code:206 Partial Content
    Request Headers
    Accept :*/*
    Accept-Encoding:identity ;q=1, * ;q=0
    Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4
    Cache-Control:no-cache
    Connection:keep-alive
    Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail=
    Host:mytestserver.net
    Pragma:no-cache
    Range:bytes=4445881-
    Referer :http://mytestserver.net/video.html
    User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
    Response Headers
    Accept-Ranges:bytes
    Connection:close
    Content-Length:570
    Content-Range:bytes 4445881-4446450/4446451
    Content-Type:video/webm
    Date:Fri, 11 Apr 2014 13:09:02 GMT
    ETag :"d2d0027-43d8f3-b91417c0"
    Last-Modified:Fri, 11 Apr 2014 12:46:31 GMT
    Server:Apache/2.2.3 (CentOS)

    Initial request and seek request for PHP-streamed video :

        Request URL :http://mytestserver.net/video/V00000006.webm
        Request Method:GET
        Status Code:206 Partial Content
        Request Headers
        Accept :*/*
        Accept-Encoding:identity ;q=1, * ;q=0
        Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4
        Cache-Control:no-cache
        Connection:keep-alive
        Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail=
        Host:mytestserver.net
        Pragma:no-cache
        Range:bytes=0-
        Referer :http://mytestserver.net/video.html
        User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
        Response Headers
        Accept-Ranges:bytes
        Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
        Connection:close
        Content-Length:8566268
        Content-Range:bytes 0-8566267/8566268
        Content-Type:video/webm
        Date:Fri, 11 Apr 2014 13:31:27 GMT
        Expires:Thu, 19 Nov 1981 08:52:00 GMT
        Pragma:no-cache
        Server:Apache/2.2.3 (CentOS)
        X-Powered-By:PHP/5.3.27
    

    Request URL :http://mytestserver.net/video/V00000006.webm
    Request Headers CAUTION : Provisional headers are shown.
    Accept-Encoding:identity ;q=1, * ;q=0
    Cache-Control:no-cache
    Pragma:no-cache
    Range:bytes=4338314-
    Referer :http://mytestserver.net/video.html
    User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36

    Notice how the second request does not complete, Provisional headers are shown.

    I have tried altering the cache headers, setting it to the future, setting them blank and using file attachment headers.

    I tried fiddling around a lot with the serving code, but lately I have ended up with a simple example.

    &lt;?php

    $path = &#39;test.webm&#39;;

    $size=filesize($path);

    $fm=@fopen($path,&#39;rb&#39;);
    if(!$fm) {
     header ("HTTP/1.0 404 Not Found");
     die();
    }

    $begin=0;
    $end = $size-1;

    if(isset($_SERVER[&#39;HTTP_RANGE&#39;])) {
     if(preg_match(&#39;/bytes=\h*(\d+)-(\d*)[\D.*]?/i&#39;, $_SERVER[&#39;HTTP_RANGE&#39;], $matches)) {
       $begin=intval($matches[0]);
       if(!empty($matches[1])) {
         $end=intval($matches[1]);
       }
     }
    }

    if($begin>0||$end&lt;$size)
     header(&#39;HTTP/1.0 206 Partial Content&#39;);
    else
     header(&#39;HTTP/1.0 200 OK&#39;);

    header("Content-Type: video/webm");
    header(&#39;Accept-Ranges: bytes&#39;);
    header(&#39;Content-Length:&#39;.($end-$begin+1));
    header("Content-Disposition: inline;");
    header("Content-Range: bytes $begin-$end/$size");
    header("Content-Transfer-Encoding: binary\n");
    header(&#39;Connection: close&#39;);

    ob_get_clean();
    flush();

    $f = fopen($path, &#39;r&#39;);
    fseek($f, $offset);

    $pos = 0;
    $length = $end-$begin;

    while($pos &lt; $length)
    {
       $chunk = min($length-$pos, 1024);

       echo fread($f, $chunk);
       flush();

       $pos += $chunk;
    }
    ?>

    Please note, entering the PHP-delivered video URL directly into the browser does not make a difference from showing it in a HTML page.

    I hope someone has an answer to why seeking might not work. Let me know if you have any suggestions.

    Thanks !

  • How to get ffmpeg split results in a streaming-like way ?

    15 décembre 2016, par Alex

    My goal is to transfer video files to another peer using webRTC and play it in real time on web page. In case of lag, I decided to split video files before tranferring. I’m using ffmpeg (actually a javascript version here) to split videos using commands like

    ffmpeg -i input.mp4 -codec copy -map 0 -f segment out%0d.mp4

    , which will get a series of output files at the same time. But I want to transfer the output files one by one and start to play them in right order before getting all output files, can i do that ?