
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (52)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)
Sur d’autres sites (3723)
-
Could not write header for output file #0 (incorrect codec parameters ?) : No such file or directory Error initializing output stream 0:5 —
13 septembre 2022, par M EI am trying to create a DASH manifest and segments from an .mp4 file. I have created a bash files with the commands below, and calling bbb.mp4, but the output gives the error on the subject line. This is the script I am using :


ffmpeg -re -i bbb.mp4 -map 0 -map 0 -c:a aac -c:v libx264 \
-b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
-profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
-b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
-window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \
-f dash /path/to/out.mpd



After running the command for my bash file dash-demo I get :


$ dash-demo.sh
ffmpeg version 5.1.1-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 12.1.0 (Rev2, 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-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --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-libmfx --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-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 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 libpostproc 56. 6.100 / 56. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bbb.mp4':
 Metadata:
 major_brand : isom
 minor_version : 1
 compatible_brands: isomavc1
 creation_time : 2013-12-16T17:59:32.000000Z
 title : Big Buck Bunny, Sunflower version
 artist : Blender Foundation 2008, Janus Bager Kristensen 2013
 comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
 genre : Animation
 composer : Sacha Goedegebure
 Duration: 00:10:34.53, start: 0.000000, bitrate: 4486 kb/s
 Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 4001 kb/s, 60 fps, 60 tbr, 60k tbn (default)
 Metadata:
 creation_time : 2013-12-16T17:59:32.000000Z
 handler_name : GPAC ISO Video Handler
 vendor_id : [0][0][0][0]
 Stream #0:1[0x2](und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
 Metadata:
 creation_time : 2013-12-16T17:59:37.000000Z
 handler_name : GPAC ISO Audio Handler
 vendor_id : [0][0][0][0]
 Stream #0:2[0x3](und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 320 kb/s (default)
 Metadata:
 creation_time : 2013-12-16T17:59:37.000000Z
 handler_name : GPAC ISO Audio Handler
 vendor_id : [0][0][0][0]
 Side data:
 audio service type: main
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (mp3 (mp3float) -> aac (native))
 Stream #0:2 -> #0:2 (ac3 (native) -> aac (native))
 Stream #0:0 -> #0:3 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:4 (mp3 (mp3float) -> aac (native))
 Stream #0:2 -> #0:5 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 00000172d0783040] using SAR=1/1
[libx264 @ 00000172d0783040] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000172d0783040] profile Main, level 4.2, 4:2:0, 8-bit
[libx264 @ 00000172d0783040] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 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=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=1 b_pyramid=0 b_adapt=0 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=120 keyint_min=61 scenecut=0 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=800 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[libx264 @ 00000172d011dac0] using SAR=17/18
[libx264 @ 00000172d011dac0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000172d011dac0] profile Constrained Baseline, level 2.1, 4:2:0, 8-bit
[libx264 @ 00000172d011dac0] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - 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=5 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=120 keyint_min=61 scenecut=0 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=300 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[aac @ 00000172d011d2c0] Using a PCE to encode channel layout "5.1(side)"
[aac @ 00000172d0136580] Using a PCE to encode channel layout "5.1(side)"
[dash @ 00000172d0a82880] Opening 'C:/Program Files/Git/path/to/init-stream0.m4s' for writing
Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory
Error initializing output stream 0:5 --
[libx264 @ 00000172d0783040] final ratefactor: 41.41
[aac @ 00000172d04ffc00] Qavg: 8678.318
[aac @ 00000172d04ffc00] 2 frames left in the queue on closing
[aac @ 00000172d011d2c0] Qavg: nan
[libx264 @ 00000172d011dac0] final ratefactor: 34.26
[aac @ 00000172d0136180] Qavg: 8678.318
[aac @ 00000172d0136180] 2 frames left in the queue on closing
[aac @ 00000172d0136580] Qavg: nan
Conversion failed!



What am I doing wrong ?


Thank you !


