Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (26)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (4238)

  • mpv player with SFTP does not work in bash script [closed]

    19 mars 2024, par Pickles888

    I am making a bash script to make it easier to stream from my media server at home.

    


    In the bash script, it asks whether you want to list or search, and then uses mpv to stream the file. For some reason it says the file does not exist. When I try this in the terminal it works, but running the script gives this error :

    


    [ffmpeg] libssh: Error opening sftp file: SFTP server: No such file
Failed to open sftp://[username:password]@[ip.of.server]/[directory/to/file]


    


    My script :

    


    #!/bin/bash

pass="[password]"

if [ $(nmcli | grep -c [home-network]) -gt 0 ]; then
    ip="[private.ip]"
else
    ip="[public.ip]"
fi

mfolder="[/directory/of/file]"

function select_option {

    # little helpers for terminal print control and key input
    ESC=$( printf "\033")
    cursor_blink_on()  { printf "$ESC[?25h"; }
    cursor_blink_off() { printf "$ESC[?25l"; }
    cursor_to()        { printf "$ESC[$1;${2:-1}H"; }
    print_option()     { printf "   $1 "; }
    print_selected()   { printf "  $ESC[7m $1 $ESC[27m"; }
    get_cursor_row()   { IFS=';' read -sdR -p $'\E[6n' ROW COL; echo ${ROW#*[}; }
    key_input()        { read -s -n3 key 2>/dev/null >&2
                         if [[ $key = $ESC[A ]]; then echo up;    fi
                         if [[ $key = $ESC[B ]]; then echo down;  fi
                         if [[ $key = ""     ]]; then echo enter; fi; }

    # initially print empty new lines (scroll down if at bottom of screen)
    for opt; do printf "\n"; done

    # determine current screen position for overwriting the options
    local lastrow=`get_cursor_row`
    local startrow=$(($lastrow - $#))

    # ensure cursor and input echoing back on upon a ctrl+c during read -s
    trap "cursor_blink_on; stty echo; printf '\n'; exit" 2
    cursor_blink_off

    local selected=0
    while true; do
        # print options by overwriting the last lines
        local idx=0
        for opt; do
            cursor_to $(($startrow + $idx))
            if [ $idx -eq $selected ]; then
                print_selected "$opt"
            else
                print_option "$opt"
            fi
            ((idx++))
        done

        # user key control
        case `key_input` in
            enter) break;;
            up)    ((selected--));
                   if [ $selected -lt 0 ]; then selected=$(($# - 1)); fi;;
            down)  ((selected++));
                   if [ $selected -ge $# ]; then selected=0; fi;;
        esac
    done

    # cursor position back to normal
    cursor_to $lastrow
    printf "\n"
    cursor_blink_on

    return $selected
}

stream() {
    mpv --fs "sftp://[username]:$pass@$ip$mfolder${options[choice]}"
}

search() {
    read -p "Search
> " search
    chars=$(echo -n "$search" | wc -c)
    printf '\n'
    clear
    printf "Search Results For $search:"
    printf '\n'
    readarray options < <(sshpass -p "$pass" ssh "[username]@$ip" ls "$mfolder" | agrep -i -$(($chars/3)) "$search")
    select_option "${options[@]}"
    choice=$?
    stream
}

list() {
    clear
    sshpass -p "$pass" ssh [username]@$ip ls "$mfolder"
    search
}

cmd() {
    read -p "List or Search 
(S/l)> " cmd
    printf '\n'
    
    if [[ "$cmd" == "S" || "$cmd" == "s" ]]; then
        search
    elif [[ "$cmd" == "L" || "$cmd" == "l" ]]; then
        list
    else
        search
    fi
}

main() {
    cmd
}

main


    


    Anything put in brackets is to not share my personal info (except for arrays, if statements etc)

    


    Also this seems to have only changed while I was making the script. In the beginning, it was working great, but at one point it randomly stopped working.

    


    I have a feeling its some kind of quote mess up or something stupid like that. I have tried to edit it and fix it to the best of my abilities but nothing I did fixed it.

    


    I also think it could have to do with it being run in the bash environment as I normally use zsh. However I tested it in my shell by running /bin/bash and executing the command and it worked.

    


    Also the option chooser was not made by me.

    


  • avformat/rtsp : extend the PATH buffer to 2048

    7 août 2024, par Stefano Mandelli
    avformat/rtsp : extend the PATH buffer to 2048
    

    Recently, I have been experiencing an increasing number of user that use ffmpeg
    to retrive RTSP stream from personal mediaproxies (e.g. MediaMtx) with
    authorization based on JWT. The current length of PATH does not permit to
    insert the token in the URL failing the authorization with no possibilities to
    get the video.

    VLC has just modified the RSTP max URL length, and it permits to use token
    inside the URL.

    For these reasons, I propose this patch to extend the PATH buffer from 1024 to
    2048 in order to use tokens and the authorization process based on JWT.

    Signed-off-by : Marton Balint <cus@passwd.hu>

    • [DH] libavformat/rtsp.c
  • FFmpeg Streaming Video SpringBoot endpoint not show video duration in video players

    7 avril 2024, par lxluxo23

    it turns out that I've been working on a personal project just out of curiosity.&#xA;the main function is to stream video by first encoding it through ffmpeg&#xA;then playback said video from any other device&#xA;call it "plex" very very primitive

    &#xA;

    although I achieve my goal which is to encode and send the video to the devices that make the request&#xA;this video is sent so to speak as a live broadcast.&#xA;I can only pause it, no forward or rewind, anyone have any idea what I am doing wrong or if I should take some other approach either in my service or controller ?

    &#xA;

    I leave fragments of my code

    &#xA;

    THE CONTROLLER

    &#xA;

    @RestController&#xA;@RequestMapping("/api")&#xA;@Log4j2&#xA;public class StreamController {&#xA;&#xA;    @Autowired&#xA;    VideoStreamingService videoStreamingService;&#xA;&#xA;    @Autowired&#xA;    VideoService videoService;&#xA;&#xA;&#xA;    @GetMapping("/stream/{videoId}")&#xA;    public ResponseEntity<streamingresponsebody> livestream(@PathVariable Long videoId,@RequestParam(required = false)  String codec) {&#xA;        Video video = videoService.findVideoById(videoId);&#xA;        if (video != null) {&#xA;            Codec codecEnum = Codec.fromString(codec);&#xA;            return ResponseEntity.ok()&#xA;                    .contentType(MediaType.valueOf("video/mp4"))&#xA;                    .body(outputStream -> videoStreamingService.streamVideo(video.getPath(), outputStream,codecEnum));&#xA;        }&#xA;        return ResponseEntity.notFound().build();&#xA;    }&#xA;}&#xA;</streamingresponsebody>

    &#xA;

    THE SERVICE

    &#xA;

    @Service&#xA;public class VideoStreamingService {&#xA;&#xA;    public void streamVideo(String videoPath, OutputStream outputStream, Codec codec) {&#xA;&#xA;        FFmpeg ffmpeg = FFmpeg.atPath()&#xA;                .addArguments("-i", videoPath)&#xA;                .addArguments("-b:v", "5000k")&#xA;                .addArguments("-maxrate", "5000k")&#xA;                .addArguments("-bufsize", "10000k")&#xA;                .addArguments("-c:a", "aac")&#xA;                .addArguments("-b:a", "320k")&#xA;                .addArguments("-movflags", "frag_keyframe&#x2B;empty_moov&#x2B;faststart")&#xA;                .addOutput(PipeOutput.pumpTo(outputStream)&#xA;                        .setFormat("mp4"))&#xA;                .addArgument("-nostdin");&#xA;        if (codec == Codec.AMD) {&#xA;            ffmpeg.addArguments("-profile:v", "high");&#xA;        }&#xA;        ffmpeg.addArguments("-c:v", codec.getFfmpegArgument());&#xA;        ffmpeg.execute();&#xA;    }&#xA;}&#xA;

    &#xA;

    I have some enums to vary the encoding and use hardware acceleration or not.

    &#xA;

    and here is an example from my player&#xA;the endpoint is the following

    &#xA;

    http://localhost:8080/api/stream/2?codec=AMD&#xA;screenshot

    &#xA;

    I'm not sure if there's someone with more knowledge in either FFmpeg or Spring who could help me with this minor issue, I would greatly appreciate it. I've included the URL of the repository in case anyone would like to review it when answering my question

    &#xA;

    repo

    &#xA;

    I tried changing the encoding format.&#xA;I tried copying the metadata from the original video.&#xA;I tried sending a custom header.&#xA;None of this has worked.

    &#xA;

    I would like to achieve what is mentioned in many sites, which is when you load a video from the network, the player shows how much of that video you have in the local "buffer".

    &#xA;