
Recherche avancée
Médias (1)
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
Autres articles (75)
-
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 -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)
Sur d’autres sites (8777)
-
what is ffmpeg exit code 2 ? and also output error array is empty and not working in php
14 juin 2019, par Mehdi ZamaniI use ffmpeg to convert bitrate to 128 but not working in php
exec("ffmpeg -i input.mp3 -codec:a libmp3lame -b:a 128k output().mp3 2>&1",
$output, $exit_code);
if ($exit_code!= 0) {
$data['message'][] = "Error";
}
print_r($output);
print_r($exit_code);
exit;After running this code show error code 2.
The output is an empty array and also exit_code is 2 and not create output.mp3 file.I already study How can I find out what this ffmpeg error code means ? but this isn’t my problem and don’t explain error code 2 or error code 2 is not defined. My problem is dont show any error and error message is empty just exit_code show 2 that means is some error happened.
-
x264 static lib libx264.a occur an error : asm code, recompile with -fPIC [closed]
20 juin 2019, par thunvancompile with static libs :
yasm -I. -I. -DARCH_X86_64=1 -I./common/x86/ -f elf64 -Worphan-labels -DSTACK_ALIGNMENT=32 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/x86/cabac-a.o common/x86/cabac-a.asm
link the libx264.a to another so libs
occur :
(cabac-a.o): relocation R_X86_64_PC32 against symbol `x264_cabac_range_lps' can not be used when making a shared object; recompile with -fPIC
used
-DPIC
with yasm, also have error.gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math -m64 -Wall -I. -I. -std=gnu99 -D_GNU_SOURCE -mpreferred-stack-boundary=5 -I/usr/local/include -I/usr/local/include -fPIC -fomit-frame-pointer -fno-tree-vectorize -c -o encoder/cavlc.o encoder/cavlc.c
gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math -m64 -Wall -I. -I. -std=gnu99 -D_GNU_SOURCE -mpreferred-stack-boundary=5 -I/usr/local/include -I/usr/local/include -fPIC -fomit-frame-pointer -fno-tree-vectorize -c -o encoder/encoder.o encoder/encoder.c
gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math -m64 -Wall -I. -I. -std=gnu99 -D_GNU_SOURCE -mpreferred-stack-boundary=5 -I/usr/local/include -I/usr/local/include -fPIC -fomit-frame-pointer -fno-tree-vectorize -c -o encoder/lookahead.o encoder/lookahead.c
gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math -m64 -Wall -I. -I. -std=gnu99 -D_GNU_SOURCE -mpreferred-stack-boundary=5 -I/usr/local/include -I/usr/local/include -fPIC -fomit-frame-pointer -fno-tree-vectorize -c -o common/threadpool.o common/threadpool.c
gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math -m64 -Wall -I. -I. -std=gnu99 -D_GNU_SOURCE -mpreferred-stack-boundary=5 -I/usr/local/include -I/usr/local/include -fPIC -fomit-frame-pointer -fno-tree-vectorize -c -o common/x86/mc-c.o common/x86/mc-c.c
gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math -m64 -Wall -I. -I. -std=gnu99 -D_GNU_SOURCE -mpreferred-stack-boundary=5 -I/usr/local/include -I/usr/local/include -fPIC -fomit-frame-pointer -fno-tree-vectorize -c -o common/x86/predict-c.o common/x86/predict-c.c
yasm -I. -I. -DARCH_X86_64=1 -I./common/x86/ -f elf64 -Worphan-labels -DSTACK_ALIGNMENT=32 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/x86/const-a.o common/x86/const-a.asm
yasm -I. -I. -DARCH_X86_64=1 -I./common/x86/ -f elf64 -Worphan-labels -DSTACK_ALIGNMENT=32 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/x86/cabac-a.o common/x86/cabac-a.asm
yasm -I. -I. -DARCH_X86_64=1 -I./common/x86/ -f elf64 -Worphan-labels -DSTACK_ALIGNMENT=32 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/x86/dct-a.o common/x86/dct-a.asm
yasm -I. -I. -DARCH_X86_64=1 -I./common/x86/ -f elf64 -Worphan-labels -DSTACK_ALIGNMENT=32 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/x86/deblock-a.o common/x86/deblock-a.asm
yasm -I. -I. -DARCH_X86_64=1 -I./common/x86/ -f elf64 -Worphan-labels -DSTACK_ALIGNMENT=32 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/x86/mc-a.o common/x86/mc-a.asm
yasm -I. -I. -DARCH_X86_64=1 -I./common/x86/ -f elf64 -Worphan-labels -DSTACK_ALIGNMENT=32 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/x86/mc-a2.o common/x86/mc-a2.asm
yasm -I. -I. -DARCH_X86_64=1 -I./common/x86/ -f elf64 -Worphan-labels -DSTACK_ALIGNMENT=32 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/x86/pixel-a.o common/x86/pixel-a.asm
yasm -I. -I. -DARCH_X86_64=1 -I./common/x86/ -f elf64 -Worphan-labels -DSTACK_ALIGNMENT=32 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/x86/predict-a.o common/x86/predict-a.asmhow to compile asm code with yasm, and result to pic code successfully ?
-
pydub.exceptions.CouldntDecodeError : Decoding failed. ffmpeg returned error code : 1
9 avril, par azail765This script will work on a 30 second wav file but not a 10 minutes phone call also in wav format. Any help would be appreciated


I've downloaded ffmpeg.


# Import necessary libraries 
from pydub import AudioSegment 
import speech_recognition as sr 
import os
import pydub


chunk_count = 0
directory = os.fsencode(r'C:\Users\zach.blair\Downloads\speechRecognition\New folder')
# Text file to write the recognized audio 
fh = open("recognized.txt", "w+")
for file in os.listdir(directory):
 filename = os.fsdecode(file)
 if filename.endswith(".wav"):
 chunk_count += 1
 # Input audio file to be sliced 
 audio = AudioSegment.from_file(filename,format="wav") 
 
 ''' 
 Step #1 - Slicing the audio file into smaller chunks. 
 '''
 # Length of the audiofile in milliseconds 
 n = len(audio) 
 
 # Variable to count the number of sliced chunks 
 counter = 1
 
 
 
 # Interval length at which to slice the audio file. 
 interval = 20 * 1000
 
 # Length of audio to overlap. 
 overlap = 1 * 1000
 
 # Initialize start and end seconds to 0 
 start = 0
 end = 0
 
 # Flag to keep track of end of file. 
 # When audio reaches its end, flag is set to 1 and we break 
 flag = 0
 
 # Iterate from 0 to end of the file, 
 # with increment = interval 
 for i in range(0, 2 * n, interval): 
 
 # During first iteration, 
 # start is 0, end is the interval 
 if i == 0: 
 start = 0
 end = interval 
 
 # All other iterations, 
 # start is the previous end - overlap 
 # end becomes end + interval 
 else: 
 start = end - overlap 
 end = start + interval 
 
 # When end becomes greater than the file length, 
 # end is set to the file length 
 # flag is set to 1 to indicate break. 
 if end >= n: 
 end = n 
 flag = 1
 
 # Storing audio file from the defined start to end 
 chunk = audio[start:end] 
 
 # Filename / Path to store the sliced audio 
 filename = str(chunk_count)+'chunk'+str(counter)+'.wav'
 
 # Store the sliced audio file to the defined path 
 chunk.export(filename, format ="wav") 
 # Print information about the current chunk 
 print(str(chunk_count)+str(counter)+". Start = "
 +str(start)+" end = "+str(end)) 
 
 # Increment counter for the next chunk 
 counter = counter + 1
 
 
 AUDIO_FILE = filename 
 
 # Initialize the recognizer 
 r = sr.Recognizer() 
 
 # Traverse the audio file and listen to the audio 
 with sr.AudioFile(AUDIO_FILE) as source: 
 audio_listened = r.listen(source) 
 
 # Try to recognize the listened audio 
 # And catch expections. 
 try: 
 rec = r.recognize_google(audio_listened) 
 
 # If recognized, write into the file. 
 fh.write(rec+" ") 
 
 # If google could not understand the audio 
 except sr.UnknownValueError: 
 print("Empty Value") 
 
 # If the results cannot be requested from Google. 
 # Probably an internet connection error. 
 except sr.RequestError as e: 
 print("Could not request results.") 
 
 # Check for flag. 
 # If flag is 1, end of the whole audio reached. 
 # Close the file and break. 
fh.close() 



I get this error on
audio = AudioSegment.from_file(filename,format="wav")
:

Traceback (most recent call last):
 File "C:\Users\zach.blair\Downloads\speechRecognition\New folder\speechRecognition3.py", line 17, in <module>
 audio = AudioSegment.from_file(filename,format="wav")
 File "C:\Users\zach.blair\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pydub\audio_segment.py", line 704, in from_file
 p.returncode, p_err))
pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1
</module>


Output from ffmpeg/avlib :


ffmpeg version N-95027-g8c90bb8ebb Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 9.2.1 (GCC) 20190918
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
 libavutil 56. 35.100 / 56. 35.100
 libavcodec 58. 58.101 / 58. 58.101
 libavformat 58. 33.100 / 58. 33.100
 libavdevice 58. 9.100 / 58. 9.100
 libavfilter 7. 58.102 / 7. 58.102
 libswscale 5. 6.100 / 5. 6.100
 libswresample 3. 6.100 / 3. 6.100
 libpostproc 55. 6.100 / 55. 6.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from '2a.wav.wav':
 Duration: 00:09:52.95, bitrate: 64 kb/s
 Stream #0:0: Audio: pcm_mulaw ([7][0][0][0] / 0x0007), 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
 Stream #0:0 -> #0:0 (pcm_mulaw (native) -> pcm_s8 (native))
Press [q] to stop, [?] for help
[wav @ 0000024307974400] pcm_s8 codec not supported in WAVE format
Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
Error initializing output stream 0:0 -- 
Conversion failed!