Recherche avancée

Médias (1)

Mot : - Tags -/embed

Autres articles (45)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Support audio et vidéo HTML5

    10 avril 2011

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

Sur d’autres sites (9657)

  • FFmpeg output video is not seekable. Output video is not playing instantly instead browser loads it completely then plays it

    19 février 2024, par Mohit56

    Hi I am using ffmpeg to transcode video. In my code I have used 'fluent-ffmpeg' npm package with nodeJs and 'aws-sdk' to save output video by writestream into s3 bucket.

    


    Problem
-> Video is getting transcoded and I am successfully able to save the video into s3 bucket but. As I paste the object_url of that video into browser and try to play, but that video is not playing instantly I have checked on 'developer console tool' browser is loading all the video once that is done then only it starts playing that is a problem.

    


    ->Let say if I have output video of size 10GB on that case browser will load all 10GB data then only it will start playing that video.

    


    ->If I am not using writestream approach and directly upload the video into local directory first then upload into s3 bucket, In this case if I play the video using object URL then that video plays instantly. In this case I don't have to wait for whole 10GB video to load then play it which is good.

    


    -> Can anybody help me to fix my writestream solution because I don't want to save the output video into my localdirectory. I want to writestream the output video directly into s3 bucket.

    


    Code Snippet

    


    const ffmpeg = require('fluent-ffmpeg');
const AWS = require('aws-sdk'); 
const stream = require("stream");

//set up your aws connection

const command = ffmpeg(inputVideoURL) 
.outputOptions(['-movflags', 'frag_keyframe']) 
.size('854x480') // set the desired resolution (480p) .outputFormat('mp4') 
.videoCodec('libx264') 
.audioCodec('aac') 
.on('progress',(p)=>{ console.log(p) }) 
.on('stderr',(err)=>console.log(err)) 
.on('start', commandLine => console.log('Spawned FFmpeg with command: ' + commandLine)) 
.on('end', () => console.log('Transcoding finished.')) 
.on('error', err => console.error('Error:', err))

//=>To save file into s3 using write steam. command.writeToStream(uploadFolderFileWriteStream('StreamCheck/output2.mp4'));

function uploadFolderFileWriteStream(fileName) { try { const pass = new stream.PassThrough();

const params = {
  Bucket: bucketName,
  Key: fileName,
  Body: pass,
  ACL: "public-read",
  ContentType:'video/mp4' ,
};

const upload = s3.upload(params);

upload.on('error', function(err) {
  console.log("Error uploading to S3:", err);
});

upload.send(function(err, data) {
  if(err) console.log(err);
  else console.log("Upload to S3 completed:", data);
});

return pass;

} catch (err) { console.log("[S3 createWriteStream]", err); } }


    


    I have tried below option as well be all of them not worked 
-> .addOption("-movflags frag_keyframe+empty_moov") 
-> .addOption('-movflags', 'frag_keyframe+empty_moov') 
-> .addOutputOption("-movflags +faststart")
-> .addOption('-movflags', 'faststart+frag_keyframe+empty_moov+default_base_moof')


    


  • Why does the VoiceNext D#+ library not work (not playing audio), despite not throwing any errors ?

    17 juin 2024, par Overo3

    Using the DSharpPlus library, with conversion via ffmpeg, I have taken a YouTube video stream and converted it to PCM Stereo (the expected format), but when copying the stream to the buffer, no audio can be heard in the voice channel.
