
Recherche avancée
Médias (16)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (77)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Publier sur MédiaSpip
13 juin 2013Puis-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 -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)
Sur d’autres sites (7742)
-
Merge video clips together with FFMPEG's concat, where some clips have no audio
23 février 2023, par Patrick VelliaI have a grouping of files in a videos.txt file :


file 'title.mp4'
file 'welcome.mp4'
file 'introductions_slide.mp4'
file 'introductions.mp4'
file 'presentation_part_1_slide.mp4'
file 'presentation_part_1.mp4'
file 'presentation_part_2_slide.mp4'
file 'presentation_part_2a.mp4'
file 'presentation_part_2b.mp4'
file 'questions_and_answers_slide.mp4'
file 'questions_and_answers.mp4'



Some of these files (title.mp4, introductions_slide.mp4, presentation_part_1_slide.mp4, presentation_part_2_slide.mp4 and questions_and_answers_slide.mp4) are generated from PowerPoint's export to MP4 files and do not contain an audio stream.


I tried to follow this thread to add an audio stream to title.mp4, but when I then run the concat command, it's full of errors in the input stream. The resulting file is a silent one with no audio stream.


I know it's possible to merge a mixed silent-noise audio video files together because I was able ot achieve it in QuickTime. However, I am trying to figure out how to do it using ffmpeg.


Here's my current concat command :


ffmpeg -f concat -i videos.txt -c:v copy -c:a copy output.mp4



How can I run concat so that it will include the audio where audio is present, but maintain silence where it isn't ?


-
Why the source order matters on working with multiple media sources in a single AVFormatContext ?
24 avril 2024, par Mehmet YILMAZavformat_open_input()
deletes theAVFormatContext*
and returns-6
when the source order changes.

I am trying to open multiple media sources dynamically with different(mixed) formats and codecs in a single context (
AVFormatContext
).

My media sources are a BlackMagic DeckLink Duo SDI input as first source and an
mp4 file
orrtsp stream
as second.

When I order to open (
avformat_open_input()
) the source 2 (RTSP or MP4 file) at first and then open the BlackMagic DeckLink Duo, proceed as expected.

But when I change the order, and first open the DeckLink and then try to open RTSP stream or MP4 file, as I inspected in the step debugger ;
AVFormatContext*
deleting in theav_open_input()
function and it returns-6
as result.

Please find the simple error reproduction code snappet below ;


AVFormatContext* context{avformat_alloc_context()};
const char* url_source1{"DeckLink Duo (1)"};
const AVInputFormat* format_source1{av_find_input_format("decklink")};

const char* url_source2{"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"};

// Open the first media input
int result = avformat_open_input(&context, url_source1, format_source1, NULL);

if(result < 0) {
 exit(1);
}

// Open the second media input
// This function in current order deletes the context and returns -6
result = avformat_open_input(&context, url_source2, NULL, NULL);
if(result < 0) {
 exit(1);
}

// Since the context has been deleted in previous step, segmentation fault accours here!
result = avformat_find_stream_info(context, NULL);
if(result < 0) {
 exit(1);
}

std::cout << "Total number of streams: " << context->nb_streams << std::endl;




But When I change the order and call the
avformat_open_input()
first for themp4
file and then theDeckLink
device as following it proceed as expected, no error.

AVFormatContext* context{avformat_alloc_context()};
const char* url_source1{"DeckLink Duo (1)"};
const AVInputFormat* format_source1{av_find_input_format("decklink")};

const char* url_source2{"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"};


// Open the second media input
int result = avformat_open_input(&context, url_source2, NULL, NULL);
if(result < 0) {
 exit(1);
}


// Open the first media input
result = avformat_open_input(&context, url_source1, format_source1, NULL);

if(result < 0) {
 exit(1);
}


result = avformat_find_stream_info(context, NULL);
if(result < 0) {
 exit(1);
}

std::cout << "Total number of streams: " << context->nb_streams << std::endl;




-
How do I use ffmpeg's `filter_complex` `volume` filter on videos that might not have an audio track ?
9 mars 2023, par jaygoobyI'm mixing new audio tracks into videos, and I want the original video audio to be at a lower volume in the mix :


ffmpeg -i audio.wav -i video.mp4 -c:v copy -filter_complex "[1:a:0]volume=0.5[originalAudio]; [0:a:0][originalAudio]amix=inputs=2[m]" -map [m] -map 1:v:0 tmp.mp4



that sets the original video audio to be 50% less than it was, when audio.wav is mixed with it. This works fine until there's a video with no audio track. Then I get the error :


Stream specifier ':a:0' in filtergraph description [1:a:0]volume=0.05[originalAudio]; [0:a:0][originalAudio]amix=inputs=2[m] matches no streams.



because the video has no audio track.


Is there a way for me to use ffmpeg filters in the same call, to ensure there's an audio track if one is originally missing, so I don't need to check for the presence of an audio track using an additional step with
ffprobe
,mediainfo
etc ?

[Edit 1] Looks like I need to add a
anullsrc
track to the video inside thefilter_complex
, and then not specifically choose which audio track from the video I want, so either the original or the new silent one (if it's the only one present) is selected via ffmpeg's automatic stream selection...

[Edit 2] Something like this, where I have 2 audio inputs, the first is silence and the second is the input wav. Use
concat
to pick either the silence or the video audio, use the result of that to reduce the volume, then mix in the new audio to the result of that, but I'm not there yet :

ffmpeg -f lavfi -i anullsrc \
 -i audio.wav \
 -i video.mp4 \
 -c:v copy \
 -filter_complex \
 "[0:a] [2:a] concat=n=2:v=0:a=1 [silence-or-video-audio];
 [silence-or-video-audio]volume=0.5[reduced-audio]; [1:a:0][reduced-audio]amix=inputs=2[mixed-audio]" \
 -map "[mixed-audio]" \
 -map "[2:v:0]" \
 tmp.mp4



The error is :
Stream specifier ':a' in filtergraph description [0:a] [2:a] concat=n=2:v=0:a=1 [silence-or-video-audio]; [silence-or-video-audio]volume=0.5[reduced-audio]; [1:a:0][reduced-audio]amix=inputs=2[mixed-audio] matches no streams.