
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (96)
-
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 (4996)
-
Python : FFmpeg Input/output error using discord.py
29 mai 2023, par PeeblYweebhere is my code :


async def direct(self, interaction: discord.Interaction, link: str):
 voice_client = get(self.bot.voice_clients, guild=interaction.guild)
 if voice_client is None:
 return await interaction.response.send_message("❌ Connect to a channel first.")

 await interaction.response.send_message("Using direct link.")
 voice_client.play(discord.FFmpegPCMAudio(link))
 return



here is my error :


[tls @ 0x557c73a19d00] Error in the pull function.
https://cdn.discordapp.com/attachments/1109998398150545410/1112473248505004142/portradio-_1_.ogg: Input/output error
2023-05-28 13:29:11 INFO discord.player ffmpeg process 1458408 successfully terminated with return code of 0.



this happens usually around half-way through whatever im playing consistently


i've tried setting arguments like :


ffmpeg_options = {'options': '-vn -dn -sn -ignore_unknown -fflags +discardcorrupt'}



from this other post
’corrupt input packet in stream 1’ error in FFMPEG
which fixed the error corrupt input packet but im still having trouble any ideas ?


goal is to get the audio playing to discord without having to store the file locally then playing it from there then discarding it after.


-
FFMPEG : How should I deal with constant corrupt packets incoming from a remote stream ? [closed]
2 mai 2023, par 2x2I'll get downvoted madly fast ; I am new here, and, honestly, I'm weak at FFMPEG.


I am working to "record" a test HLS broadcast (colored bars) into a local mp4 file.


Trying to normally record it into the file, using a simple command, yields this result. It works fine at the start, due to the corrupt packets slowly accumulating and seemingly seamlessly getting spliced together. After, the recording simply continues, and begins to lag frequently.


I'll summarize the FFMPEG log below :


>! ```
>! 
>! Command input:
>! 
>! > ffmpeg -i http://IP_1:8080/udp/IP_2:1234 -c copy OUT/test1.mp4
>! 
>! ...
>! 
>! Initialization:
>! 
>! ffmpeg version 2023-04-26-git-e3143703e9-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
>! built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
>! configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
>! libavutil 58. 6.100 / 58. 6.100
>! libavcodec 60. 10.100 / 60. 10.100
>! libavformat 60. 5.100 / 60. 5.100
>! libavdevice 60. 2.100 / 60. 2.100
>! libavfilter 9. 5.100 / 9. 5.100
>! libswscale 7. 2.100 / 7. 2.100
>! libswresample 4. 11.100 / 4. 11.100
>! libpostproc 57. 2.100 / 57. 2.100
>! 
>! ...
>! 
>! Problems begin:
>! 
>! [mpeg2video @ 000001e3f88a60c0] Invalid frame dimensions 0x0.
>! Last message repeated 4 times
>! 
>! ...
>! 
>! Repetitive two errors - Packet errors:
>! 
>! [mpegts @ 000001e3f888b300] PES packet size mismatch
>! [mpegts @ 000001e3f888b300] Packet corrupt (stream = 0, dts = 4813344832).
>! 
>! ...
>! 
>! Information:
>! 
>! Input #0, mpegts, from 'http://IP_1:8080/udp/IP_2:1234':
>! Duration: N/A, start: 53478.855478, bitrate: 3428 kb/s
>! Program 10
>! Metadata:
>! service_name : SERVICE
>! service_provider: unknown
>! Stream #0:0[0x65]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 16:15 DAR 4:3], 3300 kb/s, 25 fps, 25 tbr, 90k tbn
>! Side data:
>! cpb: bitrate max/min/avg: 3300000/0/0 buffer size: 1638400 vbv_delay: N/A
>! Stream #0:1[0x66](rus): Audio: mp2 ([3][0][0][0] / 0x0003), 44100 Hz, mono, fltp, 128 kb/s
>! Output #0, mp4, to 'OUT/test1.mp4':
>! Metadata:
>! encoder : Lavf60.5.100
>! Stream #0:0: Video: mpeg2video (Main) (mp4v / 0x7634706D), yuv420p(tv, top first), 720x576 [SAR 16:15 DAR 4:3], q=2-31, 3300 kb/s, 25 fps, 25 tbr, 90k tbn
>! Side data:
>! cpb: bitrate max/min/avg: 3300000/0/0 buffer size: 1638400 vbv_delay: N/A
>! Stream #0:1(rus): Audio: mp2 (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 128 kb/s
>! Stream mapping:
>! Stream #0:0 -> #0:0 (copy)
>! Stream #0:1 -> #0:1 (copy)
>! Press [q] to stop, [?] for help
>! 
>! ```



I will also attach a video demonstration of the occurrence :


https://drive.google.com/file/d/13ndIpH3de3k8f3TMVGEbJUNVe-vD0vIW/view?usp=sharing


