
Recherche avancée
Autres articles (89)
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)
Sur d’autres sites (7186)
-
ffmpeg conversion from h264 for webserver
11 juin 2021, par XavI'm working on a system to record videos through RPi (picamera, h264 format), export (rsync) 10s segments of videos to a distant webserver, and trying to concatenate those segment into a single video file to read on the webserver.


Simplified code to record on RPi :


import os
import datetime as dt
import picamera

camera = picamera.PiCamera()
camera.resolution = (1920, 1080)
camera.framerate = 25
duration = 10 #sec

[...]

camera.start_recording(filename, format='h264')
while True:
 filename = get_timestamped_filename()
 camera.split_recording(filename)
 camera.wait_recording(duration)

camera.stop_recording()



For the conversion, I tried many options/searches without success. I can get the video (.ts, .mp4, .ogv, .webm) working on majority of web browser but never on ios/android (chrome/safari).
As example of test & fail with ffmpeg : https://gist.github.com/jaydenseric/220c785d6289bcfd7366


When I don't try to concatenate but only convert those video :


ffmpeg -i input.h264 -profile:v baseline -level 3.0 output.mp4



I have the following output :


ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 8 (Debian 8.3.0-6)
 configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --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-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 libavutil 56. 22.100 / 56. 22.100
 libavcodec 58. 35.100 / 58. 35.100
 libavformat 58. 20.100 / 58. 20.100
 libavdevice 58. 5.100 / 58. 5.100
 libavfilter 7. 40.101 / 7. 40.101
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 3.100 / 5. 3.100
 libswresample 3. 3.100 / 3. 3.100
 libpostproc 55. 3.100 / 55. 3.100
Input #0, h264, from 'input.h264':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x480, 25 fps, 25 tbr, 1200k tbn, 50 tbc
File 'output.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x556885757980] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x556885757980] profile Constrained Baseline, level 3.0
[libx264 @ 0x556885757980] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=9 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
 Metadata:
 encoder : Lavf58.20.100
 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 720x480, q=-1--1, 25 fps, 12800 tbn, 25 tbc
 Metadata:
 encoder : Lavc58.35.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 195 fps=0.0 q=-1.0 Lsize= 229kB time=00:00:07.76 bitrate= 241.3kbits/s speed=20.4x 
video:227kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.687068%
[libx264 @ 0x556885757980] frame I:1 Avg QP:23.86 size: 24802
[libx264 @ 0x556885757980] frame P:194 Avg QP:22.46 size: 1067
[libx264 @ 0x556885757980] mb I I16..4: 26.4% 0.0% 73.6%
[libx264 @ 0x556885757980] mb P I16..4: 1.1% 0.0% 0.4% P16..4: 20.3% 1.5% 0.6% 0.0% 0.0% skip:76.1%
[libx264 @ 0x556885757980] coded y,uvDC,uvAC intra: 34.9% 54.4% 12.3% inter: 1.8% 12.4% 0.0%
[libx264 @ 0x556885757980] i16 v,h,dc,p: 45% 14% 17% 23%
[libx264 @ 0x556885757980] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 31% 11% 4% 4% 4% 4% 4% 4%
[libx264 @ 0x556885757980] i8c dc,h,v,p: 51% 17% 28% 4%
[libx264 @ 0x556885757980] ref P L0: 80.0% 10.6% 9.4%
[libx264 @ 0x556885757980] kb/s:237.75



But still, impossible to play on mobile web (iOS, Android)


Is there anything I'm doing wrong, either in the capturing process or conversion ?
Do you have any recommendations ?


