Recherche avancée

Médias (33)

Mot : - Tags -/creative commons

Autres articles (81)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (9825)

  • avconv - reducing video dimensions and file size

    26 mai 2018, par Verode

    Is there any way how to reduce the size of video ?

    In php I use this :

    $result = exec("avconv -i $file1 -vcodec libx264 -acodec aac -strict experimental $file2");

    Unfortynately, all produced videos have the same size as originals or are more bigger.

    1) First of all I want to reduce dimensions of all videos : width : 750px, height : auto. Is it possible ?

    2) Is there some way how to reduce the quality a little bit ? Of course, I don’t want blurry videos but in some websites I see that a good quality 15 minutes videofile have a size something like 50 MB. My videos of 1 minute have the same size.

  • Not all portions of video play well after concatenation

    24 septembre 2018, par srgbnd

    Node.JS 8.11.4, fluent-ffmpeg 2.1.2

    I need to concatenate random portions of the same length of different videos in one video file. The concatenation proceeds without errors. But when I play the final concatenated file I see some portions playing well with sound, others have video "frozen" but sounds playing.

    What’s the problem ? I want all portions playing well in the final concatenated file.

    Concatenation config :

    trex@cave:/media/trex/safe1/Development/app$ head concat_config.txt
    file /media/trex/safe1/Development/app/videos/test/417912400.mp4
    inpoint 145
    outpoint 155
    file /media/trex/safe1/Development/app/videos/test/440386842.mp4
    inpoint 59
    outpoint 69
    file /media/trex/safe1/Development/app/videos/test/417912400.mp4
    inpoint 144
    outpoint 154
       ...

    In total, I have 16 portions of 2 videos. Duration of a portion is 10 sec. In the future the number of video files and portions will be much bigger.

    trex@cave:/media/trex/safe1/Development/app$ ls -lh videos/test/
    total 344M
    -rw-r--r-- 1 trex trex  90M set 23 12:19 417912400.mp4
    -rw-r--r-- 1 trex trex 254M set 23 12:19 440386842.mp4

    JavaScript code for the concatentaion :

    const fs = require('fs');
    const path = require('path');
    const _ = require('lodash');
    const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
    const ffprobePath = require('@ffprobe-installer/ffprobe').path;
    const ffmpeg = require('fluent-ffmpeg');
    ffmpeg.setFfmpegPath(ffmpegPath);
    ffmpeg.setFfprobePath(ffprobePath);


    function getMetadata(absPathToFile) {
     return new Promise(function (resolve, reject) {
       ffmpeg.ffprobe(absPathToFile, function(err, metadata) {
         if (err) {
           reject('get video meta: ' + err.toString());
         }
         resolve(metadata);
       });
     });
    }

    async function getFormat(files) {
     const pArray = files.map(async f => {
       const meta = await getMetadata(f);
       meta.format.short_filename = meta.format.filename.split('/').pop();
       return meta.format;
     });
     return await Promise.all(pArray);
    }

    function getSliceValues(duration, max = 10) {
     max = duration < max ? duration * 0.5 : max; // sec
     const start = _.random(0, duration * 0.9);
     const end = start + max > duration ? duration : start + max;
     return `inpoint ${Math.floor(start)}\noutpoint ${Math.floor(end)}\n`;
    }

    function addPath(arr, aPath) {
     return arr.map(e => path.join(aPath, e));
    }

    function createConfig(meta) {
     return meta.map(video => `file ${video.filename}\n${getSliceValues(video.duration)}`).join('');
    }

    function duplicateMeta(meta) {
     for (let i = 0; i < 3; i++) {
       meta.push(...meta);
     }
     return _.shuffle(meta);
    }

    const videoFolder = path.join(__dirname, 'videos/test');
    const finalVideo = 'final_video.mp4';
    const configFile = 'concat_config.txt';

    // main
    (async () => {
     let videos = addPath(fs.readdirSync(videoFolder), videoFolder);

     let meta = await getFormat(videos);
     meta = duplicateMeta(meta); // get multiple portions of videos

     fs.writeFileSync(configFile, createConfig(meta));

     const mpeg = ffmpeg();
     mpeg.input(configFile)
       .inputOptions(['-f concat', '-safe 0'])
       .outputOptions('-c copy')
       .save(finalVideo);
    })();

    Video files formats :

    { streams:
      [ { index: 0,
          codec_name: 'h264',
          codec_long_name: 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
          profile: 'High',
          codec_type: 'video',
          codec_time_base: '1001/60000',
          codec_tag_string: 'avc1',
          codec_tag: '0x31637661',
          width: 1920,
          height: 1080,
          coded_width: 1920,
          coded_height: 1088,
          has_b_frames: 2,
          sample_aspect_ratio: '1:1',
          display_aspect_ratio: '16:9',
          pix_fmt: 'yuv420p',
          level: 40,
          color_range: 'tv',
          color_space: 'bt709',
          color_transfer: 'bt709',
          color_primaries: 'bt709',
          chroma_location: 'left',
          field_order: 'unknown',
          timecode: 'N/A',
          refs: 1,
          is_avc: 'true',
          nal_length_size: 4,
          id: 'N/A',
          r_frame_rate: '30000/1001',
          avg_frame_rate: '30000/1001',
          time_base: '1/30000',
          start_pts: 0,
          start_time: 0,
          duration_ts: 4936900,
          duration: 164.563333,
          bit_rate: 4323409,
          max_bit_rate: 'N/A',
          bits_per_raw_sample: 8,
          nb_frames: 4932,
          nb_read_frames: 'N/A',
          nb_read_packets: 'N/A',
          tags: [Object],
          disposition: [Object] },
        { index: 1,
          codec_name: 'aac',
          codec_long_name: 'AAC (Advanced Audio Coding)',
          profile: 'LC',
          codec_type: 'audio',
          codec_time_base: '1/48000',
          codec_tag_string: 'mp4a',
          codec_tag: '0x6134706d',
          sample_fmt: 'fltp',
          sample_rate: 48000,
          channels: 2,
          channel_layout: 'stereo',
          bits_per_sample: 0,
          id: 'N/A',
          r_frame_rate: '0/0',
          avg_frame_rate: '0/0',
          time_base: '1/48000',
          start_pts: 0,
          start_time: 0,
          duration_ts: 7899120,
          duration: 164.565,
          bit_rate: 256000,
          max_bit_rate: 263232,
          bits_per_raw_sample: 'N/A',
          nb_frames: 7714,
          nb_read_frames: 'N/A',
          nb_read_packets: 'N/A',
          tags: [Object],
          disposition: [Object] } ],
     format:
      { filename: '/media/trex/safe1/Development/app/videos/test/417912400.mp4',
        nb_streams: 2,
        nb_programs: 0,
        format_name: 'mov,mp4,m4a,3gp,3g2,mj2',
        format_long_name: 'QuickTime / MOV',
        start_time: 0,
        duration: 164.565,
        size: 94298844,
        bit_rate: 4584150,
        probe_score: 100,
        tags:
         { major_brand: 'mp42',
           minor_version: '0',
           compatible_brands: 'mp42mp41isomavc1',
           creation_time: '2015-09-21T19:11:21.000000Z' } },
     chapters: [] }
    { streams:
      [ { index: 0,
          codec_name: 'h264',
          codec_long_name: 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
          profile: 'High',
          codec_type: 'video',
          codec_time_base: '1001/48000',
          codec_tag_string: 'avc1',
          codec_tag: '0x31637661',
          width: 2560,
          height: 1440,
          coded_width: 2560,
          coded_height: 1440,
          has_b_frames: 2,
          sample_aspect_ratio: '1:1',
          display_aspect_ratio: '16:9',
          pix_fmt: 'yuv420p',
          level: 51,
          color_range: 'tv',
          color_space: 'bt709',
          color_transfer: 'bt709',
          color_primaries: 'bt709',
          chroma_location: 'left',
          field_order: 'unknown',
          timecode: 'N/A',
          refs: 1,
          is_avc: 'true',
          nal_length_size: 4,
          id: 'N/A',
          r_frame_rate: '24000/1001',
          avg_frame_rate: '24000/1001',
          time_base: '1/24000',
          start_pts: 0,
          start_time: 0,
          duration_ts: 4206200,
          duration: 175.258333,
          bit_rate: 11891834,
          max_bit_rate: 'N/A',
          bits_per_raw_sample: 8,
          nb_frames: 4202,
          nb_read_frames: 'N/A',
          nb_read_packets: 'N/A',
          tags: [Object],
          disposition: [Object] },
        { index: 1,
          codec_name: 'aac',
          codec_long_name: 'AAC (Advanced Audio Coding)',
          profile: 'LC',
          codec_type: 'audio',
          codec_time_base: '1/48000',
          codec_tag_string: 'mp4a',
          codec_tag: '0x6134706d',
          sample_fmt: 'fltp',
          sample_rate: 48000,
          channels: 2,
          channel_layout: 'stereo',
          bits_per_sample: 0,
          id: 'N/A',
          r_frame_rate: '0/0',
          avg_frame_rate: '0/0',
          time_base: '1/48000',
          start_pts: 0,
          start_time: 0,
          duration_ts: 8414160,
          duration: 175.295,
          bit_rate: 256000,
          max_bit_rate: 262152,
          bits_per_raw_sample: 'N/A',
          nb_frames: 8217,
          nb_read_frames: 'N/A',
          nb_read_packets: 'N/A',
          tags: [Object],
          disposition: [Object] } ],
     format:
      { filename: '/media/trex/safe1/Development/app/videos/test/440386842.mp4',
        nb_streams: 2,
        nb_programs: 0,
        format_name: 'mov,mp4,m4a,3gp,3g2,mj2',
        format_long_name: 'QuickTime / MOV',
        start_time: 0,
        duration: 175.295,
        size: 266214940,
        bit_rate: 12149345,
        probe_score: 100,
        tags:
         { major_brand: 'mp42',
           minor_version: '0',
           compatible_brands: 'mp42mp41isomavc1',
           creation_time: '2015-11-15T19:30:49.000000Z' } },
     chapters: [] }
  • 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.