
Recherche avancée
Autres articles (67)
-
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 (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)
Sur d’autres sites (7171)
-
How to resolve "runOnReady command exited with code 0" when restreaming a stream using Mediamtx ?
2 juillet 2023, par Emad HelmiI'm attempting to publish a stream to the RTMP port
1935
using affmpeg
command with Mediamtx (v0.22.2). Afterward, I want to restream the mainstream to another path using therunOnReady
command in the config file. However, I'm encountering an issue wherethe runOnReady command exits with code 0.


Steps to Replicate :


- 

- Use the provided docker-compose.yml file :




version: "3.8"

name: mediamtx
services:
 mediamtx:
 image: aler9/rtsp-simple-server:v0.22.2
 container_name: media_mtx_rtsp_server
 ports:
 - "8554:8554"
 - "1935:1935"
 - "8888:8888"
 - "8889:8889"
 - "9997:9997"
 - "8000:8000"
 volumes:
 - ./configs/mediamtx/config.yml:/mediamtx.yml
 - ../volumes/hls/segments:/hls/segments



- 

- Add the following path to the
config.yml
file :




paths:
 show/test:
 runOnReady: ffmpeg -i rtmp://localhost:1935/show/test -c copy -f flv "rtmp://localhost:1935/compressed/test"
 runOnReadyRestart: yes



- 

- Start the server using docker-compose.
- Publish an
RTMP
stream to the server using the following command :






ffmpeg -re -stream_loop -1 -i files/sample-30s.mp4 -c copy -f flv "rtmp://localhost:1935/show/test"



- 

- When I check the logs :




2023/07/01 15:16:30 INF [RTMP] [conn 172.26.0.1:51044] opened
2023/07/01 15:16:30 INF [path show/test] runOnReady command started
2023/07/01 15:16:30 INF [RTMP] [conn 172.26.0.1:51044] is publishing to path 'show/test', 2 tracks (H264, MPEG4-audio-gen)
2023/07/01 15:16:30 INF [path show/test] runOnReady command exited with code 0



So I can't watch the stream on the new path (/compressed/test)


-
problem in making HLS using ffmpeg problem
24 juin 2023, par AMZI have a function do run in background and create m3u8 for some videos : (I is running in background and updating some fields in django).


def convert_to_hls(episode):
 # Set the output directory for HLS files
output_dir = os.path.join(settings.MEDIA_ROOT, 'hls')
os.makedirs(output_dir, exist_ok=True)

# Set the input video file path
input_file_path = episode.videoFile.path

# Set the output filename and path for the HLS playlist
# filename = os.path.splitext(os.path.basename(input_file_path))[0]
characters = string.ascii_letters + string.digits
filename = ''.join(random.choice(characters) for _ in range(45))
playlist_path = os.path.join(output_dir, f'{filename}.m3u8')

# Set the output path for the HLS segments
segments_path = os.path.join(output_dir, f'{filename}_%05d.ts')

# Construct the ffmpeg command for HLS conversion
command = [
 'ffmpeg',
 '-i', input_file_path,
 '-c:v', 'libx264',
 '-crf', '23',
 '-preset', 'medium',
 '-c:a', 'aac',
 '-b:a', '128k',
 '-f', 'hls',
 '-hls_time', '10',
 '-hls_list_size', '0',
 '-hls_segment_filename', segments_path,
 playlist_path
]
# Execute the ffmpeg command
subprocess.run(command, check=True)

episode.hls_created = True
episode.hls_url = playlist_path.replace("/home/debian/project","")
episode.save()

return True



this code works well for most of my videos but for some .mp4 files gets :


[Fri Jun 23 17:05:47.511095 2023] [wsgi:error] [pid 19975:tid 140289048565504] Exception in thread Thread-1:
[Fri Jun 23 17:05:47.511198 2023] [wsgi:error] [pid 19975:tid 140289048565504] Traceback (most recent call last):
[Fri Jun 23 17:05:47.511244 2023] [wsgi:error] [pid 19975:tid 140289048565504] File "/opt/bitnami/python/lib/python3.8/threading.py", line 932, in _bootstrap_inner
[Fri Jun 23 17:05:47.512078 2023] [wsgi:error] [pid 19975:tid 140289048565504] self.run()
[Fri Jun 23 17:05:47.512124 2023] [wsgi:error] [pid 19975:tid 140289048565504] File "/opt/bitnami/python/lib/python3.8/threading.py", line 870, in run
[Fri Jun 23 17:05:47.512707 2023] [wsgi:error] [pid 19975:tid 140289048565504] self._target(*self._args, **self._kwargs)
[Fri Jun 23 17:05:47.512748 2023] [wsgi:error] [pid 19975:tid 140289048565504] File "/home/debian/project/twapp/views/episode_backgrounds.py", line 41, in convert_to_hls
[Fri Jun 23 17:05:47.512950 2023] [wsgi:error] [pid 19975:tid 140289048565504] subprocess.run(command, check=True)
[Fri Jun 23 17:05:47.512989 2023] [wsgi:error] [pid 19975:tid 140289048565504] File "/opt/bitnami/python/lib/python3.8/subprocess.py", line 516, in run
[Fri Jun 23 17:05:47.513500 2023] [wsgi:error] [pid 19975:tid 140289048565504] raise CalledProcessError(retcode, process.args,
[Fri Jun 23 17:05:47.513657 2023] [wsgi:error] [pid 19975:tid 140289048565504] subprocess.CalledProcessError: Command '['ffmpeg', '-i', '/home/debian/project/media/videos/introduction_to_raster_qBhrnAx.mp4', '-c:v', 'libx264', '-crf', '23', '-preset', 'medium', '-c:a', 'aac', '-b:a', '128k', '-f', 'hls', '-hls_time', '10', '-hls_list_size', '0', '-hls_segment_filename', '/home/debian/project/media/hls/ZN3fsJVEfTDEc8MFb5DrP7Y34JFNLj0hfWnGRZAwFdjuG_%05d.ts', '/home/debian/project/media/hls/ZN3fsJVEfTDEc8MFb5DrP7Y34JFNLj0hfWnGRZAwFdjuG.m3u8']' returned non-zero exit status 1.



Also it does not work for .MOV files.


-
FFmpeg : h264 output broken
22 juin 2023, par puaaaalWhen I try to encode anything (no
-c copy
) using the h264 codec, the output is broken in the sense that it can't be played by any standard player (like Windows Media Player). VLC works mostly fine, but also here I had problems, that the video did not align properly. When I use ffplay though, it works fine. When I try to play my source material, which is also encoded with h264, all those methods to play it work fine. (I use mp4 as a container for all these tests)

Command to reproduce :


ffmpeg -f lavfi -i "testsrc=d=10" -vcodec h264 test_h264.mp4



When I use mpeg4 instead, it works fine :


ffmpeg -f lavfi -i "testsrc=d=10" -vcodec mpeg4 test_mpeg4.mp4



Is there something I am missing here, or might this be a bug ?


ffmpeg -version
:

ffmpeg version n6.0-22-g549430e14d-20230607 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13.1.0 (crosstool-NG 1.25.0.196_227d99d)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --disable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20230607
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100