Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (88)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (3229)

  • Popen ffmpeg process hang if run in shell and leaves a defunct process if run in background

    12 janvier 2023, par dr__noob

    I have a script that runs the FFmpeg command. When I run the command in the background using the & operator it runs fine but leaves a zombie process. And when I remove the operator the process hangs and goes into the pipe_wait state.

    


    The code used to execute the FFmpeg command

    


    def run_cmd(cmd:str,
            check:bool=False,       
            capture:bool=False,
            timeout:float=None,
            ) -> tuple[int,bytearray,bytearray]:
    import  subprocess

    stdout_data,stderr_data = (bytearray(),bytearray()) if capture else (None,None)
    try:
        sp = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, )
        while any(data:=(sp.stdout.readline(),sp.stderr.readline())):
            out,err = data
            if out: stdout_data += out
            if err: stderr_data += err
        sp.communicate(timeout=timeout)
        return sp.returncode,stdout_data,stderr_data
    except subprocess.CalledProcessError as e:
        print("Called process error")
        raise e
    except subprocess.TimeoutExpired as e:
        sp.kill()
        print(f"{sp.pid} killed")
        if check:
            raise e
    except PermissionError as e:
        print("Permission error")
        if check:
            raise e


    


    The command which is causing the issue is

    


    nice -n 10 ffmpeg -loglevel verbose -hide_banner -y -threads 0 -i "/dev/shm/480TEST-1999963.dfw.480_1673030704/SBS_Plus_Test_Feed.480TEST-1999963.480.eng.p.intermediate.mp4" -map 0:v:0? -q:v 1 -f rawvideo -pix_fmt "yuv420p" -an ./SBS_Plus_Test_Feed.480TEST-1999963.480.eng.p_fifo_video.yuv -map 0:a:0? -q:a 1 -ac 2 -af "aresample=async=1:first_pts=0" -vn ./SBS_Plus_Test_Feed.480TEST-1999963.480.eng.p_fifo_audio.wav > "./SBS_Plus_Test_Feed.480TEST-1999963.480.eng.p.ffmpeg.demux.log" 2>&1 &


    


    However, other FFmpeg commands are running fine without the last &. But this command will block if I remove the &. If I keep it as it is, the process will later become a zombie(defunct). Can it be because it is actually a nice -n 10 causing the issue ?

    


    Example of a command running fine

    


    ffmpeg -loglevel verbose -hide_banner -y -threads 0 -i "./SBS_Plus_Test_Feed.480TEST-1999963.480.eng.p.ts" -r "59.94" -s:v "1280"x"720" -pix_fmt "yuv420p" -vcodec libx264 -x264-params qp="30" -af "aresample=async=1:first_pts=0" -crf 0 -q:a 1 -vf yadif=1 ./SBS_Plus_Test_Feed.480TEST-1999963.480.eng.p.intermediate.mp4 > "./p.intermediate.mp4.intermediate.ffmpeg.log" 2>&1


    


    Till now I have tried other options like -nostdin and null suggested in ffmpeg hangs when run in background

    


    Is there any other way run this without creating a zombie ?

    


  • How can I record a rectangle centered around the mouse cursor when it last moved

    28 décembre 2022, par Vesoripi

    I would like an ffmpeg incantation that will do A, or B, or C where

    


    A is…
The ffmpeg incantation will record a rectangle that is centered around the caret (the "text cursor") when text is being typed.

    


    B is…
The ffmpeg incantation will record a rectangle that is centered around the mouse cursor when the mouse cursor is actually moving or when the mouse cursor had been moving less than, say, 2 seconds ago.

    


    C is…
The ffmpeg incantation will stop recording video, yet continue to record audio, if the mouse cursor had not been moving for 2 seconds or longer and the caret (the "text cursor") had not been moving for 2 seconds or longer.

    


    On Linux Mint 21.1 Cinnamon, although both of the following incantations…

    


    ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 -preset slow output.mkv


    


    and

    


    ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 -c:v libx264 -crf 0 -preset slow output.mp4


    


    successfully record the mouse cursor as I would like, obviously both incantations fail to record the caret (the "text cursor") when text is being typed.

    


    Here’s my use case…

    


    As a form of documentation, I intend to create screencasts of my coding sessions which I will narrate. I realize that this unusual form of documentation would normally result in large video files. Therefore, instead of recording the entire screen, I would like to record a small rectangle around either the area where I am typing text or—when I am using my mouse—around the area my mouse cursor is located. As a result I hope to create video files which take up less storage space, yet are still useful to me.

    


    For example, I hope that when I review my coding sessions I will be able to quickly be reminded that, for example, "Oh, yeah, that's what I was thinking when I wrote that line of code. Yes. Now I remember : I was stuck, then went to Stackoverflow, did some research, and found solution XYZ to solve my problem.”

    


    In other words, I won’t exclusively be coding during my coding sessions ; sometimes I will be doing research on, for example, Stackoverflow. When I am doing research on—for example, Stackoverflow—I want my mouse cursor recorded.

    


    For your information, follow_mouse at 3.21.1 Options.

    


  • 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.
My code starts as follows :

    


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


    


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

    


    Why is it so ?

    


    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 ?

    


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

    


    And I get an error :
I/flutter (30190): error 1

    


    My code is as follows :

    


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


    


    The full code is as follows :

    


    // Makes the final video by merging all videos from the mixing table
  void makeFinalVideo() async {
    if (videos.length < 2) return;

    final v1 = await videos[0].getMediaUrl();
    if (v1 == null) return;
    final v1Path = await LecleFlutterAbsolutePath.getAbsolutePath(uri: v1);
    if (v1Path == null) return;
    //String v1 = "";
    final v2 = await videos[1].getMediaUrl();
    if (v2 == null) return;
    final v2Path = await LecleFlutterAbsolutePath.getAbsolutePath(uri: v2);
    if (v2Path == null) return;
    String output = "content://media/external/video/media/output";
    final outputPath = "";
    // await LecleFlutterAbsolutePath.getAbsolutePath(uri: output);
    // if (outputPath == null) return;

    Video.merge(v1Path, v2Path, outputPath);
  }



class Video {
  /// Merges the video [v1] with [v2] as [output] video located in app doc path
  static void merge(String v1, String v2, String output) async {
    final appDocDir = await getApplicationDocumentsDirectory();

    //final appDir = await syspaths.getApplicationDocumentsDirectory();
    String rawDocumentPath = appDocDir.path;
    final outputPath = '$rawDocumentPath/output.mp4';

    final command =
        '-i $v1 -i $v2 -filter_complex \'[0:0][1:0]concat=n=2:v=1:a=0[out]\' -map \'[out]\' $outputPath';
    //await execute(command);
    try {
      final r = await FFmpegKit.execute(command);

      //.then((rc) => print("FFmpeg process exited with rc $rc"));
      print("Result: $r");
    } catch (e) {
      print("Exception: $e");
    }
  }
}