
Recherche avancée
Autres articles (111)
-
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...) -
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...) -
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)
Sur d’autres sites (11236)
-
avformat_open_input fails intermittently with avfoundation due to "audio format is not supported"
27 septembre 2019, par NaderNaderMy application uses the ffmpeg APIs (avformat, avdevice, etc) to open a selected audio input for encoding. For some inputs I can reliably open them the first time, but when I close and reopen that input later, the avformat_open_input() call fails due to "audio format is not supported". My testing shows that it never fails the first time after starting my, and has only about a 50% chance of success when reopening.
The failure only occurs with my "Built-in Microphone" audio input. I have a USB audio card that reliably opens and closes repeatedly. I have read the documentation and see that the proper way to free the resources after opening is to call avformat_close_input. The only way I have found to guarantee success is to only open the input once.
I have written a test program to recreate these failures.
int main() {
avdevice_register_all();
cout << "Running open audio test" << endl;
int i;
for(i = 0; i< 10; i++) {
AVDictionary* options = NULL;
AVInputFormat* inputFormat = av_find_input_format("avfoundation");
if (!inputFormat) {
cout << "avfoundation inputFormat=null" << endl;
}
AVFormatContext* formatContext = avformat_alloc_context();
int result = avformat_open_input(&formatContext, ":1", inputFormat, &options);
if (result < 0) {
char error[256];
av_strerror(result, error, sizeof(error));
cout << "result=" << result << " " << error << endl;
} else {
cout << "input opened successfully" << endl;
}
sleep(1);
avformat_close_input(&formatContext);
sleep(1);
}
return 0;
}I would expect the main loop to succeed each time but a typical output shows a high failure rate :
Running open audio test
input opened successfully
[avfoundation @ 0x7fdeb281de00] audio format is not supported
result=-5 Input/output error
[avfoundation @ 0x7fdeb2001400] audio format is not supported
result=-5 Input/output error
[avfoundation @ 0x7fdeb2001400] audio format is not supported
result=-5 Input/output error
input opened successfully
input opened successfully
input opened successfully
[avfoundation @ 0x7fdeb2068800] audio format is not supported
result=-5 Input/output error
input opened successfully
input opened successfullyI have tried increasing the sleep time between close and open to 5 seconds, but saw no difference in behavior.
The source of the failure is https://github.com/FFmpeg/FFmpeg/blob/master/libavdevice/avfoundation.m#L672
It appears avfoundation.m internally is opening an input stream and grabbing an audio frame to determine the format, but the value returned is not valid sometimes, when the process has previously opened and closed that input.
Am I not closing the resources properly ? Do I have a hardware issue specific to my macbook ?
Additional Details :
Tested MacBook Pro with MacOS Mojave 10.14.6
Tested with Ffmpeg 3.4.1, 4.0, and 4.1list_devices :
[AVFoundation input device @ 0x7f80fff066c0] AVFoundation video devices:
[AVFoundation input device @ 0x7f80fff066c0] [0] FaceTime HD Camera
[AVFoundation input device @ 0x7f80fff066c0] [1] Capture screen 0
[AVFoundation input device @ 0x7f80fff066c0] AVFoundation audio devices:
[AVFoundation input device @ 0x7f80fff066c0] [0] Behringer Duplex
[AVFoundation input device @ 0x7f80fff066c0] [1] Built-in Microphone
[AVFoundation input device @ 0x7f80fff066c0] [2] USB Audio CODEC -
FFMPEG : Adding font to Video gives error
7 juin 2016, par janki gadhiyaI am trying to execute ffmpeg on android. I have successfully executed 2-3 commands also. But i am stuck at one point where i am adding text to the video.
Here is the command i am executing.
NOT WORKING : because the
text
argument has a space between two words."-i "+path+"out.mp4 -vf drawtext=fontfile="+path+"f1.ttf:text='Stack OverFlow' -y -c:v libx264 -c:a copy -movflags +faststart "+path+"output.mp4"
WORKING : just removed space.
"-i "+path+"out.mp4 -vf drawtext=fontfile="+path+"f1.ttf:text='StackOverFlow' -y -c:v libx264 -c:a copy -movflags +faststart "+path+"output.mp4"
Here
path
contains my external Sd card’s path.out.mp4
andf1.ttf
exists in my folder.My Question is why it is not working with space.
Here is the stack trace i am getting.
FAILED with output : WARNING: linker: /data/data/com.github.hiteshsondhi88.sampleffmpeg/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8 (GCC)
configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/i686-linux-android- --arch=x86 --cpu=i686 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/x86 --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -march=i686' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Testing/out.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100
Duration: 00:00:05.00, start: 0.000000, bitrate: 117 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 300x300 [SAR 40:33 DAR 40:33], 113 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
[NULL @ 0xb585f000] Unable to find a suitable output format for 'text='Stack'
text='Stack: Invalid argumentWhy it is saying invalid argument. It will be great if any ffmpeg expert can guide me in what i am doing wrong here.
I have refered this Question of SO : Text on video ffmpeg
-
Mac terminal command to list files and sort by date to use in ffmpeg
22 septembre 2020, par JeffI am using a gopro to film a bunch of videos. I want to then take those videos directly from the SD card folder and concatenate them into a single video (bypass an editor) by using FFMPEG.


