Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (35)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

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

  • 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

Sur d’autres sites (8426)

  • How to batch process a series of video files with powershell and other-transcode/ffmpeg

    7 juin 2022, par DarkDiamond

    TL ;DR

    


    What did I do wrong in the following PowerShell-Script ? It does not work as expected.

    



    


    I am recording some of my lectures in my university with a photo camera. This works pretty well although I have to split the single lecture into three to four parts because the camera can only record 29 minutes of video in one take. I know that this is a common issue related to some licensensing problem that most photo cameras simply don't have the right license to record longer videos. But it confronts me with the problem that I later have to edit the files together after I did some post processing on them.

    


    With the camera I produce up to four video files with sizes around 3.5 GB which is way to big in order to be of any use because our IT department understandably doesn't want to host so much data, as I produce around 22 GB of video material each week.

    


    Some time ago I came across a very useful tool called "other-video-transcoding" by Don Melton over on GitHub, written in ruby, that allows me to compress the files to a reasonable file size without any visual loss. In addition I crop the videos to remove the part of each frame that is neither the board nor a place where my professor stands in order to decrease the filesize even further and do some privacy protection by cutting out most of the students.

    


    As the tools are accessable via the command line, it is relatively easy to configure and does not cost additional computational power to render a nice gui, so I can edit one of the 29 minute clips in less than 10 minutes.

    


    Now I wanted to optimize my workflow by writing a PowerShell script that only takes the parameters what to crop and which files to work on and then does the rest on its own so I can just start the script and then do something else while my laptop renders the new files.

    


    So far I have the following :

    


    $video_path = Get-ChildItem ..\ -Directory | findstr "SoSe"

Get-ChildItem $video_path -name | findstr ".MP4" | Out-File temp.txt -Append 
Get-Content temp.txt | ForEach-Object {"file " + $_} >> .\files.txt

Get-ChildItem $video_path |
Foreach-Object {
other-transcode --hevc --mp4 --target 3000 --crop 1920:780:0:0 $_.FullName
}

#other-transcode --hevc --mp4 --crop 1920:720:60:0 ..\SoSe22_Theo1_videos_v14_RAW\
ffmpeg -f concat -i files.txt -c copy merged.mp4
Remove-Item .\temp.txt


    


    but it does not quite do what I it expect to do.
This is my file system :

    


    sciebo/
└── SoSe22_Theo1_videos/
    ├── SoSe22_Theo1_videos_v16/
    │   ├── SoSe22_Theo1_videos_v16_KOMPR/
    │   │   ├── C0001.mp4
    │   │   ├── C0002.mp4
    │   │   ├── C0003.mp4
    │   │   ├── C0004.mp4
    │   │   ├── temp.txt
    │   │   ├── files.txt
    │   │   └── merged.mp4
    │   └── SoSe22_Theo1_videos_v16_RAW/
    │       ├── C0001.mp4
    │       ├── C0002.mp4
    │       ├── C0003.mp4
    │       └── C0004.mp4
    └── SoSe22_Theo1_videos_v17/
        ├── SoSe22_Theo1_videos_v17_KOMPR
        └── SoSe22_Theo1_videos_v17_RAW/
            ├── C0006.mp4
            ├── C0007.mp4
            ├── C0008.mp4
            └── C0009.mp4


    


    where the 16th lecture is already processed and the 17th is not. I always have the raw video data in the folders ending on RAW and the edited/compressed output files in the one ending on KOMPR. Note that the video files in the KOMPR folder are the output files of the other-transcode tool.

    


    The real work happens in the line where it says

    


    other-transcode --hevc --mp4 --target 3000 --crop 1920:780:0:0 $_.FullName


    


    and in the line

    


    ffmpeg -f concat -i files.txt -c copy merged.mp4


    


    where I concat the output files into the final version I can upload to our online learning platform.
What is wrong with my script ? In the end I'd like to pass the --crop parameter just to my script, but that is not the primary problem.

    



    


    A little information on the transcoding script so you don't have to look into the documentation :
    
