Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Autres articles (51)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (6928)

  • Text backdrop by ass formatting

    14 septembre 2024, par Armen Sanoyan

    I want to add box behind a word using ass subtitles formatting. The box should have border radius. the ass file later will be used by ffmpeg.

    


    I have tried the BorderStyle=3 form stack ansers 1, 2 both of them do not provide a way to get rounded boxes. Also the BorderStyle=4 didn't work for me. In comments of last stack answer I found a possible reason that my libraries can be old, but anyway it doesn't seem that BorderStyle=4 will solve my problem of border radius. There is another way to achieve rounded box link to answer. I didn't figure it out how to install all the libs he explained there. Also the later answer seems to me over complicated. Is there an other way to make the borders of box rounded without suffering and pain ? I also tried drawing the box with Drawing commands like

    


    {\p1}m 0 0 s 100 0 100 100 0 100 c{\p0}


    


    But it still doesn't seem to be the best way to achieve rounded borders.

    


  • Pyinstaller Hidden import 'ffmpeg-python' not found

    13 août 2024, par petunia rose

    Trying to convert Python scripts to exe with PyInstaller.

    


    In my code, I use ffmpeg-python :

    


    import ffmpeg
....
def ffmpeg_save_clip(self,output_video: str, clip_start: str, clip_end: str): 
  (ffmpeg 
   .input(self.file.get_videopath(), ) 
   .output(output_video, vcodec='copy', ss=clip_start, to=clip_end, acodec='copy') 
   .global_args('-y') 
   .run())


    


    So Ii call PyInstaller from terminal with related flag :

    


    pyinstaller --windowed --hidden-import "ffmpeg-python" --noconsole --icon=app.ico --name "app" main.py 


    


    I checked also :

    


    pip install ffmpeg-python 