I'm currently able to stitch together "chaptered" videos with the following example command on my Mac (10.13) :


ffmpeg -f concat -safe 0 -i <(for f in /sdcardfolder/100GOPRO/GH*488.MP4; do echo "file '$f'"; done) -c copy /folder/video.mp4


The reason for this is that the ffmpeg command requires a text file that looks like this :




file '/folder/GH016992.MP4'


file '/folder/GH036990.MP4'


...



The real command is this, which generates the list of files in the right format with
file
in front of each one and can be embedded into theffmpeg
command :

for f in /Volumes/GoPro8/DCIM/100GOPRO/GH0*71*.MP4; do echo "file '$f'"; done


I want to add 2 changes to this :


- 

-
List the files in date order (ascending) : I want the list of files to be in date order. But I can't figure out how to add a
-sort
or something to thefor f in
command.

-
Allow a more robust set of file matching/filtering : Right now I can add basic regex like
GH*488.MP4
or, with chapters which increments the first number, something likeGH0[123]488.MP4
would work to just get the first few. But when I change it to be more flexible likeGH0[0-9]71[0-9][0-9].MP4
- which would be necessary to match all files that were recorded yesterday, but nothing before then, the command doesn't like this regex. It seems to only accept a*
.







I looked at a few examples like https://opensource.com/article/19/6/how-write-loop-bash but there wasn't much more than just listing files.


This boils down to a terminal command and isn't really related to FFMPEG but I hope it's helpful context.


I imagined it would be something like this, but this definitely doesn't work :


for f in (find /Volumes/GoPro8/DCIM/100GOPRO/GH0[0-9]71[0-9][0-9].MP4 -type f | sort); do echo "file '$f'"; done


I'd appreciate any help ! Thanks !


Update


It looks like sorting isn't easy with Mac tools so I gave up and wrote a much simpler Ruby script that could execute everything for me. This is not really an answer to my question above but it is a solution.


Here I can easily write the text file necessary for ffmpeg and I can also filter files with a regex on the name, filter for a particular date, and size. Then, via the script, simply execute the ffmpeg command with args to concat files. I can also have it immediately resample the file to compress it (gopro videos are giant and I'm ok with a much lower bitrate if I want to save raw footage).


I got lucky with this
Dir.entries
in Ruby - it seems to automatically sort by date ? I don't know how to sort it otherwise.

PATH = '/Volumes/GoPro8/DCIM/100GOPRO/'
NEW_FILENAME = '/folder/new-file.mp4'
video_list = '/folder/ffmpeg-list.txt'

# create the text file
File.delete(video_list) if File.exist?(video_list)
i = 1
Dir.entries(PATH).each do |f|
 d = File.mtime(PATH + f)
 size = File.size(PATH + f)
 if f.match(/GH0.*.MP4/) && d.to_s.match(/2020-07-30/) && size.to_i < 1000000000
 puts "#{i}\t#{f}\t#{d}\t#{size}"
 File.write(video_list, "file #{PATH + f}\n", mode: "a")
 i= i+1
 end
end

command = "ffmpeg -f concat -safe 0 -i #{video_list} -c copy #{NEW_FILENAME}"

puts "executing concatenate..."
puts command
system(command)



-