Recherche avancée

Médias (91)

Autres articles (102)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

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

  • ffmpeg options to stream to Youtube

    24 octobre 2022, par David Goncalves

    Please bear with me as I don't really understand most of the commands behind ffmpeg.

    


    I am using this code to live stream from a raspberry 4B with a USB Logitech C920 to YouTube :
ffmpeg -re -f s16le -i /dev/zero -f v4l2 -thread_queue_size 512 -codec:v h264 -s 1920x1080 -i /dev/video0 -codec:v copy -acodec aac -b:v 128k -g 60 -f flv rtmp ://a.rtmp.youtube.com/live2/[key]

    


    The streaming works but I get the following error in the command line :
Non-monotonous DTS in output stream 0:0 ; previous : 0, current : -167 ; changing to 0. This may result in incorrect timestamps in the output file.

    


    I also get this error in Youtube studio :
Please use a keyframe frequency of four seconds or less. Currently, keyframes are not being sent often enough, which can cause buffering. The current keyframe frequency is 8.0 seconds. Note that ingestion errors can cause incorrect GOP (group of pictures) sizes.
Any help ?

    


  • How do I get an InputStream out of a Mono ?

    30 octobre 2022, par Einfari

    Bear with my noobness, I am learning web-flux. I had this simple application that takes a video and extract the audio using FFprobe and FFmpeg, so I thought of redoing it reactively, but I am failing miserably...

    


    Controller :

    


    @PostMapping("/upload")&#xA;public String upload(@RequestPart("file") Mono<filepart> filePartMono, final Model model) {&#xA;    Flux<string> filenameList = mediaComponent.extractAudio(filePartMono);&#xA;    model.addAttribute("filenameList", new ReactiveDataDriverContextVariable(filenameList));&#xA;    return "download";&#xA;}&#xA;</string></filepart>

    &#xA;

    Function to get audio streams out of the video :

    &#xA;

    public Mono<ffproberesult> getAudioStreams(InputStream inputStream) {&#xA;    try {&#xA;        return Mono.just(FFprobe.atPath(FFprobePath)&#xA;                .setShowStreams(true)&#xA;                .setSelectStreams(StreamType.AUDIO)&#xA;                .setLogLevel(LogLevel.INFO)&#xA;                .setInput(inputStream)&#xA;                .execute());&#xA;    } catch (JaffreeException e) {&#xA;        log.error(e.getMessage(), e);&#xA;        throw new MediaException("Audio formats could not be identified.");&#xA;    }&#xA;}&#xA;</ffproberesult>

    &#xA;

    Attempt 1 :

    &#xA;

    public Flux<string> extractAudio(Mono<filepart> filePartMono) {&#xA;    filePartMono.flatMapMany(Part::content)&#xA;            .map(dataBuffer -> dataBuffer.asInputStream(true))&#xA;            .flatMap(this::getAudioStreams)&#xA;            .subscribe(System.out::println);&#xA;    ...&#xA;}&#xA;</filepart></string>

    &#xA;

    Attempt 2 :

    &#xA;

    public Flux<string> extractAudio(Mono<filepart> filePartMono) {&#xA;    filePartMono.flatMapMany(Part::content)&#xA;            .reduce(InputStream.nullInputStream(), (inputStream, dataBuffer) -> new SequenceInputStream(&#xA;                    inputStream, dataBuffer.asInputStream()&#xA;            ))&#xA;            .flatMap(this::getAudioStreams)&#xA;            .subscribe(System.out::println);&#xA;    ...&#xA;}&#xA;</filepart></string>

    &#xA;

    Attempt 3 :

    &#xA;

    public Flux<string> extractAudio(Mono<filepart> filePartMono) {&#xA;    DataBufferUtils.write(filePartMono.flatMapMany(Part::content), OutputStream.nullOutputStream())&#xA;            .map(dataBuffer -> dataBuffer.asInputStream(true))&#xA;            .flatMap(this::getAudioStreams)&#xA;            .subscribe(System.out::println);&#xA;    ...&#xA;}&#xA;</filepart></string>

    &#xA;

    Attempt 1 and 3 seems to be the same in the end, FFprobe complains as follows :

    &#xA;

    2022-10-30 11:24:30.292  WARN 79049 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9162702340] [warning] STSZ atom truncated&#xA;2022-10-30 11:24:30.292 ERROR 79049 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9162702340] [error] stream 0, contradictionary STSC and STCO&#xA;2022-10-30 11:24:30.292 ERROR 79049 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9162702340] [error] error reading header&#xA;2022-10-30 11:24:30.294 ERROR 79049 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [error] tcp://127.0.0.1:51532: Invalid data found when processing input&#xA;2022-10-30 11:24:30.295  INFO 79049 --- [oundedElastic-3] c.g.k.jaffree.process.ProcessHandler     : Process has finished with status: 1&#xA;2022-10-30 11:24:30.409 ERROR 79049 --- [oundedElastic-3] c.e.s.application.MediaComponent         : Process execution has ended with non-zero status: 1. Check logs for detailed error message.&#xA;

    &#xA;

    Attempt 2 produces multiple of these :

    &#xA;

    Exception in thread "Runnable-0" java.lang.StackOverflowError&#xA;    at java.base/java.io.SequenceInputStream.read(SequenceInputStream.java:198)&#xA;

    &#xA;

    Could anybody point me in the right direction ? What am I doing wrong ? By the way, I am outputting to console just to see a result, but in the end I need to take all the outputted streams and pass them as arguments to another function that will finally extract the audio, so I need to figure out that as well.

    &#xA;

    Thank you in advance.

    &#xA;

  • Trying to merge two videos from my photo roll with Flutter ffmpeg without success

    4 avril 2023, par Stéphane de Luca

    My goal is to merge too video I pick from my photo roll.&#xA;My code starts as follows :

    &#xA;

    // videos[0] contains: "content://media/external/video/media/2779"&#xA; final v1 = await videos[0].getMediaUrl();&#xA;    if (v1 == null) return;&#xA;    final v1Path = await LecleFlutterAbsolutePath.getAbsolutePath(uri: v1);&#xA;

    &#xA;

    But printing v1Pathgive a path with jpeg extension :&#xA;/data/user/0/com.example.shokaze/cache/OutputFile_1669939088711.jpeg&#x27; which I though would have bear mp4` as it is a video.

    &#xA;

    Why is it so ?

    &#xA;

    Another question I have is how can I make a relevant path so that the ffmpeg video appears in my roll after its creation ? Should I do the following and provide outputPathto the code ?

    &#xA;

    The command it executes is :&#xA;-i /data/user/0/com.example.shokaze/cache/OutputFile_1669940421875.jpeg -i /data/user/0/com.example.shokaze/cache/OutputFile_1669940428723.jpeg -filter_complex &#x27;[0:0][1:0]concat=n=2:v=1:a=0[out]&#x27; -map &#x27;[out]&#x27; /data/user/0/com.example.shokaze/app_flutter/output.mp4

    &#xA;

    And I get an error :&#xA;I/flutter (30190): error 1

    &#xA;

    My code is as follows :

    &#xA;

        String output = "content://media/external/video/media/output";&#xA;    final outputPath = await LecleFlutterAbsolutePath.getAbsolutePath(uri: output);&#xA;    if (outputPath == null) return;&#xA;

    &#xA;

    The full code is as follows :

    &#xA;

    // Makes the final video by merging all videos from the mixing table&#xA;  void makeFinalVideo() async {&#xA;    if (videos.length &lt; 2) return;&#xA;&#xA;    final v1 = await videos[0].getMediaUrl();&#xA;    if (v1 == null) return;&#xA;    final v1Path = await LecleFlutterAbsolutePath.getAbsolutePath(uri: v1);&#xA;    if (v1Path == null) return;&#xA;    //String v1 = "";&#xA;    final v2 = await videos[1].getMediaUrl();&#xA;    if (v2 == null) return;&#xA;    final v2Path = await LecleFlutterAbsolutePath.getAbsolutePath(uri: v2);&#xA;    if (v2Path == null) return;&#xA;    String output = "content://media/external/video/media/output";&#xA;    final outputPath = "";&#xA;    // await LecleFlutterAbsolutePath.getAbsolutePath(uri: output);&#xA;    // if (outputPath == null) return;&#xA;&#xA;    Video.merge(v1Path, v2Path, outputPath);&#xA;  }&#xA;&#xA;&#xA;&#xA;class Video {&#xA;  /// Merges the video [v1] with [v2] as [output] video located in app doc path&#xA;  static void merge(String v1, String v2, String output) async {&#xA;    final appDocDir = await getApplicationDocumentsDirectory();&#xA;&#xA;    //final appDir = await syspaths.getApplicationDocumentsDirectory();&#xA;    String rawDocumentPath = appDocDir.path;&#xA;    final outputPath = &#x27;$rawDocumentPath/output.mp4&#x27;;&#xA;&#xA;    final command =&#xA;        &#x27;-i $v1 -i $v2 -filter_complex \&#x27;[0:0][1:0]concat=n=2:v=1:a=0[out]\&#x27; -map \&#x27;[out]\&#x27; $outputPath&#x27;;&#xA;    //await execute(command);&#xA;    try {&#xA;      final r = await FFmpegKit.execute(command);&#xA;&#xA;      //.then((rc) => print("FFmpeg process exited with rc $rc"));&#xA;      print("Result: $r");&#xA;    } catch (e) {&#xA;      print("Exception: $e");&#xA;    }&#xA;  }&#xA;}&#xA;

    &#xA;