
Recherche avancée
Autres articles (12)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)
Sur d’autres sites (6851)
-
Resuming ffmpeg hls trancoding from an existing segment
2 juillet 2024, par FdebijlI'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
andappend_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 ?


-
Text backdrop by ass formatting
14 septembre 2024, par Armen SanoyanI 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.


-
Low latency rendering pipeline Implementation [closed]
9 septembre 2024, par Makis ChristouThe goal that I am trying to accomplish is to be able to render small/per-compressed (<5MB) videos based on a given config on demand. The config would tell the renderer what text/icons to overlay on the video for example. Currently I have decided to go with
ffmpeg
and wrapping it in a flask api using Python (I use theffmpeg-python
module). The api has 2 routes. An upload route and a render route. So some other service first uploads their background video (which will be reused) and then use the render route to choose a different config, on demand, to render on top of their background video.

Currently an average video takes 0.4s (on a 7950x 128GB RAM) to be rendered and the whole request including I/O, starting ffmpeg, reading assets from SSD and everything takes around 0.7s. That is when the server is not busy at all. Once we increase the concurrent requests it quickly drops to 4-5s range when handling 10 concurrent requests and increases linearly thereafter. We have a predefined output resolution and its the lowest possible before quality takes a hit so reducing further is not an option.


My goal here is 2 fold.


- 

- Reduce latency i.e. keep it under 2s instead of 5 for 10 concurrent renders (the hard part)
- Increase throughput (easier to achieve but looking for cost effectiveness here)






Besides vertical scaling (to reduce render time < 0.4s), moving the server closer to the client (to reduce network latency) are there any obvious ways to reduce the latency of a single request ? One inefficiency that I see is that ffmpeg starts/stops as a new process in every request. Also assets are loaded from disk when ffmpeg starts for each request. Not sure if there is a way to solve this by keeping it all in RAM 24/7. Also have not tried GPUs but I assume it will be worse since copying to the GPU back and forth is expensive.


For increasing throughput, load balancing on multiple machines is the way to go but then I would need a shared storage solution with caching. Any recommendations that are performance oriented ?


Explained above.


- 

- use ffmpeg
- use a better server