
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (74)
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)
Sur d’autres sites (5519)
-
python subprocess ffmpeg return code = 69
13 juin 2023, par Tim ChenI try to call ffmpeg through the
subprocess.run(['ffmpeg', '-i', file_name, output_file_name], capture_output=True, text=True)
command in python to convert the audio file incoming from the front end to wav format file. The backend code is as follows, using python+fastapi :

@app.post("/api/upload/convert")
async def convert_upload_file(request: Request, file: UploadFile = File(...)):
 token = uuid.uuid4().hex
 tmpFileName = os.path.join(os.path.dirname(__file__), token)
 with open(tmpFileName, "wb") as buffer:
 buffer.write(await file.read())
 await file.seek(0)
 output_path = tmpFileName + '-output.wav'
 command = ['ffmpeg', '-i', tmpFileName, output_path]
 result = subprocess.run(command, capture_output=True, text=True)



This code usually works, but there are some scenarios where it doesn't work. The audio file is recorded by js code (specifically
navigator.mediaDevices.getUserMedia({audio: true})
).
The code of the audio recorded in windows chrome can run normally and get the converted wav file, but the audio recorded from ios15 safari for more than 3 seconds cannot be converted, promptingreturncode=69
. The error message is as follows :

CompletedProcess(args=['ffmpeg', '-i', '5cfb52c503a646bda0f422b517c8014a', '5cfb52c503a646bda0f422b517c8014a-output.wav'], returncode=69, stdout='', stderr="
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
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
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '5cfb52c503a646bda0f422b517c8014a':
 Metadata:
 major_brand : iso5
 minor_version : 1
 compatible_brands: isomiso5hlsf
 creation_time : 2023-06-11T16:36:53.000000Z
 Duration: 00:00:07.06, start: 0.000000, bitrate: 187 kb/s
 Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 184 kb/s (default)
 Metadata:
 creation_time : 2023-06-11T16:36:53.000000Z
 handler_name : Core Media Audio
 vendor_id : [0][0][0][0]
Stream mapping:
 Stream #0:0 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to '5cfb52c503a646bda0f422b517c8014a-output.wav':
 Metadata:
 major_brand : iso5
 minor_version : 1
 compatible_brands: isomiso5hlsf
 ISFT : Lavf58.76.100
 Stream #0:0(und): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s16, 768 kb/s (default)
 Metadata:
 creation_time : 2023-06-11T16:36:53.000000Z
 handler_name : Core Media Audio
 vendor_id : [0][0][0][0]
 encoder : Lavc58.134.100 pcm_s16le
size= 2kB time=00:00:00.00 bitrate=N/A speed=N/A 
[aac @ 0x55f1f8f19fc0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x55f1f8f19fc0] Too large remapped id is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x55f1f8f19fc0] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
[aac @ 0x55f1f8f19fc0] Multiple frames in a packet.
[aac @ 0x55f1f8f19fc0] Reserved bit set.
[aac @ 0x55f1f8f19fc0] Number of bands (18) exceeds limit (13).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x55f1f8f19fc0] Reserved bit set.
[aac @ 0x55f1f8f19fc0] Prediction is not allowed in AAC-LC.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x55f1f8f19fc0] Reserved bit set.



For the abnormal code, I tried to execute
ffmpeg -i input output.wav
after fastapi handle request on the command line andsubprocess.run(['ffmpeg', '-i', file_name, output_path], capture_output =True, text=True)
, all succeeded, which means that the final file must be normal, otherwise the subsequent verification work will get the same error.

This confuses me, is there some information I'm missing ?


-
xdotool to tab to a button on a web page and use the mouse to disable a drop down menu option
25 juin 2023, par MashI have a Bash script that open a Amazon chime meeting URL in firefox, uses XDOtool to enter a meetig participant name, and tab and mouse click functions. and next uses ffmpeg to stream the video and audio output of the Amazon chime meeting to an RTMP destination.


When this is streamed, the Amazon chime web app has "More" drop down Menu. Within the Menu it has a option to disable the self view. I want to add xdotool commands to disable this self view option from the more drop down menu on the amazon chime web app page.


the Amazon chime meeting URL is - https://app.chime.aws/meetings/


Here is the Bash Script


