
Recherche avancée
Autres articles (39)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
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
Sur d’autres sites (6379)
-
Solution for VB6 to broadcast Webcam
11 juillet 2014, par vantrung -cunconSorry, I know VB6 is decades ago, but I’m in a situation that I have to use VB6 to deliver live webcam stream beetween 2 PC in Server - Client Model program. Vb6-code holds the connection then I have no choice but to transfer all data via that connection.
I’ve tried weeks for this, uncountable approaches but went to nowhere.
My efforts focused on 3 major approaches :1/ Use ffmpeg to record live webcam as ".avi" file on hard disk, transfer parts of file to other end & play it. But I’ve stucked with a media-player that can play a "being written" avi file.
Windows Media Player control told me "file already in use..." & VLC Plugin can’t even be added to VB6 (axvlc.dll).
2/ Use ffmpeg to save live webcam as avi file, transfer each bit of that file to the other end, then in other end, extract 24 images / second from the avi to display continously in a picture box.
This approach is ok except that my hard disk get fulled of images in a time of wink and my program get very slow before hanging.3/ Use ffmpeg to stream the live webcam to a rtp-port like this :
ffmpeg -f dshow -i video="Lenovo EasyCamera" -vcodec mpeg2video -pix_fmt yuv422p -f rtp -an rtp://224.1.2.3:8191
I’ve successfully watch the stream in VLC, but VLC(axvlc.dll) refused to be integrated into ancient VB6. And more important, I don’t know how to redirect/reroute the rtp stream to other PC with VB6.
Any one please light me up ? (Any 3rd party component is welcomed)
-
FFMPEG Scene Detection - Trim Blank Background from Video at the Start and End
10 juin 2014, par user3521682Summary :
Need to programatically trim video when scene is not changing at the beginning & end.Example video : http://www.filehosting.co.nz/finished3.mp4
(Quality is much higher in the real video)Background :
Large number of videos for online store, each video begins with a blank background, then the model walks on (at a random time, few seconds), and then walks off after a random time (around 15 seconds). The end of the video is trimmed seemingly random ; could be up to 15 seconds of ’nothing’ at the end of the video.
The camera does not move. There is no sound on the videos.
The videos come from a camera in MOV format, sideways.I already have FFMPEG converting from MOV to MP4, rotating the video, adding an audio-track, and trimming the audio at the end of the video.
Research :
I understand that I should probably re-encode video with a very high (?) tolerance for i-frames (so that only two are made per video) and then export the times to a text file, and use the text file to cut the video (probably parse it in BASH and use that to build the FFMPEG commands).Does anyone have any idea how I could generate just two key-frames per video ?
Example video : http://www.filehosting.co.nz/finished3.mp4
(Quality is much higher in the real video) -
Why does a command in my Bash-script return 0 even when it fails ? Python, Whisper, ffmpeg
10 juin 2024, par d-bI have a
bash
script that executeswhisper
on all sound files in a directory. Whisper usesffmpeg
to decode sound files to a format it can handle. One of the files in the directory was corrupt and caused ffmpeg to fail. The first time I executed my script it returned1
when it hit that file but when I try to reproduce the error it always returns0
.

Here is the log from the first run when 1 was returned :


Traceback (most recent call last):
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 48, in load_audio
 .run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/ffmpeg/_run.py", line 325, in run
 raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 File "/Users/db/Library/Python/3.11/bin/whisper", line 8, in <module>
 sys.exit(cli())
 ^^^^^
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 437, in cli
 result = transcribe(model, audio_path, temperature=temperature, **args)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 121, in transcribe
 mel = log_mel_spectrogram(audio, padding=N_SAMPLES)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 130, in log_mel_spectrogram
 audio = load_audio(audio)
 ^^^^^^^^^^^^^^^^^
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 51, in load_audio
 raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e
RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers
 built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
 configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
/soundfile1.opus: Invalid data found when processing input


exit: 1 //this is my own output
</module>


and here is an example of when it returns 0 despite the input file is corrupt :


% whisper soundfile1.opus

Traceback (most recent call last):
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 58, in load_audio
 out = run(cmd, capture_output=True, check=True).stdout
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
 raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ffmpeg', '-nostdin', '-threads', '0', '-i', 'soundfile1.opus', '-f', 's16le', '-ac', '1', '-acodec', 'pcm_s16le', '-ar', '16000', '-']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 597, in cli
 result = transcribe(model, audio_path, temperature=temperature, **args)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 133, in transcribe
 mel = log_mel_spectrogram(audio, model.dims.n_mels, padding=N_SAMPLES)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 140, in log_mel_spectrogram
 audio = load_audio(audio)
 ^^^^^^^^^^^^^^^^^
 File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 60, in load_audio
 raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e
RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers
 built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
 configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
soundfile1.opus: Invalid data found when processing input

Skipping soundfile1.opus due to RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers
 built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
 configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
soundfile1.opus: Invalid data found when processing input

% echo $?
0



When I try to reproduce the behaviour I have both tried to execute the script as well as just running the actual line of code from the command prompt. The actual script looks like this :


if whisper "$file" >> "${directory}/../${transdir}/${name}.txt"; then
 whispersuccess=$?
 echo "exit code $whispersuccess"
else
 whispersuccess=$?
 echo "exit code: $whispersuccess"



I want it to return ¬0 when something like this happens. How do I achieve this ?