Code for MusicCommands.cs :

    


    using System.ComponentModel.DataAnnotations.Schema;&#xA;using System.Threading.Channels;&#xA;using DSharpPlus;&#xA;using DSharpPlus.Entities;&#xA;using DSharpPlus.SlashCommands;&#xA;using DSharpPlus.SlashCommands.Attributes;&#xA;using DSharpPlus.VoiceNext;&#xA;using System.Diagnostics;&#xA;using System.Runtime.CompilerServices;&#xA;using YoutubeExplode;&#xA;using YoutubeExplode.Videos.Streams;&#xA;&#xA;namespace Nexus&#xA;{&#xA;    public class MusicCommands : ApplicationCommandModule&#xA;    {&#xA;        [SlashCommand("join","Join a voice channel")]&#xA;        public async Task JoinCommand(InteractionContext ctx)&#xA;        {&#xA;            DiscordChannel channel = ctx.Member.VoiceState?.Channel;&#xA;            await channel.ConnectAsync();&#xA;        }&#xA;&#xA;        [SlashCommand("play","Play audio source")]&#xA;        public async Task PlayCommand(InteractionContext ctx, [Option("ytid","Youtube ID or link")] string path)&#xA;        {&#xA;            var vnext = ctx.Client.GetVoiceNext();&#xA;            var connection = vnext.GetConnection(ctx.Guild);&#xA;&#xA;            var transmit = connection.GetTransmitSink();&#xA;&#xA;            Task<stream> audio = GetYoutubeVideoStream(path);&#xA;            dynamic result = await audio;&#xA;            await result.CopyToAsync(transmit);&#xA;            await result.DisposeAsync();&#xA;        }&#xA;&#xA;        [SlashCommand("leave","Leave a voice channel")]&#xA;        public async Task LeaveCommand(InteractionContext ctx)&#xA;        {&#xA;            var vnext = ctx.Client.GetVoiceNext();&#xA;            var connection = vnext.GetConnection(ctx.Guild);&#xA;&#xA;            connection.Disconnect();&#xA;        }&#xA;        private static async Task<stream> GetYoutubeVideoStream(string ytID)&#xA;        {&#xA;            var youtube = new YoutubeClient();&#xA;            var streamManifest = await youtube.Videos.Streams.GetManifestAsync(ytID);&#xA;            var streamInfo = streamManifest.GetAudioOnlyStreams().GetWithHighestBitrate();&#xA;            var stream  = await youtube.Videos.Streams.GetAsync(streamInfo);&#xA;            var process = new Process&#xA;            {&#xA;                StartInfo =&#xA;                {&#xA;                    FileName = "ffmpeg",&#xA;                    Arguments = $@"-ac 2 -f s16le -ar 48000 pipe:1 -i -",&#xA;                    RedirectStandardOutput = true,&#xA;                    UseShellExecute = false&#xA;                }&#xA;            };&#xA;&#xA;            var ffmpegIn = process.StandardInput.BaseStream;&#xA;            stream.CopyTo(ffmpegIn);&#xA;            var outputStream = process.StandardOutput.BaseStream;&#xA;            return outputStream;&#xA;        }&#xA;    }&#xA;}&#xA;</stream></stream>

    &#xA;

    According to the Discord voice docs, the S16LE PCM stereo 48000hz sample rate should be correct, and it doesn't throw any errors when using any of the commands, but it doesn't play any audio.

    &#xA;

  • HTML5 video player some mp4 files not playing chrome

    1er juillet 2020, par Marc

    So I'm trying to build a personnal streaming platform and I've done my best to follow the recommandations I've found everywhere for better compatibility/quality when streaming.

    &#xA;&#xA;

    So I'm systematically encoding my video to video codec h264 with mp4 container with ffmpeg using this command :

    &#xA;&#xA;

    ffmpeg -i input -vcodec libx264 -maxrate 8000k -bufsize 1000K -minrate 10k -crf 24 -ab 192k -movflags faststart output.mp4&#xA;

    &#xA;&#xA;

    However, I occasionaly fall on some reluctant mp4 that will play fine on Edge and Firefox but won't on Chrome. Loading seems to be processed fine as I can see the total duration in the controls, but it will never play and will not leave any error in the console.

    &#xA;&#xA;

    Here's a Mediainfo export of such reluctant file :

    &#xA;&#xA;

    Format                                   : MPEG-4&#xA;Format profile                           : Base Media&#xA;Codec ID                                 : isom (isom/iso2/avc1/mp41)&#xA;File size                                : 1.04 GiB&#xA;Duration                                 : 1 h 21 min&#xA;Overall bit rate                         : 1 832 kb/s&#xA;Writing application                      : Lavf57.56.101&#xA;&#xA;Video&#xA;ID                                       : 1&#xA;Format                                   : AVC&#xA;Format/Info                              : Advanced Video Codec&#xA;Format profile                           : High@L4&#xA;Format settings                          : CABAC / 4 Ref Frames&#xA;Format settings, CABAC                   : Yes&#xA;Format settings, Reference frames        : 4 frames&#xA;Codec ID                                 : avc1&#xA;Codec ID/Info                            : Advanced Video Coding&#xA;Duration                                 : 1 h 21 min&#xA;Bit rate                                 : 1 634 kb/s&#xA;Width                                    : 1 912 pixels&#xA;Height                                   : 1 032 pixels&#xA;Display aspect ratio                     : 1.85:1&#xA;Frame rate mode                          : Constant&#xA;Frame rate                               : 24.000 FPS&#xA;Color space                              : YUV&#xA;Chroma subsampling                       : 4:2:0&#xA;Bit depth                                : 8 bits&#xA;Scan type                                : Progressive&#xA;Bits/(Pixel*Frame)                       : 0.035&#xA;Stream size                              : 953 MiB (89%)&#xA;Writing library                          : x264 core 148 r2748 97eaef2&#xA;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=9 / 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=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=24.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=8000 / vbv_bufsize=1000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00&#xA;Language                                 : French&#xA;Menus                                    : 3&#xA;Codec configuration box                  : avcC&#xA;&#xA;Audio&#xA;ID                                       : 2&#xA;Format                                   : AAC LC&#xA;Format/Info                              : Advanced Audio Codec Low Complexity&#xA;Codec ID                                 : mp4a-40-2&#xA;Duration                                 : 1 h 21 min&#xA;Bit rate mode                            : Constant&#xA;Bit rate                                 : 192 kb/s&#xA;Channel(s)                               : 6 channels&#xA;Channel layout                           : C L R Ls Rs LFE&#xA;Sampling rate                            : 48.0 kHz&#xA;Frame rate                               : 46.875 FPS (1024 SPF)&#xA;Compression mode                         : Lossy&#xA;Stream size                              : 112 MiB (11%)&#xA;Language                                 : French&#xA;Default                                  : Yes&#xA;Alternate group                          : 1&#xA;Menus                                    : 3&#xA;&#xA;Menu #1&#xA;ID                                       : 3&#xA;Codec ID                                 : text&#xA;Duration                                 : 1 h 21 min&#xA;Language                                 : English&#xA;Bit rate mode                            : CBR&#xA;Menu For                                 : 1,2&#xA;00:00:00.000                             : Chapitre 01&#xA;00:08:39.000                             : Chapitre 02&#xA;00:15:10.000                             : Chapitre 03&#xA;00:24:47.000                             : Chapitre 04&#xA;00:33:39.000                             : Chapitre 05&#xA;00:43:38.000                             : Chapitre 06&#xA;00:50:51.000                             : Chapitre 07&#xA;00:59:13.000                             : Chapitre 08&#xA;01:08:01.000                             : Chapitre 09&#xA;01:14:06.000                             : Chapitre 10&#xA;Bit rate mode                            : Constant&#xA;&#xA;Menu #2&#xA;00:00:00.000                             : Chapitre 01&#xA;00:08:39.000                             : Chapitre 02&#xA;00:15:10.000                             : Chapitre 03&#xA;00:24:47.000                             : Chapitre 04&#xA;00:33:39.000                             : Chapitre 05&#xA;00:43:38.000                             : Chapitre 06&#xA;00:50:51.000                             : Chapitre 07&#xA;00:59:13.000                             : Chapitre 08&#xA;01:08:01.000                             : Chapitre 09&#xA;01:14:06.000                             : Chapitre 10&#xA;

    &#xA;&#xA;

    Thanks in advance for any valuable tip you could provide

    &#xA;