Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (86)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

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

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

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