Recherche avancée

Médias (21)

Mot : - Tags -/Nine Inch Nails

Autres articles (33)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (6106)

  • ffmpeg doesn't work when the script is launched by cron - No protocol specified, Cannot open display :0.0

    14 janvier 2024, par a k

    ffmpeg in my script doesn't work when the script is launched by cron of the root

    


    Error : No protocol specified, Cannot open display :0.0

    


    OS : Ubuntu 20.04

    


    #!/bin/bash
log=/var/log/log2/log2.txt

echo ______________ $(date) >> "$log"
echo "$""DISPLAY" "=      "  "$DISPLAY" >> "$log" ;
echo whoami '         ' $(whoami) >> "$log" 
echo pwd '            ' $(pwd) >> "$log" 
echo "$""USER" "=" '        ' "$USER" >> "$log"
echo PATH '           ' "$PATH" >> "$log"
echo which ffmpeg '   ' $(which ffmpeg)>> "$log" 
echo whereis ffmpeg ' ' $(whereis ffmpeg) >> "$log" 
echo "\nls -l /bin/* | grep ffmpeg" '        ' >> "$log"
ls -l /usr/bin/* | grep ffmpeg >> "$log"
echo "ls -l /var/log | grep log2" ' '>> "$log"
ls -l /var/log | grep log2 >> "$log"

ffmpeg -y -f x11grab -s 1366x768 -i :0.0 -r 25 /var/log/log2/test.mp4 -loglevel error 2>>"$log" &

echo "pid ffmpeg ""$""!"" = " "$!" >> "$log" 
sleep 5
kill "$!"
echo exit >> "$log"
exit


    


    When Cron (Cron of the root) launches the script, ffmpeg shows the error "No protocol specified, Cannot open display :0.0"

    


    /var/log/log2/log2.txt :

    


    ______________ ven. 05 mai 2023 04:10:01 CEST
$DISPLAY =       
whoami           root
pwd              /root
$USER =          
PATH             /usr/bin:/bin
which ffmpeg     /usr/bin/ffmpeg
whereis ffmpeg   ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
ls -l /usr/bin/* | grep ffmpeg  
-rwxr-xr-x 1 root   root      284976 mai   18  2022 /usr/bin/ffmpeg
ls -l /var/log | grep log2  
drwxrwxrwx  2 root              root               4096 mai    5 04:09 log2
pid ffmpeg $! =  74590
No protocol specified
[x11grab @ 0x56244aa06740] Cannot open display :0.0, error 1.
:0.0: Input/output error
exit


    


    When I launch the script manually as a not-root user (with sudo), everything work correctly :

    


    ______________ ven. 05 mai 2023 04:10:47 CEST
$DISPLAY =       :0
whoami           root
pwd              /home/an
$USER =          root
PATH             /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
which ffmpeg     /usr/bin/ffmpeg
whereis ffmpeg   ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
ls -l /usr/bin/* | grep ffmpeg  
-rwxr-xr-x 1 root   root      284976 mai   18  2022 /usr/bin/ffmpeg
ls -l /var/log | grep log2  
drwxrwxrwx  2 root              root               4096 mai    5 04:09 log2
pid ffmpeg $! =  74618
exit


    


    When I launch the script manually as the root, everything works correctly :

    


    ______________ ven. 05 mai 2023 04:11:27 CEST
$DISPLAY =       :0
whoami           root
pwd              /root
$USER =          root
PATH             /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
which ffmpeg     /usr/bin/ffmpeg
whereis ffmpeg   ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
ls -l /usr/bin/* | grep ffmpeg  
-rwxr-xr-x 1 root   root      284976 mai   18  2022 /usr/bin/ffmpeg
ls -l /var/log | grep log2  
drwxrwxrwx  2 root              root               4096 mai    5 04:11 log2
pid ffmpeg $! =  74683
exit


    


    When crontab of an ordinary user launches the script, it works correctly :

    


    $DISPLAY =       
whoami           an
pwd              /home/an
$USER =          
PATH             /usr/bin:/bin
which ffmpeg     /usr/bin/ffmpeg
whereis ffmpeg   ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
ls -l /usr/bin/* | grep ffmpeg  
-rwxr-xr-x 1 root   root      284976 mai   18  2022 /usr/bin/ffmpeg
ls -l /var/log | grep log2  
drwxrwxrwx  2 root              root               4096 mai    5 05:05 log2
pid ffmpeg $! =  77601
exit


    


    I have tried to put into the script :

    


    export DISPLAY=":0"

    


    export DISPLAY=":0.0"

    


    export DISPLAY=":1"

    


  • How can I resolve the FileNotFoundError when attempting to convert an MP3 to WAV using ffmpeg in Python ?

    3 juin 2023, par avocado123123

    I have an MP3 file that I want to convert into a WAV file, but no matter how I try writing the code, it keeps raising FileNotFoundError on the MP3 file and warns me about the installation of FFmpeg.

    


    my code :

    


    from pydub import AudioSegment

# Specify the path to the FFmpeg executable
ffmpeg_path = r"C:\Users\תמרה\AppData\Local\ffmpegio\ffmpeg-downloader\ffmpeg\bin\ffmpeg.exe"
AudioSegment.ffmpeg = ffmpeg_path
AudioSegment.ffprobe = ffmpeg_path

# Load the MP3 file
mp3_file = r"C:\Users\תמרה\Tea Time - Ofshane.mp3"
audio = AudioSegment.from_file(mp3_file, format="mp3")

# Export as WAV
wav_file = r"C:\Users\תמרה\Tea Time - Ofshane.wav"
audio.export(wav_file, format="wav")


    


    when running :

    


    C:\Users\תמרה\PycharmProjects\spotify\venv\Scripts\python.exe "C:\Users\תמרה\PycharmProjects\spotify\file stuff.py" C:\ffmpeg-2023-05-29-git-45fa85a777-full_build\bin\ffmpeg.exe &#xA;C:\Users\תמרה\PycharmProjects\spotify\venv\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn&#x27;t find ffmpeg or avconv - defaulting to ffmpeg, but may not work&#xA;  warn("Couldn&#x27;t find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)&#xA;C:\Users\תמרה\PycharmProjects\spotify\venv\lib\site-packages\pydub\utils.py:198: RuntimeWarning: Couldn&#x27;t find ffprobe or avprobe - defaulting to ffprobe, but may not work&#xA;  warn("Couldn&#x27;t find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)&#xA;Traceback (most recent call last):&#xA;  File "C:\Users\תמרה\PycharmProjects\spotify\file stuff.py", line 12, in <module>&#xA;    audio = AudioSegment.from_file(mp3_file, format="mp3")&#xA;  File "C:\Users\תמרה\PycharmProjects\spotify\venv\lib\site-packages\pydub\audio_segment.py", line 728, in from_file&#xA;    info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)&#xA;  File "C:\Users\תמרה\PycharmProjects\spotify\venv\lib\site-packages\pydub\utils.py", line 274, in mediainfo_json&#xA;    res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)&#xA;  File "C:\Users\תמרה\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 971, in __init__&#xA;True&#xA;    self._execute_child(args, executable, preexec_fn, close_fds,&#xA;  File "C:\Users\תמרה\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1440, in _execute_child&#xA;    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,&#xA;FileNotFoundError: [WinError 2] The system cannot find the file specified&#xA;&#xA;Process finished with exit code 1&#xA;&#xA;</module>

    &#xA;

    What should I do to make this work ?

    &#xA;

  • Capture video with pulse audio on a second camera with motioneye [closed]

    8 mai 2023, par Damien JALLON

    On a raspberrypi 4, bullseye os, motioneye service capture motion with camera on /dev/video0 and launch this script that capture video with pulse audio on a second camera on /dev/video2 :

    &#xA;

    echo $USER >> /home/damien/motion_ffmpeg.log&#xA;cd /home/damien&#xA;source /home/damien/.profile&#xA;source /home/damien/.bashrc&#xA;file="/home/damien/Vid&#xE9;os/motionEye/motionEye_$(date &#x2B;%Y%m%d_%H%M%S).mp4" # Cr&#xE9;ation d&#x27;un nom de fichier horodat&#xE9;&#xA;/usr/bin/ffmpeg -f pulse -thread_queue_size 4096 -ac 1 -channel_layout mono -i default -f v4l2 -thread_queue_size 4096 -i /dev/video2 -t 00:00:03 -vcodec mpeg4 $file >> /home/damien/motion_ffmpeg.log  2>&amp;1 &lt; /dev/null &amp; &#xA;

    &#xA;

    The script work perfectly in standalone, in a terminal connected with the user "damien".&#xA;The log produce in standalone :

    &#xA;

    &#xA;

    damien ffmpeg version 4.3.6-0+deb11u1+rpt1 Copyright (c) 2000-2023 the&#xA;FFmpeg developers built with gcc 10 (Debian 10.2.1-6)
    &#xA;configuration : —prefix=/usr —extra-version=0+deb11u1+rpt1&#xA;—toolchain=hardened —incdir=/usr/include/aarch64-linux-gnu —enable-gpl —disable-stripping —enable-avresample —disable-filter=resample —enable-gnutls —enable-ladspa —enable-libaom —enable-libass —enable-libbluray —enable-libbs2b —enable-libcaca —enable-libcdio —enable-libcodec2 —enable-libdav1d —enable-libflite —enable-libfontconfig —enable-libfreetype —enable-libfribidi —enable-libgme —enable-libgsm —enable-libjack —enable-libmp3lame —enable-libmysofa —enable-libopenjpeg —enable-libopenmpt —enable-libopus —enable-libpulse —enable-librabbitmq —enable-librsvg —enable-librubberband —enable-libshine —enable-libsnappy —enable-libsoxr —enable-libspeex —enable-libsrt —enable-libssh —enable-libtheora —enable-libtwolame —enable-libvidstab —enable-libvorbis —enable-libvpx —enable-libwavpack —enable-libwebp —enable-libx265 —enable-libxml2 —enable-libxvid —enable-libzmq —enable-libzvbi —enable-lv2 —enable-omx —enable-openal —enable-opencl —enable-opengl —enable-sdl2 —disable-mmal —enable-neon —enable-v4l2-request —enable-libudev —enable-epoxy —enable-sand —libdir=/usr/lib/aarch64-linux-gnu —arch=arm64 —enable-pocketsphinx —enable-libdc1394 —enable-libdrm —enable-vout-drm —enable-libiec61883 —enable-chromaprint —enable-frei0r —enable-libx264 —enable-shared
    &#xA;libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libavresample 4. 0. 0 /&#xA;4. 0. 0 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100&#xA;Input #0, pulse, from 'default' :&#xA;Duration : N/A, start : 1683539947.001243, bitrate : 768 kb/s&#xA;Stream #0:0 : Audio : pcm_s16le, 48000 Hz, mono, s16, 768 kb/s Input #1, video4linux2,v4l2, from '/dev/video2' : Duration : N/A, start : 675.690589, bitrate : 147456 kb/s&#xA;Stream #1:0 : Video : rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc Stream&#xA;mapping : Stream #1:0 -> #0:0 (rawvideo (native) -> mpeg4 (native))
    &#xA;Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native)) Press [q] to&#xA;stop, [?] for help Output #0, mp4, to&#xA;'/home/damien/Vidéos/motionEye/motionEye_20230508_115906.mp4' :
    &#xA;Metadata :&#xA;encoder : Lavf58.45.100&#xA;Stream #0:0 : Video : mpeg4 (mp4v / 0x7634706D), yuv420p(progressive), 640x480, q=2-31, 200 kb/s, 30 fps, 15360 tbn, 30&#xA;tbc&#xA;Metadata :&#xA;encoder : Lavc58.91.100 mpeg4&#xA;Side data :&#xA;cpb : bitrate max/min/avg : 0/0/200000 buffer size : 0 vbv_delay : N/A&#xA;Stream #0:1 : Audio : aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s&#xA;Metadata :&#xA;encoder : Lavc58.91.100 aac frame= 90 fps= 67 q=4.6 Lsize= 275kB time=00:00:03.00 bitrate= 750.5kbits/s dup=51 drop=0&#xA;speed=2.23x video:245kB audio:26kB subtitle:0kB other streams:0kB&#xA;global headers:0kB muxing overhead : 1.611457% [aac @ 0x55b808d2b0]&#xA;Qavg : 126.380

    &#xA;

    &#xA;

    The motioneye service is launched under the user "damien".&#xA;The log of the script executed by motioneye when motion is detected :

    &#xA;

    &#xA;

    damien ffmpeg version 4.3.6-0+deb11u1+rpt1 Copyright (c) 2000-2023 the&#xA;FFmpeg developers built with gcc 10 (Debian 10.2.1-6)
    &#xA;configuration : —prefix=/usr —extra-version=0+deb11u1+rpt1&#xA;—toolchain=hardened —incdir=/usr/include/aarch64-linux-gnu —enable-gpl —disable-stripping —enable-avresample —disable-filter=resample —enable-gnutls —enable-ladspa —enable-libaom —enable-libass —enable-libbluray —enable-libbs2b —enable-libcaca —enable-libcdio —enable-libcodec2 —enable-libdav1d —enable-libflite —enable-libfontconfig —enable-libfreetype —enable-libfribidi —enable-libgme —enable-libgsm —enable-libjack —enable-libmp3lame —enable-libmysofa —enable-libopenjpeg —enable-libopenmpt —enable-libopus —enable-libpulse —enable-librabbitmq —enable-librsvg —enable-librubberband —enable-libshine —enable-libsnappy —enable-libsoxr —enable-libspeex —enable-libsrt —enable-libssh —enable-libtheora —enable-libtwolame —enable-libvidstab —enable-libvorbis —enable-libvpx —enable-libwavpack —enable-libwebp —enable-libx265 —enable-libxml2 —enable-libxvid —enable-libzmq —enable-libzvbi —enable-lv2 —enable-omx —enable-openal —enable-opencl —enable-opengl —enable-sdl2 —disable-mmal —enable-neon —enable-v4l2-request —enable-libudev —enable-epoxy —enable-sand —libdir=/usr/lib/aarch64-linux-gnu —arch=arm64 —enable-pocketsphinx —enable-libdc1394 —enable-libdrm —enable-vout-drm —enable-libiec61883 —enable-chromaprint —enable-frei0r —enable-libx264 —enable-shared
    &#xA;libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libavresample 4. 0. 0 /&#xA;4. 0. 0 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100&#xA;default : No such process

    &#xA;

    &#xA;

    The message "default : No such process" seems to mean that there is no connection with the pulse server.

    &#xA;

    Why does ffmpeg not connect to pulse server when launched by motioneye ?

    &#xA;