
Recherche avancée
Autres articles (62)
-
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
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 (...) -
MediaSPIP Init et Diogène : types de publications de MediaSPIP
11 novembre 2010, parÀ l’installation d’un site MediaSPIP, le plugin MediaSPIP Init réalise certaines opérations dont la principale consiste à créer quatre rubriques principales dans le site et de créer cinq templates de formulaire pour Diogène.
Ces quatre rubriques principales (aussi appelées secteurs) sont : Medias ; Sites ; Editos ; Actualités ;
Pour chacune de ces rubriques est créé un template de formulaire spécifique éponyme. Pour la rubrique "Medias" un second template "catégorie" est créé permettant d’ajouter (...)
Sur d’autres sites (4108)
-
How to sum audio from two streams in ffmpeg
9 février 2021, par user3188445I have a video file with two audio streams, representing two people talking at different times. The two people never talk at the same time, so there is no danger of clipping by summing the audio. I would like to sum the audio into one stream without reducing the volume. The ffmpeg amix filter has an option that would seem to do what I want, but the option does not seem to work. Here are two minimal non-working examples (the audio tracks are [0:2] and [0:3]) :


ffmpeg -i input.mkv -map 0:0 -c:v copy \
 -filter_complex '[0:2][0:3]amix' \
 output.m4v

ffmpeg -i input.mkv -map 0:0 -c:v copy \
 -filter_complex '[0:2][0:3]amix=sum=sum' \
 output.m4v



The first example diminishes the audio volume. The second example is a syntax error. I tried other variants like
amix=sum
andamix=sum=1
, but despite the documentation I don't think the sum option exists any more.ffmpeg -h filter=amix
does not mention the sum option (ffmpeg version n4.3.1).

My questions :


- 

-
Can I sum two audio tracks with ffmpeg, without losing resolution. (I'd rather not cut the volume in half and scale it up, but if there's no other way I guess I'd accept and answer that sacrifices a bit.)


-
Is there an easy way to adjust the relative delay of one of the tracks by a few milliseconds ?








-
-
sws_scale() does not convert image simply copying it from source to target
14 mars 2020, par SlavTrying to read arbitrary video as plain RGB24 pixels so convert frame with
sws_scale()
this way ://...
AVFrame* pic_out = av_frame_alloc();
pic_out->format = AV_PIX_FMT_RGB24;
pic_out->width = 1920;
pic_out->height = 1080;
av_frame_get_buffer( pic_out, 32 );
struct SwsContext * img_convert_ctx = sws_getContext(
1920, 1080, AV_PIX_FMT_YUV420P,
1920, 1080, AV_PIX_FMT_RGB24,
SWS_BICUBIC,
NULL, NULL, NULL
);
//...
sws_scale(
img_convert_ctx,
pic_src->data, //pic_src is from avcodec_receive_frame()
pic_src->linesize,
0,
1080,
pic_out->data,
pic_out->linesize
);Everything goes without any errors, but
pic_out
ends up having the same data aspic_src
.
What could be the problem ?Full minimal example is here (supposed to be RGB24 image is there as 2.bmp which looks like actually being YUV-something)
-
subprocess.run output is empty (python 3.8)
26 juillet 2022, par Marino LinajeI'm trying to capture the output of a command with the following code :


lines = subprocess.run(['ffmpeg', '-hide_banner', '-nostats', '-i', in_filename, '-vn', '-af', 'silencedetect=n={}:d={}'.format(silence_threshold, silence_duration), '-f', 'null', '-'], capture_output=True, text=True, shell=True, check=True, encoding='utf-8').stdout 
print (lines)



But lines is an empty string and nothing is printed.
When
capture_output=True
is removed, the correct output is showed (without printing it).

I tested many combinations, including removing all the
subprocess.run
parameters and only includecapture_output=True
with the same result.

I also tested with few argument for a minimal example :
subprocess.run(['ffmpeg', '-version'], capture_output=True, text=True, shell=True, check=True, encoding='utf-8').stdout


Also tested
stdout=subprocess.PIPE
andstderr=subprocess.PIPE
assubprocess.run
arguments instead ofcapture_output=True


I can't figure out what is happening. Thanks in advance !