Recherche avancée

Médias (91)

Autres articles (49)

  • MediaSPIP Player : les contrôles

    26 mai 2010, par

    Les contrôles à la souris du lecteur
    En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...)

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (5053)

  • OpenCV (3.3.0) returns fail on VideoCapture with Video but works with Webcam [OS X]

    1er novembre 2017, par njoye

    Thanks for reading already, I’ve been trying to get this to work for a day and I didn’t get closer to the solution.

    I’m trying to get this object tracker to work. When I use a video from my webcam (with : python object-tracker-single.py -d 0, everything works as expected.

    But as soon as I’m trying to use a video file (i’ve tried different formats : .mp4, .mkv & .avi. I also tried to use the file given in the repository, that didn’t work as well. To see if there is a File not found-Error, I passed an invalid path to the function and an error got printed, that has not been printed when I used the other videos. So the file(s) i’m using is(/are) valid and not corrupted.

    I installed dlib through homebrew following this article and compiled OpenCV from the official source. This is the CMakeCache.txt that CMake spit out. After the first time I compiled it, I added opencv_contrib to the mix, thinking that it could help (I also think that I actually needed it), but that didn’t fix the problem.

    This is the code I’m having problems with :

    # Create the VideoCapture object
    cam = cv2.VideoCapture(source)

    # If Camera Device is not opened, exit the program
    if not cam.isOpened():
       print "Video device or file couldn't be opened"
       exit()

    print "Press key `p` to pause the video to start tracking"
    while True:
       # Retrieve an image and Display it.
       retval, img = cam.read() #<-- this returns false when trying to read a video
       if not retval:
           print "Cannot capture frame device"
           exit()

    At the marked line, retval equals False and image equals None.
    It would already help me if I could somehow debug this behavior, but I didn’t find any way of doing so.

    I found that many Windows Users had problems with missing ffmpeg support, but that is not the case for me, since I used ffmpeg in previous (not OpenCV-related) projects and CMakeCache.txt reports that ffmpeg has been found and the compilation succeeded.

    I also tried using a fully qualified file-name for the video file, which either resulted in Video device or file couldn't be opened or the given problem.

    If you have any idea how this problem can be completely resolved, have an Idea on how to solve it or can provide me with a way of properly debugging this behavior, I’d be super glad to here it !

    Thanks already !

    -

    System : MacBook Pro (macOS Sierra 10.12.6)

    OpenCV Version : 3.3.0

    Dlib Version (not necessary imo, but hey) : 19.4.0

    Edit 2
    Output of cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-master/modules ../ >> result.txt : pastebin

  • ffprobe to bitrate variable stopped working

    6 novembre 2023, par Bricktop

    I have a simple script to encode a video using the same bitrate as the original. I use ffprobe to fetch the bitrate like this :

    


    ffprobe "%file%" -v 0 -select_streams v:0 -show_entries stream=bit_rate -print_format compact=p=0:nokey=1 >%temp%\bitrate.txt


    


    However, while fixing a but in the script where I had an odd number of " marks, I suddenly ran into this problem with ffprobe :

    


    Argument ' -v 0 -select_streams v:0 -show_entries stream=bit_rate -print_format compact=p=0:nokey=1 >C:\Users\ADMINI~1\AppData\Local\Temp\bitrate.txt' provided as input filename, but 'D:\VIDEO\AMBIANCE\SCOPITONE\MUSIC TELEVISION\This Here - Calm - OFFICIAL VIDEO (1080p 25fps AV1-128kbit AAC).mp4' was already specified.


    


    I am trying to understand this, scanning insanely for yet another " or something in my code but can't figure it out. Here is the full code :

    


    :: write file to queue (first)
move /y "%~dpn0.txt" "%temp%\%~n0.tmp" >nul
echo "%~1" >"%~dpn0.txt"
type "%temp%\%~n0.tmp" >>"%~dpn0.txt"

:: desyncronize instances (todo: try support for adding 9 files at a time)
timeout /t %time:~9,1% /nobreak
:: if not first instance exit
tasklist /fi "imagename eq handbrakecli.exe" | find /i "handbrakecli" && exit
title Transcode

:: delegate queue
for /f "delims=" %%f in (%~dpn0.txt) do (
    set "name=%%~nf"
    set "file=%%~f"
    rem todo: if file has x264 or other video codec mentioned, change to x265
    set "code=%%~dpnf (x265 transcoded)%%~xf"
    call :transcode
)
echo all done!
exit /b

:transcode
title "%name%"
if not exist "%file%" echo %date% %time% source file missing %file% >>%~dpn0.log & goto cleanup
if exist "%code%" echo %date% %time% target file exists %file% >>%~dpn0.log & goto cleanup

:: determine appropriate bitrate (does not seem to work on .webm files, closing the script as a result)
%~dp0ffprobe "%file%" -v 0 -select_streams v:0 -show_entries stream=bit_rate -print_format compact=p=0:nokey=1 >%temp%\bitrate.txt
set /p bitrate=<%temp%\bitrate.txt
:: reduce to full kilobytes
set "bitrate=%bitrate:~0,-3%"
if not defined bitrate echo failed to fetch bitrate & echo %date% %time% no bitrate for %file% >>%~dpn0.log & exit /b
if %bitrate% gtr 7000 set bitrate=7000

:: transcode
%~dp0HandBrakeCLI -i "%file%" -o "%code%" --encoder x265_10bit --encoder-preset slow --encoder-profile main444-10 --vb %bitrate% --two-pass --turbo --audio 1-9 --aencoder copy --audio-copy-mask aac,ac3,mp2,mp3,opus --audio-fallback opus --ab 160 --drc 2.0

:: remove current file from queue, regardless
:cleanup
findstr /v /c:"%file%" "%~dpn0.txt" >"%temp%\%~n0.tmp"
move /y "%temp%\%~n0.tmp" "%~dpn0.txt"


    


    It appears that the set "file=%%~f" is the problem, somehow it shows up as set "file=D:\VIDEO\this video here.mp4" " where the last two characters " should not belong, and I don't know what to change to fix this.

    


    Every type of improvement to the script is very welcomed !

    


  • FFmpeg starting manually but not with Systemd on boot

    23 juin 2021, par eKrajnak

    On Raspberry Pi 4 B 4GB with official Debian 10 image, I have /home/pi/run.sh script with following :

    


    #!/bin/bash
ffmpeg -nostdin -framerate 15 -video_size 1280x720 -input_format yuyv422  -i /dev/video0 -f alsa -i hw:Device \
    -af acompressor=threshold=-14dB:ratio=9:attack=10:release=1000 -c:a aac -ac 2 -ar 48000 -ab 160k \
    -c:v libx264 -pix_fmt yuv420p -b:v 3M -bf 1 -g 20 -flags +ilme+ildct -preset ultrafast \
    -streamid 0:0x101 -streamid 1:0x100 -mpegts_pmt_start_pid 4096 -mpegts_start_pid 0x259 -metadata:s:a:0 language="" -mpegts_service_id 131 -mpegts_transport_stream_id 9217 -metadata provider_name="Doesnt matter" -metadata service_name="Doesnt matter" \
    -minrate 3500 -maxrate 3500k -bufsize 4500k -muxrate 4000k  -f mpegts "udp://@239.1.67.13:1234?pkt_size=1316&bitrate=4000000&dscp=34" -loglevel debug < /dev/null > /tmp/ff3.log 2>&1


    


    Script is starting from console without problems. It takes audio from USB sound card and video from USB camera and creates UDP stream to IPTV. Then I created Systemd service :

    


    [Unit]
Description=Streamer
After=multi-user.target sound.target network.target

[Service]
ExecStart=/home/pi/run.sh
KillMode=control-group
Restart=on-failure
TimeoutSec=1

[Install]
WantedBy=multi-user.target
Alias=streaming.service


    


    After restarting Raspberry, script has started, but FFmpeg hangs on error failures in log :

    


    cur_dts is invalid st:0 (257) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (256) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (257) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (256) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (257) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (256) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (257) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (256) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)


    


    and will not start streaming to UDP target. But, if I manually login to SSH and issue systemctl stop streaming and then systemctl start streaming Ffmpeg starts successfully. What's different with service auto-start on boot ?

    


    Setting the "sleep timeout" at script begginging will not help. However, removing audio stream from FFmpeg config looks to solve auto-start on boot.