
Recherche avancée
Autres articles (55)
-
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
Gestion de la ferme
2 mars 2010, parLa 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"
Sur d’autres sites (7787)
-
sending udp cbr content using ffmpeg makes memory problem
30 décembre 2020, par PrzemoI am struggling with muxing a few UDP inputs (SPTS from file) in one UDP output (MPTS).
When I use following command


ffmpeg -thread_queue_size 2048 -i "udp://233.0.0.1:4005?fifo_size=1000000&buffer_size=10000000" -thread_queue_size 2048 -i "udp://233.0.0.1:4000?fifo_size=1000000&buffer_size=10000000" -thread_queue_size 2048 -i "udp://233.0.0.1:4001?fifo_size=1000000&buffer_size=10000000" -thread_queue_size 2048 -i "udp://233.0.0.1:4002?fifo_size=1000000&buffer_size=10000000" -thread_queue_size 2048 -i "udp://233.0.0.1:4003?fifo_size=1000000&buffer_size=10000000" -thread_queue_size 2048 -i "udp://233.0.0.1:4004?fifo_size=1000000&buffer_size=10000000" -map 0 -map 1 -map 2 -map 3 -map 4 -map 5 -program title=Program0:st=0:st=1 -program title=Program1:st=2:st=3 -program title=Program2:st=4:st=5 -program title=Program3:st=6:st=7 -program title=Program4:st=8:st=9 -program title=Program5:st=10:st=11 -c copy -metadata service_provider=FILE -f mpegts -muxrate 40000000 -flush_packets 0 "udp://239.2.2.2:2222?overrun_nonfatal=1&fifo_size=1000000&buffer_size=10000000&pkt_size=1316&ttl=1"



I can play (with VLC) the MPTS content many hours with no problems.


When I add a bitrate parameter to make UDP output stream as CBR


"udp://239.2.2.2:2222?overrun_nonfatal=1&fifo_size=1000000&buffer_size=10000000&pkt_size=1316&ttl=1&bitrate=40000000"



instead of


"udp://239.2.2.2:2222?overrun_nonfatal=1&fifo_size=1000000&buffer_size=10000000&pkt_size=1316&ttl=1"



a hear many audio cuts, and from VLC I see then :




main warning : timing screwed (drift : -89659 us) : stopping resampling

main warning : playback too early (-89367) : down-sampling

main warning : playback way too early (-126525) : playing silence

main debug : inserting 6073 zeroes

main warning : playback too early (-47858) : down-sampling

main warning : timing screwed (drift : -97495 us) : stopping resampling

main warning : playback too early (-96807) : down-sampling

main warning : playback way too early (-134672) : playing silence

main debug : inserting 6464 zeroes



and after some random time (several minutes) ffmpeg stops working due to following error :




av_interleaved_write_frame() : Cannot allocate memory




How to make it work with CBR UDP bitrate ?

I tired changing parameters of buffer_size and fifo_size but with no success.

I've increased OS UDP buffers to improve performance but same memory problem is visible

