Recherche avancée

Médias (2)

Mot : - Tags -/plugins

Autres articles (38)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (7345)

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

    


  • Where to (long time) host Spring Boot Application with Data Base Backup and Linux Root Access [closed]

    22 mai 2024, par Lord Helmchen

    I developed a small application for my father. It uses Spring Boot, MySQL and FFMPEG, which I currently installed on Linux.

    


    I want to host it, deploy it automatically, have a back up and root access for FFMPEG installation.

    


    It runs smoothly locally on Windows / Linux, now I want to host it somewhere.

    


    What I would like to have :

    


      

    • Ease of deployment : I got experience in adminstration of linux root servers, but I look for something easy to integrate and maybe automatically deploy it from Github or Gitlab
    • 


    • Backup : I want to backup the database ideally to another service provider in case something goes wrong.
    • 


    • Linux : One Part of it, amongs others is to convert different audio formats using ffmpeg.
So, (I think) I need linux root access as well.
    • 


    • Time Horzion : I would like to make sure it still runs in ten+ years, so it should be a reliable provider where I only update the application from time to time if needed.
    • 


    • Money : As it is only for personal use at this moment, I don't want to invest a fortune.
    • 


    


    What provider and deployment pipeline would you recommend to me ?

    


  • poll always return 0 on ff_poll_interrupt on avformat_open_input, while playing a rtsp authentication url [closed]

    12 mars 2024, par CodeEater

    I tried to play a rtsp authentication url on my personal player. The rtsp url format is rtsp ://user:pass@x.x.x.x/VideoString. VLC player can play this url but mine is not ok.

    


    Specifically, on function bellow, ret always return 0 and the whole thread stuck at the loop.

    


    static int ff_poll_interrupt(struct pollfd *p, nfds_t nfds, int timeout, AVIOInterruptCB *cb)
{
    int runs = timeout / POLLING_TIME;
    int ret = 0;

    do {
        if (ff_check_interrupt(cb))
            return AVERROR_EXIT;
        ret = poll(p, nfds, POLLING_TIME);
        if (ret != 0) {
            if (ret < 0) {
                ff_log_net_error(NULL, AV_LOG_ERROR, "ff_poll_interrupt");
                ret = ff_neterrno();
            }
            if (ret == AVERROR(EINTR))
                 continue;
            break;
        }
    } while (timeout <= 0 || runs-- > 0);

    if (!ret) {
        av_log(NULL, AV_LOG_ERROR, "Error in ff_pool_interrupt, timeout = %d.\n", timeout);
        return AVERROR(ETIMEDOUT);
    }
    return ret;
}


    


    Codes bellow are what I modified try to fix it . And now it will return "timeout" because "runs" works on ff_poll_interrupt.

    


    ...
av_dict_set(&mInputOpts, "buffer_size", "1024000", 0);
av_dict_set(&mInputOpts, "rtsp_transport", "tcp", 0);
av_dict_set(&mInputOpts,"stimeout","20*1000*1000",0);


int ret = avformat_open_input(&mCtx, filename, in_fmt, mInputOpts ? &mInputOpts : nullptr);
...


    


    wireshack shows that only 3 messages occur during the whole process(filtered by specific ip), which occurs on "start_connect_attempt" called by ff_connect_parallel.

    


    wireshack messages

    


    order is :

    


      

    1. C to S
    2. 


    3. S to C
    4. 


    5. C to S
    6. 


    


    expected : 4.C to S(with options or describe)

    


    if poll return normal, then 4.C to S(with options or describe) will execute on ff_rtsp_connect.

    


    So my question is Why poll always return 0 on ff_poll_interrupt on avformat_open_input, while playing a rtsp authentication url ?