-
Something wrong with recording video and merging audio and video by using FFmpeg
16 mars 2014, par VaFancyAt the beginning, I have to admit that I am a newbie in FFmpeg and also raspbian. Unfortunately, I need to solve this problem as soon as possible.
I tried to record videos on my Raspberry PI by using PIcamera and USB webcam separately. When I used command :
ffmpeg -t 10 -f video4linux2 -r 25 -i /dev/video0 out.h264
However, something was very wrong because there was nothing saved in that video file. I copy the log.
[video4linux2,v4l2 @ 0x267ad80] The driver changed the time per frame from 1/25 to 1/30
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 37562.908020, bitrate: 147456 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
File 'out.h264' already exists. Overwrite ? [y/N] y
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x267ca60] using cpu capabilities: ARMv6
[libx264 @ 0x267ca60] profile High 4:2:2, level 3.0, 4:2:2 8-bit
Output #0, h264, to 'out.h264':
Metadata:
encoder : Lavf55.34.101
Stream #0:0: Video: h264 (libx264), yuv422p, 640x480, q=-1--1, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo -> libx264)
Press [q] to stop, [?] for help
DTS 140730117085, next:18648459 st:0 invalid dropping00.00 bitrate=N/A
PTS 140730117085, next:18648459 invalid dropping st:0
DTS 140740452429, next:6538221 st:0 invalid dropping:00.00 bitrate=N/A
PTS 140740452429, next:6538221 invalid dropping st:0
frame= 44 fps=1.1 q=28.0 size= 18kB time=00:00:00.04 bitrate=3712.6kbits/
frame= 45 fps=0.8 q=28.0 size= 22kB time=00:00:00.08 bitrate=2262.8kbits/
frame= 46 fps=0.7 q=28.0 size= 27kB time=00:00:00.12 bitrate=1813.4kbits/
frame= 47 fps=0.6 q=28.0 size= 30kB time=00:00:00.16 bitrate=1559.2kbits/
frame= 48 fps=0.5 q=28.0 size= 34kB time=00:00:00.20 bitrate=1397.7kbits/
frame= 49 fps=0.5 q=28.0 size= 39kB time=00:00:00.24 bitrate=1324.3kbits/
frame= 50 fps=0.4 q=28.0 size= 42kB time=00:00:00.28 bitrate=1241.7kbits/As you can see, the size of each frame was only few kb and fps was so low. Thus each frame was taken by using a long time(4s in this case). Then I test my USB webcam by using command :
ffplay -f video4linux2 /dev/video0
The video stream which displayed on the screen was so unnatural. It looked like there was such a long delay between each frame. So the video was hardly moved. The log I have copied :
pi@raspberrypi ~ $ ffplay -f video4linux2 /dev/video0
avplay version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2003-2013 the Libav developers
built on Mar 31 2013 13:58:10 with gcc 4.6.3
[video4linux2 @ 0x1ad83c0] Estimating duration from bitrate, this may be inaccurate
Input #0, video4linux2, from '/dev/video0':
Duration: N/A, start: 36107.154598, bitrate: 147456 kb/s
Stream #0.0: Video: rawvideo, yuyv422, 640x480, 147456 kb/s, 30 tbr, 1000k tbn, 30 tbc
[avsink @ 0x1ad9960] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x1ad9d20] w:640 h:480 fmt:yuyv422 -> w:640 h:480 fmt:yuv420p flags:0x4
36163.33 A-V: 0.000 s:0.0 aq= 0KB vq= 3000KB sq= 0B f=8/8The final problem is that no sound was added in video file when I tried to add some in. I used the command :
avconv -i /home/pi/Desktop/test.mp4 -i /home/pi/Desktop/test.mp3 -map 0:0 -vcodec copy -map 1:0 -acodec copy output.h264
I have checked separately that the video and audio were both able to play. However the merged file only had video but no audio. The log is shown below, it seems that the process was succeed.
pi@raspberrypi ~ $ avconv -i /home/pi/Desktop/test.mp4 -i /home/pi/Desktop/test.mp3 -map 0:0 -vcodec copy -map 1:0 -acodec copy output.h264
avconv version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2000-2013 the Libav developers
built on Mar 31 2013 13:58:10 with gcc 4.6.3
[h264 @ 0x1aa6680] max_analyze_duration reached
[h264 @ 0x1aa6680] Estimating duration from bitrate, this may be inaccurate
Input #0, h264, from '/home/pi/Desktop/test.mp4':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264 (High), yuv420p, 640x480, 25 fps, 25 tbr, 1200k tbn, 2400k tbc
[mp3 @ 0x1aaa120] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from '/home/pi/Desktop/test.mp3':
Metadata:
title : We Are Legend (Original Mix)
artist : Dimitri Vegas & Like Mike & Steve Aoki
album : SPINNIN RECORDS
encoded_by : iTunes 11.1.5
TBP : 128
genre : Progressive House
date : 2013
Duration: 00:00:11.14, start: 0.000000, bitrate: 191 kb/s
Stream #1.0: Audio: mp3, 48000 Hz, stereo, s16, 192 kb/s
File 'output.h264' already exists. Overwrite ? [y/N] y
Output #0, h264, to 'output.h264':
Metadata:
encoder : Lavf53.21.1
Stream #0.0: Video: libx264, yuv420p, 640x480, q=2-31, 90k tbn, 1200k tbc
Stream #0.1: Audio: libmp3lame, 48000 Hz, stereo, 192 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press ctrl-c to stop encoding
frame= 144 fps= 0 q=-1.0 Lsize= 1684kB time=5.06 bitrate=2724.7kbits/s
video:1566kB audio:119kB global headers:0kB muxing overhead 0.000000%Could somebody helps me, please. And sorry for my bad english.
BTW : When I finally captured 200 frames, it turns out all of them were green.
-
MPD doesnt load ffmpeg as decoder
10 août 2022, par dmSheraziI am using openwrt 21.2.3 and mpd on it. I have compile mpd full and libffmpeg full as well as ffmpeg-full packages.
But my mpd wont load ffmpeg as decoder. Also tried to force it by adding
decoder { plugin “ffmpeg” enabled “no” }”
line to /etc/mpd.conf

below is my mpd.conf


log_file "syslog"

bind_to_address "127.0.0.1"
bind_to_address "192.168.1.16"

input {
 plugin "curl"
}

audio_output {
 type "alsa"
 name "sun4icodec"
 device "plug:dmix"
 mixer_control "Power Amplifier"
}