-
avcodec_decode_video2 fails to decode after frame resolution change
7 octobre 2016, par Krzysztof KansyI’m using ffmpeg in Android project via JNI to decode real-time H264 video stream. On the Java side I’m only sending the the byte arrays into native module. Native code is running a loop and checking data buffers for new data to decode. Each data chunk is processed with :
int bytesLeft = data->GetSize();
int paserLength = 0;
int decodeDataLength = 0;
int gotPicture = 0;
const uint8_t* buffer = data->GetData();
while (bytesLeft > 0) {
AVPacket packet;
av_init_packet(&packet);
paserLength = av_parser_parse2(_codecPaser, _codecCtx, &packet.data, &packet.size, buffer, bytesLeft, AV_NOPTS_VALUE, AV_NOPTS_VALUE, AV_NOPTS_VALUE);
bytesLeft -= paserLength;
buffer += paserLength;
if (packet.size > 0) {
decodeDataLength = avcodec_decode_video2(_codecCtx, _frame, &gotPicture, &packet);
}
else {
break;
}
av_free_packet(&packet);
}
if (gotPicture) {
// pass the frame to rendering
}The system works pretty well until incoming video’s resolution changes. I need to handle transition between 4:3 and 16:9 aspect ratios. While having AVCodecContext configured as follows :
_codecCtx->flags2|=CODEC_FLAG2_FAST;
_codecCtx->thread_count = 2;
_codecCtx->thread_type = FF_THREAD_FRAME;
if(_codec->capabilities&CODEC_FLAG_LOW_DELAY){
_codecCtx->flags|=CODEC_FLAG_LOW_DELAY;
}I wasn’t able to continue decoding new frames after video resolution change. The
got_picture_ptr
flag thatavcodec_decode_video2
enables when whole frame is available was never true after that.
This ticket made me wonder if the issue isn’t connected with multithreading. Only useful thing I’ve noticed is that when I changethread_type
toFF_THREAD_SLICE
the decoder is not always blocked after resolution change, about half of my attempts were successfull. Switching to single-threaded processing is not possible, I need more computing power. Setting up the context to one thread does not solve the problem and makes the decoder not keeping up with processing incoming data.
Everything work well after app restart.I can only think of one workoround (it doesn’t really solve the problem) : unloading and loading the whole library after stream resolution change (e.g as mentioned in here). I don’t think it’s good tho, it will propably introduce other bugs and take a lot of time (from user’s viewpoint).
Is it possible to fix this issue ?
EDIT :
I’ve dumped the stream data that is passed to decoding pipeline. I’ve changed the resolution few times while stream was being captured. Playing it with ffplay showed that in moment when resolution changed and preview in application froze, ffplay managed to continue, but preview is glitchy for a second or so. You can see full ffplay log here. In this case video preview stopped when I changed resolution to 960x720 for the second time. (Reinit context to 960x720, pix_fmt: yuv420p
in log). -
ffmpeg wont encode h264 mp4 video with libx264 installed
2 décembre 2014, par el producerI’m trying to do a simple encoding of an mp4 in h264 to mp4 but I keep getting the error :
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
I’m using this command :
ffmpeg -i qDqMvfoapXh6FO3KMuYiZCcG.mp4 out.mp4
I have compiled and installed from the ffmpeginstaller 8.0 from http://ffmpeginstaller.com/
This was working until i removed everything containing ffmpeg in the file name so that I can install libvpx and recompile ffmpeg. I used this command (as root) to remove all traces of ffmpeg from my system (redhat)
find / | grep -w ffmpeg | xargs rm -r -f
find / | grep -w cpffmpeg | xargs rm -r -f
find / | grep -w ffmpegscript | xargs rm -r -fThen I installed libvpx successfully and installed ffmpeg again but have not been able to encode h264 mp4 files since. Since them I have removed ffmpeg completely and recompiled a few times but haven’t got it to work again.
Complete ffmpeg output :
ffmpeg version N-68141-g4280150-syslint Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 1 2014 20:24:46 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore- amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 13.100 / 56. 13.100
libavformat 56. 15.101 / 56. 15.101
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'qDqMvfoapXh6FO3KMuYiZCcG.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isom3gp4
creation_time : 2014-12-01 04:18:17
Duration: 00:00:22.61, start: 0.000000, bitrate: 12028 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 11968 kb/s, 29.88 fps, 29.97 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 90
creation_time : 2014-12-01 04:18:17
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 121 kb/s (default)
Metadata:
creation_time : 2014-12-01 04:18:17
handler_name : SoundHandle
[libx264 @ 0x2505ee0] using cpu capabilities: none!
Output #0, mp4, to 'out.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isom3gp4
Stream #0:0(eng): Video: h264, none, q=2-31, 128 kb/s, 29.97 fps (default)
Metadata:
rotate : 90
creation_time : 2014-12-01 04:18:17
handler_name : VideoHandle
encoder : Lavc56.13.100 libx264
Stream #0:1(eng): Audio: aac, 0 channels, 128 kb/s (default)
Metadata:
creation_time : 2014-12-01 04:18:17
handler_name : SoundHandle
encoder : Lavc56.13.100 libfaac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (libfaac))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or heightCan someone explain why I keep getting this error now ?