Requirement already satisfied: ffmpeg-python in c:\python38\lib\site-packages (0.2.0) 
Requirement already satisfied: future in c:\python38\lib\site-packages (from ffmpeg-python) (0.18.3)


    


    But I get from PyInstaller :

    


    Hidden import 'ffmpeg-python' not found


    


    App works in visual-studio, but when I run pyinstaller exe and try to save clip, it freeze without response.

    


    Note : I also :

    


      

    1. try to add ffmpeg.exe into root folder of pyinstaller app.

      


    2. 


    3. try to use .spec file with :

      


      binaries=[('C:\\ffmpeg\\bin\\ffmpeg.exe', 'ffmpeg/),('C:\\ffmpeg\\bin\\ffplay.exe','ffplay/'), ('C:\\ffmpeg\\bin\\ffprobe.exe', 'ffprobe/')],

      


    4. 


    


    Nothing changes

    


    UPDATE
Tank you @happy_code_egg, you explained me such a things.
I tried what you said and I don't have error any more.

    


    But I can't make work ffmpeg anywhere on Pyinstaller exe.
I added a try/except block to isolate problem
(when I launch app on Visualstudio it works, but not when use exe).

    


    block is (very symilar to past def) :

    


    def ffmpeg_save_clip(self,output_video: str, clip_start: str, clip_end: str):
    input = 'C:\Users\x\Desktop\input.mp4'
    output = 'C:\Users\x\Desktop\output.mp4'
    try:
        (ffmpeg
        .input(input)
        .output(output, vcodec='copy', ss=clip_start, to=clip_end, acodec='copy')
        .global_args('-y')
        .run(capture_stdout=True))
    except Exception as e:
        self.logger.error('Video window -> ffmpeg_save_clip -> error ' + str(e))
        self.logger.error('Video window -> ffmpeg_save_clip -> input file: ' + input)
        self.logger.error('Video window -> ffmpeg_save_clip -> output file ' + output)
        raise ValueError(str(e))


    


    Note : (input and output fixed are only as simple path examples)

    


    When I open log I have :

    


    2024-08-09 11:28:50,293 - ERROR - Video window -> ffmpeg_save_clip -> error [WinError 2] File not found error
2024-08-09 11:28:50,293 - ERROR - Video window -> ffmpeg_save_clip -> input file: C:\Users\x\Desktop\input.mp4
2024-08-09 11:28:50,293 - ERROR - Video window -> ffmpeg_save_clip -> output file C:\Users\x\Desktop\ouput.mp4


    


    (I tried with '/' and also '\' to create path)
File paths are correct and, on Visualstudio, they can be processed by ffmpeg (no error), but the exe seems to not find (input or output)

    


    I tried solution described here :
Python ffmpeg won't accept path
(without effects)

    


    I found also these discussions :

    


    github ffmpeg-python issue1

    


    github ffmpeg-python issue2

    


    in both discussions seems to be a problem with ffmpeg + ffmpeg-python libs cohexistence.

    


    I tried (as said) to uninstal both and reinstall ffmpeg-python,
but nothing change.

    


    Note :
I've also three other warning during Pyinstaller :
(I write them only to complete context, but i think they have no repercussions on this problem.)

    


    57283 ERROR: Hidden import 'fiona._shim' not found
57298 WARNING: Hidden import "fiona._shim" not found!
57392 WARNING: Hidden import "importlib_resources.trees" not found!


    


    tried with :

    


    --hidden-import fiona._shim --hidden-import fiona.schema


    


    tried also with :

    


    --add-data="fiona/*;fiona”


    


    but warnings still remains.

    


  • Resuming ffmpeg hls trancoding from an existing segment

    2 juillet 2024, par Fdebijl

    I'm setting up a service to transcode input videos, generally MP4, for HLS with MPEG-TS as the container format. This currently works fine when starting from scratch, but I would like the transcode to be resumable in case the service crashes while working on a longer video.

    


    I'm running into two issues with resuming the transcoding process :

    


      

    • ffmpeg generates too many segments : if the processing is halted at, say, 10 segments for a video that should be 20 segments long and processing is resumed later, the manifest contains 10 + 20 segments, where the final 10 segments don't actually play back properly
    • 


    • Adjacent to this, running the command again when the video is fully transcoded results in the playlist being appended with the entire video once more, with the numbers above that would result in 20 additional segments being added to the playlist every time the conversion is ran. In other words, ffmpeg doesn't realize the transcoding is already complete
    • 


    


    The desired result here is that running the ffmpeg command again simply continues the transcode after the last completed segment and appends these segments to the m3u8 playlist. If all the segments are already present ffmpeg should not output or modify anything. I've tried to coax ffmpeg into this behaviour, but no combination of -start_number, -ss and append_list gets me there.

    


    Here's my current command that is executed when a transcode should be resumed (I've ommited some filters for brevity) :

    


    ffmpeg -i input -map 0:v -map 0:a -map 0:v -map 0:a -map 0:v -map 0:a \
-c:v libx264 -preset veryfast -c:a libfdk_aac \
-maxrate:v:0 1500K -b:a:0 128k \
-maxrate:v:1 3000K -b:a:1 192k \ 
-maxrate:v:2 6000K -b:a:2 256k \
-flags +cgop -g 60 -hls_time 5 -hls_list_size 0 \
-hls_flags independent_segments+temp_file+append_list \
-var_stream_map "v:0,a:0,name:480p v:1,a:1,name:720p v:2,a:2,name:1080p" \
-y -f hls -master_pl_name master.m3u8 ./%v.m3u8


    


    Here is the folder structure that ffmpeg would work in for a resumed transcode, assuming the service crashed after the first two chunks :

    


    .
├── 1080p.m3u8   
├── 1080p0.ts    
├── 1080p1.ts   
├── 480p.m3u8    
├── 480p0.ts     
├── 480p1.ts     
├── 720p.m3u8    
├── 720p0.ts     
├── 720p1.ts     
├── input        
└── master.m3u8  


    


    Here is the contents of 480p.m3u8 :

    


    #EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-INDEPENDENT-SEGMENTS
#EXTINF:5.000000,
480p0.ts
#EXTINF:5.000000,
480p1.ts
#EXT-X-ENDLIST


    


    However, as explained in the prelude, running the command against this folder results in too many chunks being appended to the playlist.

    


    This is the expected 480p playlist :

    


    #EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-INDEPENDENT-SEGMENTS
#EXTINF:5.000000,
480p0.ts
#EXTINF:5.000000,
480p1.ts
#EXTINF:5.000000,
480p2.ts
#EXTINF:5.000000,
480p3.ts
#EXTINF:5.000000,
480p4.ts
#EXTINF:5.733333,
480p5.ts
#EXTINF:5.000000,
480p6.ts
#EXTINF:5.000000,
480p7.ts
#EXTINF:5.000000,
480p8.ts
#EXTINF:5.000000,
480p9.ts
#EXTINF:5.000000,
480p10.ts
#EXTINF:5.000000,
480p11.ts
#EXTINF:5.000000,
480p12.ts
#EXTINF:3.950000,
480p13.ts
#EXT-X-ENDLIST


    


    And this is the actual playlist :

    


    #EXT-X-VERSION:6
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-INDEPENDENT-SEGMENTS
#EXTINF:5.000000,
480p0.ts
#EXTINF:5.000000,
480p1.ts
#EXT-X-DISCONTINUITY
#EXTINF:5.000000,
480p2.ts
#EXTINF:5.000000,
480p3.ts
#EXTINF:5.000000,
480p4.ts
#EXTINF:5.000000,
480p5.ts
#EXTINF:5.000000,
480p6.ts
#EXTINF:5.733333,
480p7.ts
#EXTINF:5.000000,
480p8.ts
#EXTINF:5.000000,
480p9.ts
#EXTINF:5.000000,
480p10.ts
#EXTINF:5.000000,
480p11.ts
#EXTINF:5.000000,
480p12.ts
#EXTINF:5.000000,
480p13.ts
#EXTINF:5.000000,
480p14.ts
#EXTINF:3.950000,
480p15.ts
#EXT-X-ENDLIST


    


    I've already surmised the #EXT-X-DISCONTINUITY tag can't be disabled, which is fine, as I can remove that with post-processing steps. The two extra segments are problematic however, as they break the video at the end of its actual runtime.

    


    To bring this to a point : is there a way to get ffmpeg to resume transcoding from the last segment, such that it does not append the entire video to the last transcoding attempt ?