Download it ; the processed web version doesn't include any of the visual glitches that are visible in the original file.


I have been wanting to run FFMPEG with a minute-long delay (i.e. intentionally increasing the latency). Unfortunately, FFMPEG only has features to lower latency, not add more (I read the entire documentation trying to figure this out).


Another of my ideas was to try FFPLAY (afaik it's FFMPEG but with output to a window). Didn't work, got the same errors.


None of the other parameters listed in the documentation seemed to have any use to help me out ; I tried a bunch, to no avail.


What will you suggest ? I would like to hear some ideas on how I could fix this.


-
ffmpeg doesn't work when the script is launched by cron - No protocol specified, Cannot open display :0.0
14 janvier 2024, par a kffmpeg in my script doesn't work when the script is launched by cron of the root


Error : No protocol specified, Cannot open display :0.0


OS : Ubuntu 20.04


#!/bin/bash
log=/var/log/log2/log2.txt

echo ______________ $(date) >> "$log"
echo "$""DISPLAY" "= " "$DISPLAY" >> "$log" ;
echo whoami ' ' $(whoami) >> "$log" 
echo pwd ' ' $(pwd) >> "$log" 
echo "$""USER" "=" ' ' "$USER" >> "$log"
echo PATH ' ' "$PATH" >> "$log"
echo which ffmpeg ' ' $(which ffmpeg)>> "$log" 
echo whereis ffmpeg ' ' $(whereis ffmpeg) >> "$log" 
echo "\nls -l /bin/* | grep ffmpeg" ' ' >> "$log"
ls -l /usr/bin/* | grep ffmpeg >> "$log"
echo "ls -l /var/log | grep log2" ' '>> "$log"
ls -l /var/log | grep log2 >> "$log"

ffmpeg -y -f x11grab -s 1366x768 -i :0.0 -r 25 /var/log/log2/test.mp4 -loglevel error 2>>"$log" &

echo "pid ffmpeg ""$""!"" = " "$!" >> "$log" 
sleep 5
kill "$!"
echo exit >> "$log"
exit



When Cron (Cron of the root) launches the script, ffmpeg shows the error "No protocol specified, Cannot open display :0.0"


/var/log/log2/log2.txt :


______________ ven. 05 mai 2023 04:10:01 CEST
$DISPLAY = 
whoami root
pwd /root
$USER = 
PATH /usr/bin:/bin
which ffmpeg /usr/bin/ffmpeg
whereis ffmpeg ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
ls -l /usr/bin/* | grep ffmpeg 
-rwxr-xr-x 1 root root 284976 mai 18 2022 /usr/bin/ffmpeg
ls -l /var/log | grep log2 
drwxrwxrwx 2 root root 4096 mai 5 04:09 log2
pid ffmpeg $! = 74590
No protocol specified
[x11grab @ 0x56244aa06740] Cannot open display :0.0, error 1.
:0.0: Input/output error
exit



When I launch the script manually as a not-root user (with sudo), everything work correctly :


______________ ven. 05 mai 2023 04:10:47 CEST
$DISPLAY = :0
whoami root
pwd /home/an
$USER = root
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
which ffmpeg /usr/bin/ffmpeg
whereis ffmpeg ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
ls -l /usr/bin/* | grep ffmpeg 
-rwxr-xr-x 1 root root 284976 mai 18 2022 /usr/bin/ffmpeg
ls -l /var/log | grep log2 
drwxrwxrwx 2 root root 4096 mai 5 04:09 log2
pid ffmpeg $! = 74618
exit



When I launch the script manually as the root, everything works correctly :


______________ ven. 05 mai 2023 04:11:27 CEST
$DISPLAY = :0
whoami root
pwd /root
$USER = root
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
which ffmpeg /usr/bin/ffmpeg
whereis ffmpeg ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
ls -l /usr/bin/* | grep ffmpeg 
-rwxr-xr-x 1 root root 284976 mai 18 2022 /usr/bin/ffmpeg
ls -l /var/log | grep log2 
drwxrwxrwx 2 root root 4096 mai 5 04:11 log2
pid ffmpeg $! = 74683
exit



When crontab of an ordinary user launches the script, it works correctly :


$DISPLAY = 
whoami an
pwd /home/an
$USER = 
PATH /usr/bin:/bin
which ffmpeg /usr/bin/ffmpeg
whereis ffmpeg ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
ls -l /usr/bin/* | grep ffmpeg 
-rwxr-xr-x 1 root root 284976 mai 18 2022 /usr/bin/ffmpeg
ls -l /var/log | grep log2 
drwxrwxrwx 2 root root 4096 mai 5 05:05 log2
pid ffmpeg $! = 77601
exit



I have tried to put into the script :


export DISPLAY=":0"


export DISPLAY=":0.0"


export DISPLAY=":1"