-
Thumbs depending on the video duration
28 février 2017, par MaelLacouras said in the title, i would like to add thumbs, depending on the video duration.
It it possible to define time using percentage ? Or to use a variable duration ? I know that the duration can be found in the _meta, but is it possible to retrieve it before saving the video ?
(I can certainly do it by using ffmpeg command, but it should be available using paperclip command ?)Here is my code :
validates :title,
length: { in: 2..60 }
validates :description,
length: { minimum: 2 }
has_attached_file :content, styles: {
:medium => {
:format => 'mp4',
#convert_options: {
#output: {
#name: 'value' # Results in `-name value` in the command line
#}
#}
},
:thumb0 => { :geometry => '320x180#', :format => 'jpeg', :time => 1.0 * duration / 6.0},
:thumb1 => { :geometry => '320x180#', :format => 'jpeg', :time => 2.0 * duration / 6.0},
:thumb2 => { :geometry => '320x180#', :format => 'jpeg', :time => 3.0 * duration / 6.0},
:thumb3 => { :geometry => '320x180#', :format => 'jpeg', :time => 4.0 * duration / 6.0},
:thumb4 => { :geometry => '320x180#', :format => 'jpeg', :time => 5.0 * duration / 6.0},
}, :processors => [:transcoder]
validates_attachment :content, presence: true,
content_type: { content_type: /\Avideo\/.*\Z/ },
size: { :less_than => 2.gigabytes }Thx in advance for your reply ! If it’s not clear or if you need extra-data let me know :)
(I posted my question here, after wrongly posted it in GitHub, don’t be surprise if you found it on the issue repo)
EDIT
I made it to work with the following code,even if it’s not elegant at all :
has_attached_file :content, styles: {
:medium => {
:format => 'mp4',
},
:thumb0 => { :geometry => '320x180#', :format => 'jpeg', :time => ->(attachment) { attachment.instance.method(:style_time_for0) } },
:thumb1 => { :geometry => '320x180#', :format => 'jpeg', :time => ->(attachment) { attachment.instance.method(:style_time_for1) } },
:thumb2 => { :geometry => '320x180#', :format => 'jpeg', :time => ->(attachment) { attachment.instance.method(:style_time_for2) } },
:thumb3 => { :geometry => '320x180#', :format => 'jpeg', :time => ->(attachment) { attachment.instance.method(:style_time_for3) } },
:thumb4 => { :geometry => '320x180#', :format => 'jpeg', :time => ->(attachment) { attachment.instance.method(:style_time_for4) } },
}, :processors => [:transcoder]
def style_time_for0(meta, _options)
1*meta[:duration].to_f / 6
end
def style_time_for1(meta, _options)
2*meta[:duration].to_f / 6
end
def style_time_for2(meta, _options)
3*meta[:duration].to_f / 6
end
def style_time_for3(meta, _options)
4*meta[:duration].to_f / 6
end
def style_time_for4(meta, _options)
5*meta[:duration].to_f / 6
endI should add a loop and a parameter to the style_time_for, but i can’t get it to work. Does someone have an idea ?
-
How do I compose three overlapping videos w/audio in ffmpeg ?
10 avril 2021, par Idan GazitI have three videos : let's call them
intro
,recording
andoutro
. My ultimate goal is to stitch them together like so :



Both
intro
andoutro
have alpha (prores 4444) and a "wipe" to transition, so whenoverlay
ing, they must be on top of the recording. The recording is h264, and ultimately I'm encoding out for youtube with these recommended settings.

I've figured out how to make the thing work correctly for
intro
+recording
:

$ ffmpeg \
 -i intro.mov \
 -i recording.mp4 \
 -filter_complex \
 "[1:v]tpad=start_duration=10:start_mode=add:color=black[rv]; \
 [1:a]adelay=delays=10s:all=1[ra]; \
 [rv][0:v]overlay[v];[0:a][ra]amix[a]" \
 -map "[a]" -map "[v]" \
 -movflags faststart -c:v libx264 -profile:v high -bf 2 -g 30 -crf 18 -pix_fmt yuv420p \
 out.mp4 -y



However I can't use the
tpad
trick for the outro because it would render black frames over everything.

I've tried various iterations with
setpts
/asetpts
as well as passing-itsoffset
for the input, but haven't come up with a solution that works correctly for both video and audio. This tries to start the outro at 16 seconds into the recording (10s start + 16s of recording is how I got tosetpts=PTS+26/TB
). del, but doesn't work correctly, I get both intro and outro audio from the first frame, and the recording audio cuts out when the outro overlay begins :

$ ffmpeg \
 -i intro.mov \
 -i recording.mp4 \
 -i outro.mov \
 -filter_complex \
 "[1:v]tpad=start_duration=10:start_mode=add:color=black[rv]; \
 [1:a]adelay=delays=10s:all=1[ra]; \
 [2:v]setpts=PTS+26/TB[outv]; \
 [2:a]asetpts=PTS+26/TB[outa]; \
 [rv][0:v]overlay[v4]; \
 [0:a][ra]amix[a4]; \
 [v4][outv]overlay[v]; \
 [a4][outa]amix[a]" \
 -map "[a]" -map "[v]" \
 -movflags faststart -c:v libx264 -profile:v high -bf 2 -g 30 -crf 18 -pix_fmt yuv420p \
 out.mp4 -y



I think the right solution lies in the direction of using
setpts
correctly but I haven't been able to wrap my brain fully around it. Or, maybe I'm making life complicated and there's an easier approach ?

In the nice-to-have realm, I'd love to be able to specify the start of the
outro
relative to the end of the recording. I will be doing this to a bunch of recordings of varying lengths. It would be nice to have one command to invoke on everything rather than figuring out a specific timestamp for each one.

Thank you !