decoder {
 plugin "ffmpeg"
 enabled "yes"
}



the mpd —version output is as follows


Music Player Daemon 0.21.26 (v21.02.3)
Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright 2008-2018 Max Kellermann <max.kellermann@gmail.com>
This is free software; see the source for copying conditions. There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple proxy upnp

Storage plugins:
 local curl


Decoders plugins:
 [mad] mp3 mp2
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [faad] aac
 [pcm]

Filters:


Tag plugins:
 id3tag

Output plugins:
 shout null fifo pipe alsa pulse httpd recorder

Encoder plugins:
 null opus wave flac

Input plugins:
 file alsa curl mms

Playlist plugins:
 extm3u m3u pls xspf asx rss soundcloud flac cue embcue

Protocols:
 file:// alsa:// http:// https:// mms:// mmsh:// mmst:// mmsu://

Other features:
 epoll iconv inotify ipv6 tcp un



ideally it should have something like this



Decoders plugins:
 [dsdiff] dff
 [dsf] dsf
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
 [pcm]

Filters:





here are logs from mpd deamon


Output of ffmpeg command



Mon Jul 25 09:40:30 2022 daemon.err mpd[1969]: exception: Error in /etc/mpd.conf line 17; Unknown tokens after '{'
Mon Jul 25 09:44:23 2022 daemon.debug mpd: vorbis: Xiph.Org libVorbis 1.3.7
Mon Jul 25 09:44:23 2022 daemon.debug mpd: opus: libopus 1.3.1-fixed
Mon Jul 25 09:44:23 2022 daemon.debug mpd: curl: version 7.82.0
Mon Jul 25 09:44:23 2022 daemon.debug mpd: curl: with mbedTLS/2.16.12



ffmpeg version 4.3.3 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 8.4.0 (OpenWrt GCC 8.4.0 r16554-1d4dea6d4f)
 configuration: --enable-cross-compile --cross-prefix=arm-openwrt-linux-muslgnueabi- --arch=arm --cpu=cortex-a7 --target-os=linux --prefix=/usr --pkg-config=pkg-config --enable-shared --enable-static --enable-pthreads --enable-zlib --disable-doc --disable-debug --disable-lzma --disable-vaapi --disable-vdpau --disable-outdevs --disable-runtime-cpudetect --enable-lto --enable-vfp --enable-neon --enable-vfp --disable-x86asm --enable-hardcoded-tables --enable-gpl --enable-version3 --enable-nonfree --disable-swscale --disable-everything --enable-encoder=ac3 --enable-encoder=jpegls --enable-encoder=mpeg1video --enable-encoder=mpeg2video --enable-encoder=pcm_s16be --enable-encoder=pcm_s16le --enable-encoder=png --enable-encoder=vorbis --enable-encoder=zlib --enable-decoder=aac --enable-decoder=ac3 --enable-decoder=alac --enable-decoder=amrnb --enable-decoder=amrwb --enable-decoder=ape --enable-decoder=flac --enable-decoder=jpegls --enable-decoder=mp2 --enable-decoder=mp3 --enable-decoder=mpeg1video --enable-decoder=mpeg2video --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=mpc7 --enable-decoder=mpc8 --enable-decoder=pcm_s16be --enable-decoder=pcm_s16le --enable-decoder=png --enable-decoder=vorbis --enable-decoder=wavpack --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=zlib --enable-muxer=ac3 --enable-muxer=mp3 --enable-muxer=mp4 --enable-muxer=mpeg1video --enable-muxer=mpeg2video --enable-muxer=mpegts --enable-muxer=ogg --enable-muxer=rtp --enable-demuxer=aac --enable-demuxer=ac3 --enable-demuxer=amr --enable-demuxer=ape --enable-demuxer=avi --enable-demuxer=flac --enable-demuxer=matroska --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=mpegps --enable-demuxer=mpegts --enable-demuxer=mpegvideo --enable-demuxer=mpc --enable-demuxer=mpc8 --enable-demuxer=ogg --enable-demuxer=rm --enable-demuxer=rtsp --enable-demuxer=rtp --enable-demuxer=sdp --enable-demuxer=wav --enable-demuxer=wv --enable-parser=aac --enable-parser=flac --enable-parser=ac3 --enable-parser=mpegaudio --enable-parser=mpeg4video --enable-parser=mpegvideo --enable-protocol=file --enable-protocol=http --enable-protocol=icecast --enable-protocol=pipe --enable-protocol=rtp --enable-protocol=tcp --enable-protocol=udp --enable-decoder=adpcm_ima_wav --enable-decoder=adpcm_ima_qt --enable-decoder=adpcm_ms --enable-libfdk-aac --enable-encoder=libfdk_aac --enable-libmp3lame --enable-encoder=libmp3lame --enable-libopus --enable-decoder=libopus --enable-encoder=libopus --enable-libshine --enable-encoder=libshine --disable-postproc
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswresample 3. 7.100 / 3. 7.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...