#!/bin/bash
BROWSER_URL=${MEETING_URL}
SCREEN_WIDTH=1920
SCREEN_HEIGHT=1080
SCREEN_RESOLUTION=${SCREEN_WIDTH}x${SCREEN_HEIGHT}
CAPTURE_SCREEN_RESOLUTION=1920x1080
COLOR_DEPTH=24
X_SERVER_NUM=2
VIDEO_BITRATE=6000
VIDEO_FRAMERATE=30
VIDEO_GOP=$((VIDEO_FRAMERATE * 2))
AUDIO_BITRATE=160k
AUDIO_SAMPLERATE=44100
AUDIO_CHANNELS=2

# Start PulseAudio server so Firefox will have somewhere to which to send audio
pulseaudio -D --exit-idle-time=-1
pacmd load-module module-virtual-sink sink_name=v1 # Load a virtual sink as `v1`
pacmd set-default-sink v1 # Set the `v1` as the default sink device
pacmd set-default-source v1.monitor # Set the monitor of the v1 sink to be the default source

# Start X11 virtual framebuffer so Firefox will have somewhere to draw
Xvfb :${X_SERVER_NUM} -ac -screen 0 ${SCREEN_RESOLUTION}x${COLOR_DEPTH} > /dev/null 2>&1 &
export DISPLAY=:${X_SERVER_NUM}.0
sleep 0.5 # Ensure this has started before moving on

# Create a new Firefox profile for capturing preferences for this
firefox --no-remote --new-instance --createprofile "foo4 /tmp/foo4"

# Install the OpenH264 plugin for Firefox
mkdir -p /tmp/foo4/gmp-gmpopenh264/1.8.1.1/
pushd /tmp/foo4/gmp-gmpopenh264/1.8.1.1 >& /dev/null
curl -s -O http://ciscobinary.openh264.org/openh264-linux64-2e1774ab6dc6c43debb0b5b628bdf122a391d521.zip
unzip openh264-linux64-2e1774ab6dc6c43debb0b5b628bdf122a391d521.zip
rm -f openh264-linux64-2e1774ab6dc6c43debb0b5b628bdf122a391d521.zip
popd >& /dev/null

# Set the Firefox preferences to enable automatic media playing with no user
# interaction and the use of the OpenH264 plugin.
cat <<eof>> /tmp/foo4/prefs.js
user_pref("media.autoplay.default", 0);
user_pref("media.autoplay.enabled.user-gestures-needed", false);
user_pref("media.navigator.permission.disabled", true);
user_pref("media.gmp-gmpopenh264.abi", "x86_64-gcc3");
user_pref("media.gmp-gmpopenh264.lastUpdate", 1571534329);
user_pref("media.gmp-gmpopenh264.version", "1.8.1.1");
user_pref("doh-rollout.doorhanger-shown", true);
EOF

# Start Firefox browser and point it at the URL we want to capture
#
# NB: The `--width` and `--height` arguments have to be very early in the
# argument list or else only a white screen will result in the capture for some
# reason.
firefox \
 -P foo4 \
 --width ${SCREEN_WIDTH} \
 --height ${SCREEN_HEIGHT} \
 --new-instance \
 --first-startup \
 --foreground \
 --kiosk \
 --ssb \
 "${BROWSER_URL}" \
 &
sleep 10 # Ensure this has started before moving on, waiting for loading the Chime web app
xdotool key Return #Select yes for the pop-up window of "Would you like to open this link with Chime app?"
sleep 3
xdotool key Escape #Close the pop-up window
sleep 3
xdotool type Livestream #Type "Livestream" on the name input field
sleep 3
xdotool key Tab #Move to "join the meeting" button
sleep 3
xdotool key Return #Click "join the meeting" button
sleep 3
xdotool key Return #Close the pop-up window once again
sleep 3
xdotool key Escape #Close the pop-up window once again
sleep 3
xdotool key Return #Click "Use system audio" setting
sleep 3
xdotool key Escape #Close warning message
sleep 3
xdotool mousemove 1 1 click 1 # Move mouse out of the way so it doesn't trigger the "pause" overlay on the video tile 

# Start ffmpeg to transcode the capture from the X11 framebuffer and the
# PulseAudio virtual sound device we created earlier and send that to the RTMP
# endpoint in H.264/AAC format using a FLV container format.
#
# NB: These arguments have a very specific order. Seemingly inocuous changes in
# argument order can have pretty drastic effects, so be careful when
# adding/removing/reordering arguments here.
ffmpeg \
 -hide_banner -loglevel error \
 -nostdin \
 -s ${CAPTURE_SCREEN_RESOLUTION} \
 -r ${VIDEO_FRAMERATE} \
 -draw_mouse 0 \
 -f x11grab \
 -i ${DISPLAY} \
 -f pulse \
 -ac 2 \
 -i default \
 -vf "crop=1600:980:0:1080" \
 -c:v libx264 \
 -pix_fmt yuv420p \
 -profile:v main \
 -preset slow \
 -x264opts "nal-hrd=cbr:no-scenecut" \
 -minrate ${VIDEO_BITRATE} \
 -maxrate ${VIDEO_BITRATE} \
 -g ${VIDEO_GOP} \
 -filter_complex "aresample=async=1000:min_hard_comp=0.100000:first_pts=1" \
 -async 1 \
 -c:a aac \
 -b:a ${AUDIO_BITRATE} \
 -ac ${AUDIO_CHANNELS} \
 -ar ${AUDIO_SAMPLERATE} \
 -f flv ${RTMP_URL}``

</eof>


what i have tried so far in in the bash script


-
FFmpeg / libmp3lame crash while converting from .wav to .mp3 with vibrato
1er juillet 2020, par ChitrangI have integrated mobile-ffmpeg-full-gpl:4.3.1.LTS library in my android app. And trying to convert .wav file to .mp3 format with vibrato option and libmp3lame encoder.


ffmpegCommand = "-i input.wav " +
 "-af vibrato=f=4 " +
 "-c:a libmp3lame " +
 "-b:a 96k " +
 "-ac 1 " +
 "-ar 44100 " +
 "-y output.mp3"



FFmpeg Logs :


