
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (76)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (7776)
-
Anomalie #2381 : Corriger le niveau d’intertitre
9 juin 2018, par b bIl y a des H2 dans la dist, qui introduisent des listes d’articles, de résultats, ou des blocs (forum), je pense qu’ils peuvent rester comme ça.
Si le bloc de forum sous le texte de l’article reste en h2, il va se retrouver "au même niveau" qu’un intertitre en h2 donc, c’est pas top non ?
-
mpv player with SFTP does not work in bash script [closed]
19 mars 2024, par Pickles888I 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.


-
C program cannot find function which included in header file
17 juin 2013, par Juneyoung OhI made program like this.
1 #include
2 #include
3 #include
4 #include "libavformat/avformat.h"
5
6 int main (int argc, char* argv[]){
7 av_register_all();
8 return 0;
9 }My header file located in
root@ubuntu:/home/juneyoungoh/getDuration# find / -name "avformat.h"
/root/ffmpeg/libavformat/avformat.h
/usr/local/include/libavformat/avformat.hthen I run with
gcc getDuration.c
, but I show message like below.root@ubuntu:/home/juneyoungoh/getDuration# gcc getDuration.c
/tmp/ccwjonqH.o: In function `main':
getDuration.c:(.text+0x10): undefined reference to `av_register_all'
collect2: ld returned 1 exit statusFrankly, I do not have any idea what makes this.
Thanks for your answers.
========================== edited #1 ===========================
when I "ls /usr/local/lib", I get this.
root@ubuntu:/home/juneyoungoh/getDuration# ls /usr/local/lib/
libavcodec.a libavutil.a libopus.la libvpx.a python2.7
libavdevice.a libfdk-aac.a libpostproc.a libx264.a
libavfilter.a libfdk-aac.la libswresample.a libyasm.a
libavformat.a libopus.a libswscale.a pkgconfigyou can see libavformat.a in the very first of the last line.
so if I command like what you suggest, I get below.
/root/ffmpeg/libavformat/vqf.c:244: undefined reference to `av_free_packet'
/usr/local/lib//libavformat.a(vqf.o): In function `add_metadata':
/root/ffmpeg/libavformat/vqf.c:58: undefined reference to `av_malloc'
/root/ffmpeg/libavformat/vqf.c:64: undefined reference to `av_dict_set'
/usr/local/lib//libavformat.a(vqf.o): In function `vqf_read_header':
/root/ffmpeg/libavformat/vqf.c:148: undefined reference to `av_dict_set'
/root/ffmpeg/libavformat/vqf.c:208: undefined reference to `av_log'
/root/ffmpeg/libavformat/vqf.c:216: undefined reference to `av_malloc'
/root/ffmpeg/libavformat/vqf.c:170: undefined reference to `av_log'
/root/ffmpeg/libavformat/vqf.c:121: undefined reference to `av_log'
/root/ffmpeg/libavformat/vqf.c:184: undefined reference to `av_log'
/root/ffmpeg/libavformat/vqf.c:136: undefined reference to `av_log'
/usr/local/lib//libavformat.a(wavenc.o): In function `wav_write_trailer':
/root/ffmpeg/libavformat/wavenc.c:210: undefined reference to `av_rescale'
/usr/local/lib//libavformat.a(wavenc.o): In function `wav_write_packet':
/root/ffmpeg/libavformat/wavenc.c:181: undefined reference to `av_log'It is too long, so I just post little part of that.
I think all link of libavformat has been broken, But I do not know
what can I do to fix that link.
I have installed that their official link said.
https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuideQuantal