Recherche avancée

Médias (91)

Autres articles (50)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

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

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

Sur d’autres sites (7027)

  • Streaming video .mp4 H.264 baseline not working on some videos [duplicate]

    8 janvier 2019, par D. B.

    I use server to stream recorder videos on Android phones and play them in Android app later. However I noticed that I am not able to play all videos, I used ffmpeg to see if there is any difference in recorded videos and where the issue might be.
    That is an example of loading and playing video :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'w1.mp4':


    Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       creation_time   : 2019-01-07T15:38:52.000000Z
       com.android.version: 8.1.0
     Duration: 00:00:04.94, start: 0.000000, bitrate: 5003 kb/s
       Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 720x480, 4951 kb/s, SAR 1:1 DAR 3:2, 27.71 fps, 30 tbr, 90k tbn, 180k tbc (default)
       Metadata:
         rotate          : 90
         creation_time   : 2019-01-07T15:38:52.000000Z
         handler_name    : VideoHandle
       Side data:
         displaymatrix: rotation of -90.00 degrees
       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 48 kb/s (default)
       Metadata:
         creation_time   : 2019-01-07T15:38:52.000000Z
         handler_name    : SoundHandle
       "streams": [
           {
               "index": 0,
               "codec_name": "h264",
               "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
               "profile": "Baseline",
               "codec_type": "video",
               "codec_time_base": "444929/24660000",
               "codec_tag_string": "avc1",
               "codec_tag": "0x31637661",
               "width": 720,
               "height": 480,
               "coded_width": 720,
               "coded_height": 480,
               "has_b_frames": 0,
               "sample_aspect_ratio": "1:1",
               "display_aspect_ratio": "3:2",
               "pix_fmt": "yuv420p",
               "level": 30,
               "color_range": "tv",
               "color_space": "smpte170m",
               "color_transfer": "smpte170m",
               "color_primaries": "bt470bg",
               "chroma_location": "left",
               "refs": 1,
               "is_avc": "true",
               "nal_length_size": "4",
               "r_frame_rate": "30/1",
               "avg_frame_rate": "12330000/444929",
               "time_base": "1/90000",
               "start_pts": 0,
               "start_time": "0.000000",
               "duration_ts": 444929,
               "duration": "4.943656",
               "bit_rate": "4951506",
               "bits_per_raw_sample": "8",
               "nb_frames": "137",
               "disposition": {
                   "default": 1,
                   "dub": 0,
                   "original": 0,
                   "comment": 0,
                   "lyrics": 0,
                   "karaoke": 0,
                   "forced": 0,
                   "hearing_impaired": 0,
                   "visual_impaired": 0,
                   "clean_effects": 0,
                   "attached_pic": 0,
                   "timed_thumbnails": 0
               },
               "tags": {
                   "rotate": "90",
                   "creation_time": "2019-01-07T15:38:52.000000Z",
                   "language": "eng",
                   "handler_name": "VideoHandle"
               },
               "side_data_list": [
                   {
                       "side_data_type": "Display Matrix",
                       "displaymatrix": "\n00000000:            0       65536           0\n00000001:       -65536           0           0\n00000002:            0           0  1073741824\n",
                       "rotation": -90
                   }
               ]
           }
       ]
    }

    Next is the example of not working video :

    [mov,mp4,m4a,3gp,3g2,mj2 @ 000001ea0adcd700] sample aspect ratio already set to 1:1, ignoring 'pasp' atom (65536:65536)
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'notworking.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       creation_time   : 2018-12-30T14:20:23.000000Z
       com.android.version: 7.0
     Duration: 00:00:10.16, start: 0.000000, bitrate: 5240 kb/s
       Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 720x480, 5223 kb/s, SAR 1:1 DAR 3:2, 29.30 fps, 59.94 tbr, 90k tbn, 180k tbc (default)
       Metadata:
         rotate          : 90
         creation_time   : 2018-12-30T14:20:23.000000Z
         handler_name    : VideoHandle
       Side data:
         displaymatrix: rotation of -90.00 degrees
       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 12 kb/s (default)
       Metadata:
         creation_time   : 2018-12-30T14:20:23.000000Z
         handler_name    : SoundHandle
       "streams": [
           {
               "index": 0,
               "codec_name": "h264",
               "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
               "profile": "Baseline",
               "codec_type": "video",
               "codec_time_base": "20751/1216000",
               "codec_tag_string": "avc1",
               "codec_tag": "0x31637661",
               "width": 720,
               "height": 480,
               "coded_width": 720,
               "coded_height": 480,
               "has_b_frames": 0,
               "sample_aspect_ratio": "1:1",
               "display_aspect_ratio": "3:2",
               "pix_fmt": "yuv420p",
               "level": 30,
               "color_range": "tv",
               "color_space": "smpte170m",
               "color_transfer": "smpte170m",
               "color_primaries": "bt470bg",
               "chroma_location": "left",
               "refs": 1,
               "is_avc": "true",
               "nal_length_size": "4",
               "r_frame_rate": "60000/1001",
               "avg_frame_rate": "608000/20751",
               "time_base": "1/90000",
               "start_pts": 0,
               "start_time": "0.000000",
               "duration_ts": 914271,
               "duration": "10.158567",
               "bit_rate": "5223363",
               "bits_per_raw_sample": "8",
               "nb_frames": "304",
               "disposition": {
                   "default": 1,
                   "dub": 0,
                   "original": 0,
                   "comment": 0,
                   "lyrics": 0,
                   "karaoke": 0,
                   "forced": 0,
                   "hearing_impaired": 0,
                   "visual_impaired": 0,
                   "clean_effects": 0,
                   "attached_pic": 0,
                   "timed_thumbnails": 0
               },
               "tags": {
                   "rotate": "90",
                   "creation_time": "2018-12-30T14:20:23.000000Z",
                   "language": "eng",
                   "handler_name": "VideoHandle"
               },
               "side_data_list": [
                   {
                       "side_data_type": "Display Matrix",
                       "displaymatrix": "\n00000000:            0       65536           0\n00000001:       -65536           0           0\n00000002:            0           0  1073741824\n",
                       "rotation": -90
                   }
               ]
           }
       ]
    }

    I cannot see any difference in the videos characteristics. Both are baseline H.264.
    Both videos are playing in chrome when I access them via direct links, the problem is on android versions 6, 7, 8.
    There is strange thing because when I downloaded that not loading video directly and put in the android app to raw folder and played it directly everything worked perfectly.
    I checked if the problem was bandwidth, so I uploaded bigger video about 12Mbs, mp4 as well H.264 Main and then streamed it to the app and it worked like a charm. So I suspect that the issue might be with recording bigger files within my android app.
    To stream video I only use MediaPlayer.

    That is an example of the video I uploaded and later streamed :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '123456.mp4':


    Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       creation_time   : 2018-01-30T06:50:54.000000Z
     Duration: 00:02:29.16, start: 0.000000, bitrate: 700 kb/s
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 571 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
       Metadata:
         creation_time   : 2018-01-30T06:50:54.000000Z
         handler_name    : ISO Media file. Created on: 01/29/2018.
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
       Metadata:
         creation_time   : 2018-01-30T06:50:54.000000Z
         handler_name    : ISO Media file. Created on: 01/29/2018.
       "streams": [
           {
               "index": 0,
               "codec_name": "h264",
               "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
               "profile": "Main",
               "codec_type": "video",
               "codec_time_base": "1/50",
               "codec_tag_string": "avc1",
               "codec_tag": "0x31637661",
               "width": 1280,
               "height": 720,
               "coded_width": 1280,
               "coded_height": 720,
               "has_b_frames": 1,
               "sample_aspect_ratio": "1:1",
               "display_aspect_ratio": "16:9",
               "pix_fmt": "yuv420p",
               "level": 31,
               "color_range": "tv",
               "color_space": "bt709",
               "color_transfer": "bt709",
               "color_primaries": "bt709",
               "chroma_location": "left",
               "refs": 1,
               "is_avc": "true",
               "nal_length_size": "4",
               "r_frame_rate": "25/1",
               "avg_frame_rate": "25/1",
               "time_base": "1/90000",
               "start_pts": 0,
               "start_time": "0.000000",
               "duration_ts": 13424400,
               "duration": "149.160000",
               "bit_rate": "571258",
               "bits_per_raw_sample": "8",
               "nb_frames": "3729",
               "disposition": {
                   "default": 1,
                   "dub": 0,
                   "original": 0,
                   "comment": 0,
                   "lyrics": 0,
                   "karaoke": 0,
                   "forced": 0,
                   "hearing_impaired": 0,
                   "visual_impaired": 0,
                   "clean_effects": 0,
                   "attached_pic": 0,
                   "timed_thumbnails": 0
               },
               "tags": {
                   "creation_time": "2018-01-30T06:50:54.000000Z",
                   "language": "und",
                   "handler_name": "ISO Media file. Created on: 01/29/2018."
               }
           }
       ]
    }

    Is there any chance that my hosting provider uses some kind of software that can manipulate data that is on the server?

    I also check manually other videos from different websites by inserting links manually in the code to check if MediaPlayer works correctly and every video was playing.

  • HLS Event Stream from Azure Blob Storage

    23 janvier 2019, par nemesis_567

    Alright, so I encode videos of around 30 seconds with ffmpeg, the following flags :

    ffmpeg.exe -i \"{filename}\"  -f hls -hls_segment_type fmp4 -hls_flags single_file -hls_time 5 -g 1 \"{outname}.m3u8\"

    This generates a single playlist with an m4s and m3u8 file :

    #EXTM3U
    #EXT-X-VERSION:7
    #EXT-X-TARGETDURATION:5
    #EXT-X-MEDIA-SEQUENCE:0
    #EXT-X-MAP:URI="1e02982a-c455-40f5-8229-1033a640c91c-0.mp4.m4s",BYTERANGE="818@0"
    #EXTINF:4.781911,
    #EXT-X-BYTERANGE:1398720@5953584
    1e02982a-c455-40f5-8229-1033a640c91c-0.mp4.m4s
    #EXTINF:5.063200,
    #EXT-X-BYTERANGE:1490276@7352304
    1e02982a-c455-40f5-8229-1033a640c91c-0.mp4.m4s
    #EXTINF:5.063200,
    #EXT-X-BYTERANGE:1484824@8842580
    1e02982a-c455-40f5-8229-1033a640c91c-0.mp4.m4s
    #EXTINF:5.063200,
    #EXT-X-BYTERANGE:1468656@10327404
    1e02982a-c455-40f5-8229-1033a640c91c-0.mp4.m4s
    #EXTINF:1.969022,
    #EXT-X-BYTERANGE:576408@11796060
    1e02982a-c455-40f5-8229-1033a640c91c-0.mp4.m4s
    #EXT-X-ENDLIST

    I take this playlist and append several others that are just the same as they come adding a DIscontinuity tag and between each of them and removing unneeded tags. While doing this I replace the filenames with a working SAS URL for the actual files.

    Which results in files of the following type :

    #EXTM3U
    #EXT-X-PLAYLIST-TYPE:EVENT
    #EXT-X-VERSION:7
    #EXT-X-TARGETDURATION:10
    #EXT-X-MEDIA-SEQUENCE:0
    #EXT-X-INDEPENDENT-SEGMENTS
    #EXT-X-MAP:URI="https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/1-frag.m4s?sv=2018-03-28&sr=b&sig=el%2F529BGb4Xjeetiv9kxaHAxGYC%2BwogSYgvCivq1tlc%3D&st=2019-01-10T05%3A09%3A13Z&se=2021-01-10T05%3A14%3A13Z&sp=rw",BYTERANGE="818@0"
    #EXTINF:4.654771,
    #EXT-X-BYTERANGE:1474761@4854677
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/1-frag.m4s?sv=2018-03-28&sr=b&sig=el%2F529BGb4Xjeetiv9kxaHAxGYC%2BwogSYgvCivq1tlc%3D&st=2019-01-10T05%3A09%3A13Z&se=2021-01-10T05%3A14%3A13Z&sp=rw
    #EXTINF:5.430566,
    #EXT-X-BYTERANGE:1716825@6329438
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/1-frag.m4s?sv=2018-03-28&sr=b&sig=el%2F529BGb4Xjeetiv9kxaHAxGYC%2BwogSYgvCivq1tlc%3D&st=2019-01-10T05%3A09%3A13Z&se=2021-01-10T05%3A14%3A13Z&sp=rw
    #EXTINF:4.654771,
    #EXT-X-BYTERANGE:1479725@8046263
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/1-frag.m4s?sv=2018-03-28&sr=b&sig=el%2F529BGb4Xjeetiv9kxaHAxGYC%2BwogSYgvCivq1tlc%3D&st=2019-01-10T05%3A09%3A13Z&se=2021-01-10T05%3A14%3A13Z&sp=rw
    #EXTINF:5.430566,
    #EXT-X-BYTERANGE:1710125@9525988
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/1-frag.m4s?sv=2018-03-28&sr=b&sig=el%2F529BGb4Xjeetiv9kxaHAxGYC%2BwogSYgvCivq1tlc%3D&st=2019-01-10T05%3A09%3A13Z&se=2021-01-10T05%3A14%3A13Z&sp=rw
    #EXTINF:3.103181,
    #EXT-X-BYTERANGE:200@11236113
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/1-frag.m4s?sv=2018-03-28&sr=b&sig=el%2F529BGb4Xjeetiv9kxaHAxGYC%2BwogSYgvCivq1tlc%3D&st=2019-01-10T05%3A09%3A13Z&se=2021-01-10T05%3A14%3A13Z&sp=rw
    #EXT-X-DISCONTINUITY
    #EXT-X-MAP:URI="https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/2-frag.m4s?sv=2018-03-28&sr=b&sig=s3s3R1sjE6lZRgfmaYdOkOGCr7BYkOrygBy%2F90crwvM%3D&st=2019-01-10T05%3A09%3A53Z&se=2021-01-10T05%3A14%3A53Z&sp=rw",BYTERANGE="819@0"
    #EXTINF:4.897959,
    #EXT-X-BYTERANGE:1506220@6184008
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/2-frag.m4s?sv=2018-03-28&sr=b&sig=s3s3R1sjE6lZRgfmaYdOkOGCr7BYkOrygBy%2F90crwvM%3D&st=2019-01-10T05%3A09%3A53Z&se=2021-01-10T05%3A14%3A53Z&sp=rw
    #EXTINF:4.897959,
    #EXT-X-BYTERANGE:1496289@7690228
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/2-frag.m4s?sv=2018-03-28&sr=b&sig=s3s3R1sjE6lZRgfmaYdOkOGCr7BYkOrygBy%2F90crwvM%3D&st=2019-01-10T05%3A09%3A53Z&se=2021-01-10T05%3A14%3A53Z&sp=rw
    #EXTINF:4.897959,
    #EXT-X-BYTERANGE:1516854@9186517
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/2-frag.m4s?sv=2018-03-28&sr=b&sig=s3s3R1sjE6lZRgfmaYdOkOGCr7BYkOrygBy%2F90crwvM%3D&st=2019-01-10T05%3A09%3A53Z&se=2021-01-10T05%3A14%3A53Z&sp=rw
    #EXTINF:4.897959,
    #EXT-X-BYTERANGE:1492617@10703371
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/2-frag.m4s?sv=2018-03-28&sr=b&sig=s3s3R1sjE6lZRgfmaYdOkOGCr7BYkOrygBy%2F90crwvM%3D&st=2019-01-10T05%3A09%3A53Z&se=2021-01-10T05%3A14%3A53Z&sp=rw
    #EXTINF:0.816327,
    #EXT-X-BYTERANGE:219@12195988
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/2-frag.m4s?sv=2018-03-28&sr=b&sig=s3s3R1sjE6lZRgfmaYdOkOGCr7BYkOrygBy%2F90crwvM%3D&st=2019-01-10T05%3A09%3A53Z&se=2021-01-10T05%3A14%3A53Z&sp=rw
    #EXT-X-DISCONTINUITY
    #EXT-X-MAP:URI="https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/3-frag.m4s?sv=2018-03-28&sr=b&sig=O%2B%2FQBnVcyIzn2r3T8S7xq2dic9LKW3q7p2bGSYen%2BbI%3D&st=2019-01-10T05%3A10%3A43Z&se=2021-01-10T05%3A15%3A43Z&sp=rw",BYTERANGE="820@0"
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1352781@6631869
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/3-frag.m4s?sv=2018-03-28&sr=b&sig=O%2B%2FQBnVcyIzn2r3T8S7xq2dic9LKW3q7p2bGSYen%2BbI%3D&st=2019-01-10T05%3A10%3A43Z&se=2021-01-10T05%3A15%3A43Z&sp=rw
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1357320@7984650
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/3-frag.m4s?sv=2018-03-28&sr=b&sig=O%2B%2FQBnVcyIzn2r3T8S7xq2dic9LKW3q7p2bGSYen%2BbI%3D&st=2019-01-10T05%3A10%3A43Z&se=2021-01-10T05%3A15%3A43Z&sp=rw
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1360645@9341970
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/3-frag.m4s?sv=2018-03-28&sr=b&sig=O%2B%2FQBnVcyIzn2r3T8S7xq2dic9LKW3q7p2bGSYen%2BbI%3D&st=2019-01-10T05%3A10%3A43Z&se=2021-01-10T05%3A15%3A43Z&sp=rw
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1334946@10702615
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/3-frag.m4s?sv=2018-03-28&sr=b&sig=O%2B%2FQBnVcyIzn2r3T8S7xq2dic9LKW3q7p2bGSYen%2BbI%3D&st=2019-01-10T05%3A10%3A43Z&se=2021-01-10T05%3A15%3A43Z&sp=rw
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:238@12037561
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/3-frag.m4s?sv=2018-03-28&sr=b&sig=O%2B%2FQBnVcyIzn2r3T8S7xq2dic9LKW3q7p2bGSYen%2BbI%3D&st=2019-01-10T05%3A10%3A43Z&se=2021-01-10T05%3A15%3A43Z&sp=rw
    #EXT-X-DISCONTINUITY
    #EXT-X-MAP:URI="https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/4-frag.m4s?sv=2018-03-28&sr=b&sig=jPsSq8%2FfNzfjUx5bauJs7mkLu8w%2FYFKLaeLRBu8lPzg%3D&st=2019-01-10T05%3A11%3A25Z&se=2021-01-10T05%3A16%3A25Z&sp=rw",BYTERANGE="820@0"
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1359259@6647772
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/4-frag.m4s?sv=2018-03-28&sr=b&sig=jPsSq8%2FfNzfjUx5bauJs7mkLu8w%2FYFKLaeLRBu8lPzg%3D&st=2019-01-10T05%3A11%3A25Z&se=2021-01-10T05%3A16%3A25Z&sp=rw
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1353269@8007031
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/4-frag.m4s?sv=2018-03-28&sr=b&sig=jPsSq8%2FfNzfjUx5bauJs7mkLu8w%2FYFKLaeLRBu8lPzg%3D&st=2019-01-10T05%3A11%3A25Z&se=2021-01-10T05%3A16%3A25Z&sp=rw
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1359724@9360300
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/4-frag.m4s?sv=2018-03-28&sr=b&sig=jPsSq8%2FfNzfjUx5bauJs7mkLu8w%2FYFKLaeLRBu8lPzg%3D&st=2019-01-10T05%3A11%3A25Z&se=2021-01-10T05%3A16%3A25Z&sp=rw
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1339437@10720024
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/4-frag.m4s?sv=2018-03-28&sr=b&sig=jPsSq8%2FfNzfjUx5bauJs7mkLu8w%2FYFKLaeLRBu8lPzg%3D&st=2019-01-10T05%3A11%3A25Z&se=2021-01-10T05%3A16%3A25Z&sp=rw
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:238@12059461
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/4-frag.m4s?sv=2018-03-28&sr=b&sig=jPsSq8%2FfNzfjUx5bauJs7mkLu8w%2FYFKLaeLRBu8lPzg%3D&st=2019-01-10T05%3A11%3A25Z&se=2021-01-10T05%3A16%3A25Z&sp=rw
    #EXT-X-DISCONTINUITY
    #EXT-X-MAP:URI="https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/4-frag.m4s?sv=2018-03-28&sr=b&sig=yfgkYvCLFjt384tsDZZ2ahVfPI4XxoCyyWepmux4rvc%3D&st=2019-01-10T05%3A12%3A12Z&se=2021-01-10T05%3A17%3A12Z&sp=rw",BYTERANGE="820@0"
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1371742@6775319
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/4-frag.m4s?sv=2018-03-28&sr=b&sig=yfgkYvCLFjt384tsDZZ2ahVfPI4XxoCyyWepmux4rvc%3D&st=2019-01-10T05%3A12%3A12Z&se=2021-01-10T05%3A17%3A12Z&sp=rw
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1389742@8147061
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/4-frag.m4s?sv=2018-03-28&sr=b&sig=yfgkYvCLFjt384tsDZZ2ahVfPI4XxoCyyWepmux4rvc%3D&st=2019-01-10T05%3A12%3A12Z&se=2021-01-10T05%3A17%3A12Z&sp=rw
    #EXTINF:5.000000,
    #EXT-X-BYTERANGE:1377900@9536803
    https://vsatstreams.blob.core.windows.net/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/75888d6c-41fb-4cb0-9573-0e2ab7a6dc4c/4-frag.m4s?sv=2018-03-28&sr=b&sig=yfgkYvCLFjt384tsDZZ2ahVfPI4XxoCyyWepmux4rvc%3D&st=2019-01-10T05%3A12%3A12Z&se=2021-01-10T05%3A17%3A12Z&sp=rw
    #EXTINF:5.000000,

    Link for file is here

    This stream does not play in chrome with video.js, and only plays in bitmovin client, but it constantly fails with buffer append/stalled errors. In firefox it plays, but without much reliability.

    So what am I doing wrong in this process ? I’ve checked the specification for HLS several times, can’t see what I’m doing wrong, or what the player expects.

    Please check hls.js player, with the following URL which uses the stream above to see what I’m talking about.
    HLS.JS Demo Player With My Playlist

  • ffmpeg conversion of jpg to mp4 fails due to to jpg frames change

    14 janvier 2019, par Sebastien Damaye

    I’m trying to compile a set of jpg (camera screenshots taken every 5 seconds) to a mp4. The ffmpeg command works fine but the resulting mp4 is missing some images. I noticed that the "holes" are created when the jpg "frames" is changing from 1 to 3 in the jpg sequence (see below result of file that shows frames 1 for the 1st jpg and frames 3 for the 2nd one) :

    $ file 20190110060113.jpg
    20190110060113.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 1280x720, frames 1

    $ file 20190110060119.jpg
    20190110060119.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 1280x720, frames 3

    And with ffmpeg, it sows :

    ffmpeg -i 20190110060113.jpg -i 20190110060119.jpg
    ffmpeg version 3.2.10-1~deb9u1~bpo8+1 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 4.9.2 (Debian 4.9.2-10)
     configuration: --prefix=/usr --extra-version='1~deb9u1~bpo8+1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --disable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    Input #0, image2, from '20190110060113.jpg':
     Duration: 00:00:00.04, start: 0.000000, bitrate: 13395 kb/s
       Stream #0:0: Video: mjpeg, gray(bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
    Input #1, image2, from '20190110060119.jpg':
     Duration: 00:00:00.04, start: 0.000000, bitrate: 21463 kb/s
       Stream #1:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
    At least one output file must be specified

    Below is the command I’m using to compile the mp4 from the jpg :

    ffmpeg -r 25 -f image2 -s 1280x720 -i /data/camipjpg/%*.jpg -vcodec libx264 -crf 25 -pix_fmt yuv420p /data/camipmgpg/20190110.mp4

    For the sake of curiosity, I investigated and noticed that the camera actually has 2 modes (day and night). Images taken during the night have frames 1 while images taken on the "day" mode have frames 3.

    Is there a way ffmpeg can handle that kind of jpg changes to combine these different types of jpg ?

    Here is the output :

    ffmpeg version 3.2.10-1~deb9u1~bpo8+1 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 4.9.2 (Debian 4.9.2-10)
     configuration: --prefix=/usr --extra-version='1~deb9u1~bpo8+1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --disable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    [image2 @ 0x55aed5072ba0] Pattern type 'glob_sequence' is deprecated: use pattern_type 'glob' instead
    Input #0, image2, from 'bcp/%*.jpg':
     Duration: 00:09:07.24, start: 0.000000, bitrate: N/A
       Stream #0:0: Video: mjpeg, gray(bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
    [libx264 @ 0x55aed50b8300] using SAR=1/1
    [libx264 @ 0x55aed50b8300] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
    [libx264 @ 0x55aed50b8300] profile High, level 3.1
    [libx264 @ 0x55aed50b8300] 264 - core 142 r2431 a5831aa - 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=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=25.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'test.mp4':
     Metadata:
       encoder         : Lavf57.56.101
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
       Metadata:
         encoder         : Lavc57.64.101 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    Input stream #0:0 frame changed from size:1280x720 fmt:gray to size:1280x720 fmt:yuvj422p.937x    
    [swscaler @ 0x55aed5b56e80] deprecated pixel format used, make sure you did set range correctly
    Input stream #0:0 frame changed from size:1280x720 fmt:yuvj422p to size:1280x720 fmt:grayrop=3023 speed=0.717x    
    Input stream #0:0 frame changed from size:1280x720 fmt:gray to size:1280x720 fmt:yuvj422p
    [swscaler @ 0x55aed550fc20] deprecated pixel format used, make sure you did set range correctly
    Input stream #0:0 frame changed from size:1280x720 fmt:yuvj422p to size:1280x720 fmt:grayrop=6171 speed=0.625x    
    frame= 7156 fps= 16 q=-1.0 Lsize=   80319kB time=00:04:46.12 bitrate=2299.6kbits/s dup=0 drop=6525 speed=0.621x    
    video:80233kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.107008%
    [libx264 @ 0x55aed50b8300] frame I:30    Avg QP:23.39  size: 82468
    [libx264 @ 0x55aed50b8300] frame P:2917  Avg QP:26.31  size: 21742
    [libx264 @ 0x55aed50b8300] frame B:4209  Avg QP:28.37  size:  3864
    [libx264 @ 0x55aed50b8300] consecutive B-frames:  0.9% 49.6% 37.1% 12.4%
    [libx264 @ 0x55aed50b8300] mb I  I16..4:  7.3% 88.2%  4.6%
    [libx264 @ 0x55aed50b8300] mb P  I16..4:  2.7%  4.6%  0.4%  P16..4: 37.5% 12.7% 10.4%  0.0%  0.0%    skip:31.7%
    [libx264 @ 0x55aed50b8300] mb B  I16..4:  0.7%  1.1%  0.1%  B16..8: 33.4%  2.7%  0.3%  direct: 1.0%  skip:60.5%  L0:58.0% L1:37.1% BI: 4.9%
    [libx264 @ 0x55aed50b8300] 8x8 transform intra:61.4% inter:88.3%
    [libx264 @ 0x55aed50b8300] coded y,uvDC,uvAC intra: 34.6% 27.8% 4.0% inter: 16.8% 5.4% 0.1%
    [libx264 @ 0x55aed50b8300] i16 v,h,dc,p: 36% 21% 17% 27%
    [libx264 @ 0x55aed50b8300] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 13% 42%  3%  4%  4%  5%  3%  4%
    [libx264 @ 0x55aed50b8300] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 12% 19%  6%  8%  9%  7%  6%  5%
    [libx264 @ 0x55aed50b8300] i8c dc,h,v,p: 75% 11% 13%  1%
    [libx264 @ 0x55aed50b8300] Weighted P-Frames: Y:34.5% UV:6.4%
    [libx264 @ 0x55aed50b8300] ref P L0: 41.0% 13.8% 22.0% 17.7%  5.5%
    [libx264 @ 0x55aed50b8300] ref B L0: 39.0% 50.9% 10.1%
    [libx264 @ 0x55aed50b8300] ref B L1: 84.5% 15.5%
    [libx264 @ 0x55aed50b8300] kb/s:2296.19

    Thx in advance for your help.