As the last argument the tool takes the location of the video files to work on, be it relative or absolute file paths. The output is placed in the folder the script is called in, so if I cd into one of the KOMPR directories and then call

    


    other-transcode --mp4 ../SoSe22_Theo1_videos_v16_RAW/C0001.mp4


    


    a new file C0001.mp4 is created in the KOMPR directory and the transcoded video and old audio are written to that new video file.

    


  • Recording usb cam on raspberry pi with ffmpeg - usb troubleshooting

    18 septembre 2017, par Hwy2Hell

    I want to save video from an external usb cam on the raspberry pi 3. In order to avoid voltage drop issues, I use the offical raspberry power supply (2.5 Amp) and connected all usb devices by a separetely powered usb hub :

    pi@raspi:~/appdev/ffmpeg $ lsusb
    Bus 001 Device 037: ID 046d:09a1 Logitech, Inc. QuickCam Communicate MP/S5500
    Bus 001 Device 036: ID 046d:c03f Logitech, Inc. M-BT85 [UltraX Optical Mouse]
    Bus 001 Device 035: ID 04d9:1503 Holtek Semiconductor, Inc. Shortboard Lefty
    Bus 001 Device 012: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    When I try to test the functionality by running the following bash script (snippet) :

    function capture
    {
       capfile=$(date +%F_%Hh%Mm%Ss)
       echo saving to $wdir/$capfile.mp4
       echo $PATH
       ffmpeg -video_size 320x240 -i /dev/video0 \
       -vf drawtext="fontsize=18:x=10:y=220:fontcolor=red:\
       fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:\
       text=%{localtime}" -t 10 $wdir/$capfile.mp4
       # change -t to 3600 = 1h
    }

    for i in $(seq 1 10)
    do
       echo
       echo Pass $i ...
       capture
    done

    After a few loop-runs I always see device errors :

    Pass 5 ...
    saving to /home/pi/appdev/ffmpeg/2017-09-16_13h31m00s.mp4
    /usr/local/bin:/usr/bin/ffmpeg:/usr/bin:/bin:/sbin
    ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 4.9.2 (Raspbian 4.9.2-10)
     configuration: --arch=armhf --target-os=linux --enable-gpl --enable-libfreetype --enable-mmal --enable-nonfree --enable-omx --enable-omx-rpi
     libavutil      55. 58.100 / 55. 58.100
     libavcodec     57. 89.100 / 57. 89.100
     libavformat    57. 71.100 / 57. 71.100
     libavdevice    57.  6.100 / 57.  6.100
     libavfilter     6. 82.100 /  6. 82.100
     libswscale      4.  6.100 /  4.  6.100
     libswresample   2.  7.100 /  2.  7.100
     libpostproc    54.  5.100 / 54.  5.100
    /dev/video0: Input/output error

    The kernel message log shows that the usb cam has been resetted :

    pi@raspi:~/appdev/ffmpeg $ dmesg | grep usb
    [ 4497.358195] usb 1-1.2.4: new high-speed USB device number 37 using dwc_otg
    [ 4497.573440] usb 1-1.2.4: New USB device found, idVendor=046d, idProduct=09a1
    [ 4497.573466] usb 1-1.2.4: New USB device strings: Mfr=0, Product=0, SerialNumber=2
    [ 4497.573481] usb 1-1.2.4: SerialNumber: A032D310
    [ 4497.605698] input: UVC Camera (046d:09a1) as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4:1.0/input/input15
    [ 4497.625582] usb 1-1.2.4: Warning! Unlikely big volume range (=3072), cval->res is probably wrong.
    [ 4497.625606] usb 1-1.2.4: [5] FU [Mic Capture Volume] ch = 1, val = 4608/7680/1
    [ 5268.123764] usb 1-1.2.4: reset high-speed USB device number 37 using dwc_otg

    Next time I start the script, the usb cam gets disconnected and /dev/viedo0 disappears :

    pi@raspi:~/appdev/ffmpeg $ dmesg | grep usb
    [ 5621.216896] usb 1-1.2.4: USB disconnect, device number 37
    [ 5621.586804] usb 1-1.2.4: new full-speed USB device number 38 using dwc_otg
    [ 5621.686694] usb 1-1.2.4: device descriptor read/64, error -32
    [ 5621.896583] usb 1-1.2.4: device descriptor read/64, error -32
    [ 5622.106572] usb 1-1.2.4: new full-speed USB device number 39 using dwc_otg
    [ 5622.206574] usb 1-1.2.4: device descriptor read/64, error -32
    [ 5622.416577] usb 1-1.2.4: device descriptor read/64, error -32
    [ 5622.626586] usb 1-1.2.4: new full-speed USB device number 40 using dwc_otg
    [ 5623.046583] usb 1-1.2.4: device not accepting address 40, error -32
    [ 5623.146583] usb 1-1.2.4: new full-speed USB device number 41 using dwc_otg
    [ 5623.566603] usb 1-1.2.4: device not accepting address 41, error -32
    [ 5623.566670] usb 1-1.2-port4: unable to enumerate USB device

    Has anybody experienced similar problems and can provide a fix for it ?

    What tools can I use to troubleshoot the usb communication on the pi ?

  • Generate video with ffmpeg to play using JavaFX

    25 mai 2015, par taskman

    People always say to post a new question so I am posting a new question that relates to Generate video with ffmpeg for JavaFX MediaPlayer

    The images I use can be downloaded from here https://www.dropbox.com/s/mt8yblhfif113sy/temp.zip?dl=0. It is a 2.2GB zip file with 18k images, still uploading, might take some time. The images are slices of a 3D object. I need to display images every 10ms to 20ms. I tried it with Java, but just couldn’t get faster than 30ms+ so now I am trying to generate a video that will display images as fast as I want without worrying about memory or CPU power.

    People will be using my software to slice the objects and then generate the videos to be played later one. The player might run on a cheap laptop or might run on a Raspberry Pi. I need to make sure the slicer will work on any OS and that people don’t need to install too much extra stuff to make it work. It would be best if I can just include everything that is needed in the download of the app.

    I also posted here
    https://ffmpeg.zeranoe.com/forum/viewtopic.php?f=15&t=2474&sid=4f7a752f909202fbec19afc9edaf418c

    I am using Windows 7 and I have VLC installed. The ffmpeg version is

    ffmpeg version N-72276-gf99fed7 Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.2 (GCC)

    I also tried the command lines posted on the linked question

    This line produced the video and JavaFX didn’t have any errors

    ffmpeg -f image2 -r 50 -i "Mandibular hollow 1 micron.gizmofill%d.gizmoslice.jpg" -s 1638x1004 -vcodec mpeg4 -qscale 1 -f mp4 Timelapse.mp4

    enter image description here

    This line also produced the video, but JavaFX had an error : "Caused by : MediaException : MEDIA_UNSUPPORTED : Unrecognized file signature !"

    ffmpeg -f image2 -r 50 -i "Mandibular hollow 1 micron.gizmofill%d.gizmoslice.jpg" -s 1920x1080 -vcodec mpeg4 -qscale 1 Timelapse.avi

    enter image description here

    I also tried this two pass encoding I believe. It produced the video, but didn’t play

    ffmpeg -r 50 -i "Mandibular hollow 1 micron.gizmofill%d.gizmoslice.jpg" -s 1638x1004 -r 50 -b:v 1550k -bt 1792k -vcodec libx264 -pass 1 -an combined50.flv && ffmpeg -y -r 50 -i "Mandibular hollow 1 micron.gizmofill%d.gizmoslice.jpg" -s 1638x1004 -r 50 -b:v 1550k -bt 1792k -vcodec libx264 -pass 2 -vpre hq -acodec libfaac -ab 128k combined50.flv

    This is my JavaFX code. As you can see I tried the Oracle video and that worked fine.

    public class FXMLDocumentController implements Initializable {

       @FXML
       private Label label;

       @FXML
       private MediaView mediaView;

       @FXML
       private void handleButtonAction(ActionEvent event) {
           System.out.println("You clicked me!");

    //        final File f = new File("http://download.oracle.com/otndocs/products/javafx/oow2010-2.flv");
           final File f = new File("C:/Users/kobus/Dropbox/JavaProjects/Gizmetor/temp/Timelapse.avi");

    //        "C:/Users/kobus/Dropbox/JavaProjects/Gizmetor/temp/combined50.avi.flv"
    //        http://download.oracle.com/otndocs/products/javafx/oow2010-2.flv

           Media media = new Media(f.toURI().toString());
    //        Media media = new Media("http://download.oracle.com/otndocs/products/javafx/oow2010-2.flv");
           MediaPlayer mediaPlayer = new MediaPlayer(media);
           mediaPlayer.setAutoPlay(true);

           mediaPlayer.play();
           mediaView.setMediaPlayer(mediaPlayer);
           label.setText("Hello World!");
           System.out.println(mediaPlayer.isAutoPlay());

    //        mediaView
       }

       @Override
       public void initialize(URL url, ResourceBundle rb) {
           // TODO
       }

    }