a.b.com I/mobile-ffmpeg: Loading mobile-ffmpeg.
a.b.com I/mobile-ffmpeg: Loaded mobile-ffmpeg-full-gpl-arm64-v8a-4.3.1-lts-20200125.
a.b.com D/mobile-ffmpeg: Callback thread started.
a.b.com I/mobile-ffmpeg: ffmpeg version git-2020-01-25-fd11dd500
a.b.com I/mobile-ffmpeg: Copyright (c) 2000-2020 the FFmpeg developers
a.b.com I/mobile-ffmpeg: built with Android (5220042 based on r346389c) clang version 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf643d27dbca1bb228957008617) (https://android.googlesource.com/toolchain/llvm 3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn)
a.b.com I/mobile-ffmpeg: configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android21-clang --cxx=aarch64-linux-android21-clang++ --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disa
a.b.com I/mobile-ffmpeg: libavutil 56. 38.100 / 56. 38.100
a.b.com I/mobile-ffmpeg: libavcodec 58. 65.102 / 58. 65.102
a.b.com I/mobile-ffmpeg: libavformat 58. 35.101 / 58. 35.101
a.b.com I/mobile-ffmpeg: libavdevice 58. 9.103 / 58. 9.103
a.b.com I/mobile-ffmpeg: libavfilter 7. 70.101 / 7. 70.101
a.b.com I/mobile-ffmpeg: libswscale 5. 6.100 / 5. 6.100
a.b.com I/mobile-ffmpeg: libswresample 3. 6.100 / 3. 6.100
a.b.com W/mobile-ffmpeg: [wav @ 0x7294a86600] Estimating duration from bitrate, this may be inaccurate
a.b.com W/mobile-ffmpeg: Guessed Channel Layout for Input Stream #0.0 : mono
a.b.com I/mobile-ffmpeg: Input #0, wav, from '/data/user/0/a.b.com/cache/creation/input.wav':
a.b.com I/mobile-ffmpeg: Duration: 
a.b.com I/mobile-ffmpeg: 00:00:07.15
a.b.com I/mobile-ffmpeg: , bitrate: 
a.b.com I/mobile-ffmpeg: 705 kb/s
a.b.com I/mobile-ffmpeg: Stream #0:0
a.b.com I/mobile-ffmpeg: : Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
a.b.com I/mobile-ffmpeg: Stream mapping:
a.b.com I/mobile-ffmpeg: Stream #0:0 -> #0:0
a.b.com I/mobile-ffmpeg: (pcm_s16le (native) -> mp3 (libmp3lame))
a.b.com I/mobile-ffmpeg: Press [q] to stop, [?] for help
a.b.com I/mobile-ffmpeg: Output #0, mp3, to '/data/user/0/a.b.com/cache/creation/output.mp3':
a.b.com I/mobile-ffmpeg: Metadata:
a.b.com I/mobile-ffmpeg: TSSE : 
a.b.com I/mobile-ffmpeg: Lavf58.35.101
a.b.com I/mobile-ffmpeg: Stream #0:0
a.b.com I/mobile-ffmpeg: : Audio: mp3 (libmp3lame), 44100 Hz, mono, fltp, 96 kb/s
a.b.com I/mobile-ffmpeg: Metadata:
a.b.com I/mobile-ffmpeg: encoder : 
a.b.com I/mobile-ffmpeg: Lavc58.65.102 libmp3lame
a.b.com I/mobile-ffmpeg: --------- beginning of crash
a.b.com A/libc: psymodel.c:576: void calc_energy(const PsyConst_CB2SB_t *, const FLOAT *, FLOAT *, FLOAT *, FLOAT *): assertion "el >= 0" failed
a.b.com A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 25800 (a.b.com), pid 25800 (a.b.com)



Crash :


--------- beginning of crash
 A/libc: psymodel.c:576: void calc_energy(const PsyConst_CB2SB_t *, const FLOAT *, FLOAT *, FLOAT *, FLOAT *): assertion "el >= 0" failed

? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
? A/DEBUG: Build fingerprint: 'samsung/star2qltecs/star2qltecs:10/QP1A.190711.020/G965WVLS7DTE1:user/release-keys'
? A/DEBUG: Revision: '14'
? A/DEBUG: ABI: 'arm64'
? A/DEBUG: Timestamp: 2020-06-29 15:13:17-0400
? A/DEBUG: pid: 1849, tid: 1849, name: a.b.com  >>> a.b.com <<<
? A/DEBUG: uid: 12171
? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
? A/DEBUG: Abort message: 'psymodel.c:576: void calc_energy(const PsyConst_CB2SB_t *, const FLOAT *, FLOAT *, FLOAT *, FLOAT *): assertion "el >= 0" failed'
? A/DEBUG:     x0  0000000000000000  x1  0000000000000739  x2  0000000000000006  x3  0000007fd65f7bb0
? A/DEBUG:     x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  0000000000000008
? A/DEBUG:     x8  00000000000000f0  x9  7f96d7a39856d151  x10 0000000000000001  x11 0000000000000000
? A/DEBUG:     x12 fffffff0fffffbdf  x13 000000005efa3d4c  x14 001c23c1a79207f5  x15 000079d970d48db2
? A/DEBUG:     x16 00000073e009e8c0  x17 00000073e007afe0  x18 00000073e492c000  x19 0000000000000739
? A/DEBUG:     x20 0000000000000739  x21 00000000ffffffff  x22 0000007fd65fc44c  x23 0000007fd65f8640
? A/DEBUG:     x24 0000007fd65fd120  x25 0000007fd65fd3a8  x26 0000007fd65f8240  x27 0000007fd65f9e40
? A/DEBUG:     x28 00000071f9f60900  x29 0000007fd65f7c50
? A/DEBUG:     sp  0000007fd65f7b90  lr  00000073e002c27c  pc  00000073e002c2a8
? A/DEBUG: backtrace:
? A/DEBUG:       #00 pc 00000000000832a8  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: 55ce0a7d78144b0290f9746ed1615719)
? A/DEBUG:       #01 pc 00000000000839e8  /apex/com.android.runtime/lib64/bionic/libc.so (__assert2+36) (BuildId: 55ce0a7d78144b0290f9746ed1615719)
? A/DEBUG:       #02 pc 0000000000969c60  /data/app/a.b.com-jXqE8oxytEkfSsn6pcdloQ==/lib/arm64/libavcodec.so



I referred link1, link2 to understand the problem but could not find a solution.