
Recherche avancée
Médias (91)
-
999,999
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Demon seed (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
The four of us are dying (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Corona radiata (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Lights in the sky (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (13)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
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 -
Qualité du média après traitement
21 juin 2013, parLe bon réglage du logiciel qui traite les média est important pour un équilibre entre les partis ( bande passante de l’hébergeur, qualité du média pour le rédacteur et le visiteur, accessibilité pour le visiteur ). Comment régler la qualité de son média ?
Plus la qualité du média est importante, plus la bande passante sera utilisée. Le visiteur avec une connexion internet à petit débit devra attendre plus longtemps. Inversement plus, la qualité du média est pauvre et donc le média devient dégradé voire (...)
Sur d’autres sites (3894)
-
Install llibx264 on Opensuse
10 août 2020, par Harry BoyI need to install libx264 on OpenSuse Leap 15.1.


I am following the steps here : https://software.opensuse.org/package/libx264?locale=nb
Where I see that there is an option for OpenSuse Leap 15.1. and I click the 'Community packages' option.


There are 3 options :


Option 1 : home:regataos


I select 'Expert download'


zypper addrepo https://download.opensuse.org/repositories/home:regataos/openSUSE_Leap_15.1/home:regataos.repo
zypper refresh
zypper install libx264
Loading repository data...
Reading installed packages...
'libx264' not found in package names. Trying capabilities.
No provider of 'libx264' found.
Resolving package dependencies...

Nothing to do.



Option 2 : home:smarty12:multimedia


I select 'Expert download'


zypper addrepo https://download.opensuse.org/repositories/home:smarty12:multimedia/openSUSE_Leap_15.1/home:smarty12:multimedia.repo
zypper refresh
zypper install libx264
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 2 NEW packages are going to be installed:
libx264 libx264-157

2 new packages to install.
Overall download size: 556.5 KiB. Already cached: 0 B. After the operation, additional 2.0 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package libx264-157-2019.03.03-lp151.1.86.x86_64 (1/2), 549.7 KiB ( 2.0 MiB unpacked)
Retrieving: libx264-157-2019.03.03-lp151.1.86.x86_64.rpm ....................................................................................................................[done (6.2 KiB/s)]
Retrieving package libx264-2019.03.03-lp151.1.86.x86_64 (2/2), 6.7 KiB ( 0 B unpacked)
Retrieving: libx264-2019.03.03-lp151.1.86.x86_64.rpm ....................................................................................................................................[done]

Checking for file conflicts: ............................................................................................................................................................[done]
(1/2) Installing: libx264-157-2019.03.03-lp151.1.86.x86_64 ..............................................................................................................................[done]
(2/2) Installing: libx264-2019.03.03-lp151.1.86.x86_64 ..................................................................................................................................[done]



So this appears to have installed it.


Now when I try to convert a file from one type to I get the error : "Decoder (codec h264) not found for input stream #0:1"


ffmpeg -i video.mp4 video_converted.mpg
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.0 (GCC)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --enable-avresample --enable-gmp --enable-ladspa --enable-libass --enable-libbluray --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libglslang --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libpulse --enable-libsnappy --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-opencl --enable-opengl --enable-openssl --enable-vulkan --enable-libdrm --enable-libcelt --extra-cflags='-march=core2 -pipe -O2 -DNDEBUG -D_FORTIFY_SOURCE=2 -mmmx -msse2 -mssse3 -funwind-tables' --extra-cxxflags='-march=core2 -pipe -O2 -DNDEBUG -D_FORTIFY_SOURCE=2 -mmmx -msse2 -mssse3 -funwind-tables' --extra-ldflags='-Wl,--as-needed -Wl,--strip-all' --disable-debug --disable-demuxer='hls,applehttp'
WARNING: library configuration mismatch
avutil configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-gnutls --enable-ladspa --disable-cuda-sdk --enable-libass --enable-libbluray --enable-libbs2b --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-vaapi --enable-vdpau --enable-muxers --enable-demuxers --disable-encoders --disable-decoders --disable-decoder='mpeg4,h263,h264,hevc,vc1' --enable-encoder=',aac,apng,ass,ayuv,bmp,ffv1,ffvhuff,flac,gif,huffyuv,jpegls,libaom,libaom_av1,libcodec2,libgsm,libmp3lame,libopenjpeg,libopus,libschroedinger,libspeex,libtheora,libtwolame,libvorbis,libvpx_vp8,libvpx_vp9,libwebp,libwebp_anim,mjpeg,mpeg1video,mpeg2video,mp2,mp2fixed,opus,pam,pbm,pcm_alaw,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16be_planar,pcm_s16le,pcm_s16le_planar,pcm_s24be,pcm_s24le,pcm_s24le_planar,pcm_s32be,pcm_s32le,pcm_s32le_planar,pcm_s8,pcm_s8_planar,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,pcx,pgm,pgmyuv,png,ppm,rawvideo,sgi,srt,ssa,sunrast,targa,text,tiff,v210,v308,v408,v410,vorbis,webvtt,xbm,xwd,y41p,yuv4,zlib,' --enable-decoder=',aac,ac3,ansi,apng,ass,ayuv,bmp,dirac,exr,ffv1,ffvhuff,ffwavesynth,flac,gif,gsm,huffyuv,ilbc,libaom,libaom_av1,libcelt,libcodec2,libdav1d,libgsm,libopenjpeg,libopus,libschroedinger,libspeex,libvorbis,libvpx_vp8,libvpx_vp9,mjpeg,mpeg1video,mpeg2video,,mp1,mp1float,mp2,mp2float,mp3,mp3float,opus,pam,pbm,pcm_alaw,pcm_bluray,pcm_dvd,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16be_planar,pcm_s16le,pcm_s16le_planar,pcm_s24be,pcm_s24le,pcm_s24le_planar,pcm_s32be,pcm_s32le,pcm_s32le_planar,pcm_s8,pcm_s8_planar,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,pcx,pgm,pgmyuv,pgssub,png,ppm,rawvideo,sgi,srt,ssa,sunrast,targa,text,theora,tiff,v210,v210x,v308,v408,v410,vorbis,vp3,vp5,vp6,vp6a,vp6f,vp8,vp9,webp,webvtt,xbm,xwd,y41p,yuv4,zlib,'
avcodec configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-gnutls --enable-ladspa --disable-cuda-sdk --enable-libass --enable-libbluray --enable-libbs2b --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-vaapi --enable-vdpau --enable-muxers --enable-demuxers --disable-encoders --disable-decoders --disable-decoder='mpeg4,h263,h264,hevc,vc1' --enable-encoder=',aac,apng,ass,ayuv,bmp,ffv1,ffvhuff,flac,gif,huffyuv,jpegls,libaom,libaom_av1,libcodec2,libgsm,libmp3lame,libopenjpeg,libopus,libschroedinger,libspeex,libtheora,libtwolame,libvorbis,libvpx_vp8,libvpx_vp9,libwebp,libwebp_anim,mjpeg,mpeg1video,mpeg2video,mp2,mp2fixed,opus,pam,pbm,pcm_alaw,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16be_planar,pcm_s16le,pcm_s16le_planar,pcm_s24be,pcm_s24le,pcm_s24le_planar,pcm_s32be,pcm_s32le,pcm_s32le_planar,pcm_s8,pcm_s8_planar,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,pcx,pgm,pgmyuv,png,ppm,rawvideo,sgi,srt,ssa,sunrast,targa,text,tiff,v210,v308,v408,v410,vorbis,webvtt,xbm,xwd,y41p,yuv4,zlib,' --enable-decoder=',aac,ac3,ansi,apng,ass,ayuv,bmp,dirac,exr,ffv1,ffvhuff,ffwavesynth,flac,gif,gsm,huffyuv,ilbc,libaom,libaom_av1,libcelt,libcodec2,libdav1d,libgsm,libopenjpeg,libopus,libschroedinger,libspeex,libvorbis,libvpx_vp8,libvpx_vp9,mjpeg,mpeg1video,mpeg2video,,mp1,mp1float,mp2,mp2float,mp3,mp3float,opus,pam,pbm,pcm_alaw,pcm_bluray,pcm_dvd,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16be_planar,pcm_s16le,pcm_s16le_planar,pcm_s24be,pcm_s24le,pcm_s24le_planar,pcm_s32be,pcm_s32le,pcm_s32le_planar,pcm_s8,pcm_s8_planar,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,pcx,pgm,pgmyuv,pgssub,png,ppm,rawvideo,sgi,srt,ssa,sunrast,targa,text,theora,tiff,v210,v210x,v308,v408,v410,vorbis,vp3,vp5,vp6,vp6a,vp6f,vp8,vp9,webp,webvtt,xbm,xwd,y41p,yuv4,zlib,'
avformat configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-gnutls --enable-ladspa --disable-cuda-sdk --enable-libass --enable-libbluray --enable-libbs2b --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-vaapi --enable-vdpau --enable-muxers --enable-demuxers --disable-encoders --disable-decoders --disable-decoder='mpeg4,h263,h264,hevc,vc1' --enable-encoder=',aac,apng,ass,ayuv,bmp,ffv1,ffvhuff,flac,gif,huffyuv,jpegls,libaom,libaom_av1,libcodec2,libgsm,libmp3lame,libopenjpeg,libopus,libschroedinger,libspeex,libtheora,libtwolame,libvorbis,libvpx_vp8,libvpx_vp9,libwebp,libwebp_anim,mjpeg,mpeg1video,mpeg2video,mp2,mp2fixed,opus,pam,pbm,pcm_alaw,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16be_planar,pcm_s16le,pcm_s16le_planar,pcm_s24be,pcm_s24le,pcm_s24le_planar,pcm_s32be,pcm_s32le,pcm_s32le_planar,pcm_s8,pcm_s8_planar,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,pcx,pgm,pgmyuv,png,ppm,rawvideo,sgi,srt,ssa,sunrast,targa,text,tiff,v210,v308,v408,v410,vorbis,webvtt,xbm,xwd,y41p,yuv4,zlib,' --enable-decoder=',aac,ac3,ansi,apng,ass,ayuv,bmp,dirac,exr,ffv1,ffvhuff,ffwavesynth,flac,gif,gsm,huffyuv,ilbc,libaom,libaom_av1,libcelt,libcodec2,libdav1d,libgsm,libopenjpeg,libopus,libschroedinger,libspeex,libvorbis,libvpx_vp8,libvpx_vp9,mjpeg,mpeg1video,mpeg2video,,mp1,mp1float,mp2,mp2float,mp3,mp3float,opus,pam,pbm,pcm_alaw,pcm_bluray,pcm_dvd,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16be_planar,pcm_s16le,pcm_s16le_planar,pcm_s24be,pcm_s24le,pcm_s24le_planar,pcm_s32be,pcm_s32le,pcm_s32le_planar,pcm_s8,pcm_s8_planar,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,pcx,pgm,pgmyuv,pgssub,png,ppm,rawvideo,sgi,srt,ssa,sunrast,targa,text,theora,tiff,v210,v210x,v308,v408,v410,vorbis,vp3,vp5,vp6,vp6a,vp6f,vp8,vp9,webp,webvtt,xbm,xwd,y41p,yuv4,zlib,'
swresample configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-gnutls --enable-ladspa --disable-cuda-sdk --enable-libass --enable-libbluray --enable-libbs2b --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-vaapi --enable-vdpau --enable-muxers --enable-demuxers --disable-encoders --disable-decoders --disable-decoder='mpeg4,h263,h264,hevc,vc1' --enable-encoder=',aac,apng,ass,ayuv,bmp,ffv1,ffvhuff,flac,gif,huffyuv,jpegls,libaom,libaom_av1,libcodec2,libgsm,libmp3lame,libopenjpeg,libopus,libschroedinger,libspeex,libtheora,libtwolame,libvorbis,libvpx_vp8,libvpx_vp9,libwebp,libwebp_anim,mjpeg,mpeg1video,mpeg2video,mp2,mp2fixed,opus,pam,pbm,pcm_alaw,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16be_planar,pcm_s16le,pcm_s16le_planar,pcm_s24be,pcm_s24le,pcm_s24le_planar,pcm_s32be,pcm_s32le,pcm_s32le_planar,pcm_s8,pcm_s8_planar,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,pcx,pgm,pgmyuv,png,ppm,rawvideo,sgi,srt,ssa,sunrast,targa,text,tiff,v210,v308,v408,v410,vorbis,webvtt,xbm,xwd,y41p,yuv4,zlib,' --enable-decoder=',aac,ac3,ansi,apng,ass,ayuv,bmp,dirac,exr,ffv1,ffvhuff,ffwavesynth,flac,gif,gsm,huffyuv,ilbc,libaom,libaom_av1,libcelt,libcodec2,libdav1d,libgsm,libopenjpeg,libopus,libschroedinger,libspeex,libvorbis,libvpx_vp8,libvpx_vp9,mjpeg,mpeg1video,mpeg2video,,mp1,mp1float,mp2,mp2float,mp3,mp3float,opus,pam,pbm,pcm_alaw,pcm_bluray,pcm_dvd,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16be_planar,pcm_s16le,pcm_s16le_planar,pcm_s24be,pcm_s24le,pcm_s24le_planar,pcm_s32be,pcm_s32le,pcm_s32le_planar,pcm_s8,pcm_s8_planar,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,pcx,pgm,pgmyuv,pgssub,png,ppm,rawvideo,sgi,srt,ssa,sunrast,targa,text,theora,tiff,v210,v210x,v308,v408,v410,vorbis,vp3,vp5,vp6,vp6a,vp6f,vp8,vp9,webp,webvtt,xbm,xwd,y41p,yuv4,zlib,'
libavutil 56. 51.100 / 56. 31.100
libavcodec 58. 91.100 / 58. 54.100
libavformat 58. 45.100 / 58. 29.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 5.100
libpostproc 55. 7.100 / 55. 7.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55dfcea468c0] st: 1 edit list: 1 Missing key frame while searching for timestamp: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55dfcea468c0] st: 1 edit list 1 Cannot find an index entry before timestamp: 0.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: mp41avc1
creation_time : 2019-07-25T09:16:31.000000Z
encoder : vlc 3.0.4 stream output
encoder-eng : vlc 3.0.4 stream output
Duration: 00:00:07.07, start: 0.000000, bitrate: 3900 kb/s
Stream #0:0(eng): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
 creation_time : 2019-07-25T09:16:31.000000Z
 handler_name : SoundHandler
Stream #0:1(eng): Video: h264 (avc1 / 0x31637661), none, 1088x1920, 3766 kb/s, 29.99 fps, 29.97 tbr, 1000k tbn, 1000k tbc (default)
Metadata:
 rotate : 90
 creation_time : 2019-07-25T09:16:31.000000Z
 handler_name : VideoHandler
Side data:
 displaymatrix: rotation of -90.00 degrees
Stream mapping:
 Stream #0:1 -> #0:0 (? (?) -> mpeg1video (native))
 Stream #0:0 -> #0:1 (mp3 (mp3float) -> mp2 (native))
 



Decoder (codec h264) not found for input stream #0:1


How can I successfully install libx264 o Opensuse 15.1


-
Processing WebRTC RTC stream in node js server with ffmpeg
23 juillet 2020, par Dave BI am trying to build a video chat app where I am creating an RTCPeerConnection and creating an offer and saving the SDP in a file. I want the SDP I sent to server should be sent to RTMP server like Nginx RTMP. Here is the offer SDP I am getting


v=0
o=- 3688975056307578818 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1 2
a=msid-semantic: WMS AqaeHB0L8drTd5r0qQnzCSeYVf4bHFaVqfrq
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:Xtid
a=ice-pwd:jE3iBRpWqFaIN3UJVOAh0G/1
a=ice-options:trickle
a=fingerprint:sha-256 48:E4:36:A6:24:66:F6:40:0F:93:9C:AB:C9:93:DF:C7:0F:D1:21:F5:9E:F7:FA:A8:58:84:1F:68:A1:61:B6:0F
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:AqaeHB0L8drTd5r0qQnzCSeYVf4bHFaVqfrq 284f316d-6c5d-4283-af4d-86d44803807d
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:2317617486 cname:fpKjO3/hiHYYBw7w
a=ssrc:2317617486 msid:AqaeHB0L8drTd5r0qQnzCSeYVf4bHFaVqfrq 284f316d-6c5d-4283-af4d-86d44803807d
a=ssrc:2317617486 mslabel:AqaeHB0L8drTd5r0qQnzCSeYVf4bHFaVqfrq
a=ssrc:2317617486 label:284f316d-6c5d-4283-af4d-86d44803807d
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 122 127 121 125 107 108 109 124 120 123 119 114 115 116
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:Xtid
a=ice-pwd:jE3iBRpWqFaIN3UJVOAh0G/1
a=ice-options:trickle
a=fingerprint:sha-256 48:E4:36:A6:24:66:F6:40:0F:93:9C:AB:C9:93:DF:C7:0F:D1:21:F5:9E:F7:FA:A8:58:84:1F:68:A1:61:B6:0F
a=setup:actpass
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07
a=extmap:9 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:AqaeHB0L8drTd5r0qQnzCSeYVf4bHFaVqfrq 7106bf9f-3f79-4f24-959b-b82b603a7acc
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=fmtp:98 profile-id=0
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:100 VP9/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=fmtp:100 profile-id=2
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:102 H264/90000
a=rtcp-fb:102 goog-remb
a=rtcp-fb:102 transport-cc
a=rtcp-fb:102 ccm fir
a=rtcp-fb:102 nack
a=rtcp-fb:102 nack pli
a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:122 rtx/90000
a=fmtp:122 apt=102
a=rtpmap:127 H264/90000
a=rtcp-fb:127 goog-remb
a=rtcp-fb:127 transport-cc
a=rtcp-fb:127 ccm fir
a=rtcp-fb:127 nack
a=rtcp-fb:127 nack pli
a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
a=rtpmap:121 rtx/90000
a=fmtp:121 apt=127
a=rtpmap:125 H264/90000
a=rtcp-fb:125 goog-remb
a=rtcp-fb:125 transport-cc
a=rtcp-fb:125 ccm fir
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:107 rtx/90000
a=fmtp:107 apt=125
a=rtpmap:108 H264/90000
a=rtcp-fb:108 goog-remb
a=rtcp-fb:108 transport-cc
a=rtcp-fb:108 ccm fir
a=rtcp-fb:108 nack
a=rtcp-fb:108 nack pli
a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:124 H264/90000
a=rtcp-fb:124 goog-remb
a=rtcp-fb:124 transport-cc
a=rtcp-fb:124 ccm fir
a=rtcp-fb:124 nack
a=rtcp-fb:124 nack pli
a=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032
a=rtpmap:120 rtx/90000
a=fmtp:120 apt=124
a=rtpmap:123 H264/90000
a=rtcp-fb:123 goog-remb
a=rtcp-fb:123 transport-cc
a=rtcp-fb:123 ccm fir
a=rtcp-fb:123 nack
a=rtcp-fb:123 nack pli
a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032
a=rtpmap:119 rtx/90000
a=fmtp:119 apt=123
a=rtpmap:114 red/90000
a=rtpmap:115 rtx/90000
a=fmtp:115 apt=114
a=rtpmap:116 ulpfec/90000
a=ssrc-group:FID 967462980 1884395933
a=ssrc:967462980 cname:fpKjO3/hiHYYBw7w
a=ssrc:967462980 msid:AqaeHB0L8drTd5r0qQnzCSeYVf4bHFaVqfrq 7106bf9f-3f79-4f24-959b-b82b603a7acc
a=ssrc:967462980 mslabel:AqaeHB0L8drTd5r0qQnzCSeYVf4bHFaVqfrq
a=ssrc:967462980 label:7106bf9f-3f79-4f24-959b-b82b603a7acc
a=ssrc:1884395933 cname:fpKjO3/hiHYYBw7w
a=ssrc:1884395933 msid:AqaeHB0L8drTd5r0qQnzCSeYVf4bHFaVqfrq 7106bf9f-3f79-4f24-959b-b82b603a7acc
a=ssrc:1884395933 mslabel:AqaeHB0L8drTd5r0qQnzCSeYVf4bHFaVqfrq
a=ssrc:1884395933 label:7106bf9f-3f79-4f24-959b-b82b603a7acc
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=ice-ufrag:Xtid
a=ice-pwd:jE3iBRpWqFaIN3UJVOAh0G/1
a=ice-options:trickle
a=fingerprint:sha-256 48:E4:36:A6:24:66:F6:40:0F:93:9C:AB:C9:93:DF:C7:0F:D1:21:F5:9E:F7:FA:A8:58:84:1F:68:A1:61:B6:0F
a=setup:actpass
a=mid:2
a=sctp-port:5000
a=max-message-size:262144



this is the ffmpeg command


ffmpeg -protocol_whitelist rtp,udp,file -loglevel trace -analyzeduration 300M -probesize 300M -i test.sdp -c:v copy -c:a aac -ar 16k -ac 1 -preset ultrafast -tune zerolatency rtmp://127.0.0.1/live/1234



Also trying this


ffmpeg -loglevel debug -protocol_whitelist file,crypto,udp,rtp -re -vcodec libvpx -acodec opus -i test.sdp -vcodec libx264 -acodec aac -y output.mp4



FFMpeg gives an error like this


ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with Apple clang version 11.0.0 (clang-1100.0.33.17)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-protocol_whitelist' ... matched as AVOption 'protocol_whitelist' with argument 'file,crypto,udp,rtp'.
Reading option '-re' ... matched as option 're' (read input at native frame rate) with argument '1'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libvpx'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'opus'.
Reading option '-i' ... matched as input url with argument 'test.sdp'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'output.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url test.sdp.
Applying option re (read input at native frame rate) with argument 1.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument libvpx.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument opus.
Successfully parsed a group of options.
Opening an input file: test.sdp.
[NULL @ 0x7f949000ac00] Opening 'test.sdp' for reading
[sdp @ 0x7f949000ac00] Format sdp probed with size=2048 and score=50
[sdp @ 0x7f949000ac00] audio codec set to: opus
[sdp @ 0x7f949000ac00] audio samplerate set to: 48000
[sdp @ 0x7f949000ac00] audio channels set to: 2
[sdp @ 0x7f949000ac00] audio codec set to: opus
[sdp @ 0x7f949000ac00] audio samplerate set to: 16000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: opus
[sdp @ 0x7f949000ac00] audio samplerate set to: 32000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: adpcm_g722
[sdp @ 0x7f949000ac00] audio samplerate set to: 8000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: pcm_mulaw
[sdp @ 0x7f949000ac00] audio samplerate set to: 8000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: pcm_alaw
[sdp @ 0x7f949000ac00] audio samplerate set to: 8000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: pcm_alaw
[sdp @ 0x7f949000ac00] audio samplerate set to: 32000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: pcm_alaw
[sdp @ 0x7f949000ac00] audio samplerate set to: 16000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: (null)
[sdp @ 0x7f949000ac00] audio samplerate set to: 8000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: (null)
[sdp @ 0x7f949000ac00] audio samplerate set to: 48000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: (null)
[sdp @ 0x7f949000ac00] audio samplerate set to: 32000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: (null)
[sdp @ 0x7f949000ac00] audio samplerate set to: 16000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] audio codec set to: (null)
[sdp @ 0x7f949000ac00] audio samplerate set to: 8000
[sdp @ 0x7f949000ac00] audio channels set to: 1
[sdp @ 0x7f949000ac00] video codec set to: vp8
 Last message repeated 20 times
[udp @ 0x7f948fc07200] bind failed: Address already in use
[AVIOContext @ 0x7f948fe1c4c0] Statistics: 5985 bytes read, 0 seeks
test.sdp: Invalid data found when processing input



Can anyone please point out what I am doing wrong here ? or I am in the right path ?
Please help !


-
FFMPEG API Mp4 H264 Encoding/Muxing - unspecified pixel format
28 juillet 2020, par FabriceI'm working on a c++ project using ffmpeg. I have to generate an mp4 file with h264 encoding.


My problem is that the file generate but when reading the file with VLC I've got no image, and analyzing it with ffprobe give me (log below) the error :




unspecified pixel format




ffprobe version N-93020-g3224d6691c Copyright (c) 2007-2019 the FFmpeg developers
 built with gcc 8.2.1 (GCC) 20181201
 configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
 libavutil 56. 26.100 / 56. 26.100
 libavcodec 58. 44.100 / 58. 44.100
 libavformat 58. 26.100 / 58. 26.100
 libavdevice 58. 6.101 / 58. 6.101
 libavfilter 7. 48.100 / 7. 48.100
 libswscale 5. 4.100 / 5. 4.100
 libswresample 3. 4.100 / 3. 4.100
 libpostproc 55. 4.100 / 55. 4.100
[h264 @ 02a46240] non-existing PPS 0 referenced
[h264 @ 02a46240] decode_slice_header error
[h264 @ 02a46240] no frame!
...
[h264 @ 02a46240] non-existing PPS 0 referenced
[h264 @ 02a46240] decode_slice_header error
[h264 @ 02a46240] no frame!
[mov,mp4,m4a,3gp,3g2,mj2 @ 02a35380] decoding for stream 0 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 02a35380] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 352x288, 320 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Fabrice\Desktop\video\Test.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.26.100
 Duration: 00:00:09.00, start: 0.000000, bitrate: 323 kb/s
 Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 352x288, 320 kb/s, 25.11 fps, 25 tbr, 12800 tbn, 25600 tbc (default)
 Metadata:
 handler_name : VideoHandler



Here is the code I use to genererate my mp4 File, it's based on sample from ffmpeg (see : FFMPEG Muxing sample). I have tried to adapt it without using deprecated function. It works using webm/vp8 encoding, but not mp4/h264.


#include 
#include 
#include 
extern "C"
{
#include <libavcodec></libavcodec>avcodec.h>
#include <libswscale></libswscale>swscale.h>
#include <libavformat></libavformat>avformat.h>
#include <libavutil></libavutil>error.h> 
#include <libavutil></libavutil>opt.h>
#include <libavutil></libavutil>imgutils.h>
}

#pragma comment(lib, "avcodec.lib")
#pragma comment(lib, "swscale.lib")
#pragma comment(lib, "avformat.lib")
#pragma comment(lib, "avutil.lib")

/* 10 seconds stream duration */
#define STREAM_DURATION 10.0
#define STREAM_FRAME_RATE 25 /* 25 images/s */
#define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
#define STREAM_PIX_FMT AV_PIX_FMT_YUV420P /* default pix_fmt */

//#pragma warning(disable : 4996) // TODO: remove

static int sws_flags = SWS_BICUBIC;

/* Add an output stream. */
static AVStream *add_stream(AVFormatContext *formatContext, AVCodec **codec, enum AVCodecID codecId, AVCodecContext **codecCtx)
{
 AVStream *stream;

 // Get the encoder codec
 *codec = avcodec_find_encoder(codecId);
 if (!(*codec)) {
 fprintf(stderr, "Could not find encoder for '%s'\n",
 avcodec_get_name(codecId));
 exit(1);
 }

 // Get the stream for codec
 stream = avformat_new_stream(formatContext, *codec);
 if (!stream) {
 fprintf(stderr, "Could not allocate stream\n");
 exit(1);
 }
 stream->id = formatContext->nb_streams - 1;

 (*codecCtx) = avcodec_alloc_context3(*codec);

 switch ((*codec)->type) {
 case AVMEDIA_TYPE_VIDEO:
 stream->codecpar->codec_id = codecId;
 stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
 stream->codecpar->bit_rate = 400000;
 stream->codecpar->width = 352;
 stream->codecpar->height = 288;
 stream->codecpar->format = STREAM_PIX_FMT;
 stream->time_base = { 1, STREAM_FRAME_RATE };

 avcodec_parameters_to_context((*codecCtx), stream->codecpar);
 (*codecCtx)->gop_size = 12; /* emit one intra frame every twelve frames at most */
 (*codecCtx)->max_b_frames = 2;
 (*codecCtx)->time_base = { 1, STREAM_FRAME_RATE };
 if ((*codecCtx)->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
 /* Needed to avoid using macroblocks in which some coeffs overflow.
 * This does not happen with normal video, it just happens here as
 * the motion of the chroma plane does not match the luma plane. */
 (*codecCtx)->mb_decision = 2;
 }
 break;

 default:
 break;
 }
 
 //if (stream->codecpar->codec_id == AV_CODEC_ID_H264) {
 // av_opt_set(codecCtx, "preset", "ultrafast", 0);
 //}
 //(*codecCtx)->flags |= AV_CODEC_FLAG_LOW_DELAY;

 /* Some formats want stream headers to be separate. */
 if (formatContext->oformat->flags & AVFMT_GLOBALHEADER)
 (*codecCtx)->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;


 int ret = avcodec_parameters_from_context(stream->codecpar, (*codecCtx));
 if (ret < 0) {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "avcodec_parameters_from_context returned (%d) - %s", ret, error);
 return false;
 }

 return stream;
}

/**************************************************************/
/* video output */

static AVFrame *frame_video;
static int frame_count;

static void open_video(AVCodec *codec, AVStream *stream, AVCodecContext *codecCtx)
{
 int ret;

 /* open the codec */
 ret = avcodec_open2(codecCtx, codec, NULL);
 if (ret < 0) {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "Could not open video codec: %s\n", error);
 exit(1);
 }

 /* allocate and init a re-usable frame */
 frame_video = av_frame_alloc();
 if (!frame_video) {
 fprintf(stderr, "Could not allocate video frame\n");
 exit(1);
 }

 frame_video->format = codecCtx->pix_fmt;
 frame_video->width = codecCtx->width;
 frame_video->height = codecCtx->height;

 ret = av_frame_get_buffer(frame_video, 32);
 if (ret < 0) {
 fprintf(stderr, "Could not allocate the video frame data\n");
 exit(1);
 }
}

/* Prepare a dummy image. */
static void fill_yuv_image(AVFrame *pict, int frame_index, int width, int height)
{
 int x, y, i;

 i = frame_index;

 /* Y */
 for (y = 0; y < height; y++)
 for (x = 0; x < width; x++)
 pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3;

 /* Cb and Cr */
 for (y = 0; y < height / 2; y++) {
 for (x = 0; x < width / 2; x++) {
 pict->data[1][y * pict->linesize[1] + x] = 128 + y + i * 2;
 pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5;
 }
 }
}

int timestamp = 0;
static void write_video_frame(AVFormatContext *formatContext, AVStream *stream, AVCodecContext *codecCtx)
{
 int ret;
 static struct SwsContext *sws_ctx;

 if (frame_count >= STREAM_NB_FRAMES) {
 /* No more frames to compress. The codec has a latency of a few
 * frames if using B-frames, so we get the last frames by
 * passing the same picture again. */
 }
 else {
 if (codecCtx->pix_fmt != AV_PIX_FMT_YUV420P) {
 /* as we only generate a YUV420P picture, we must convert it
 * to the codec pixel format if needed */
 if (!sws_ctx) {
 sws_ctx = sws_getContext(codecCtx->width, codecCtx->height, AV_PIX_FMT_YUV420P,
 codecCtx->width, codecCtx->height, codecCtx->pix_fmt,
 sws_flags, NULL, NULL, NULL);
 if (!sws_ctx) {
 fprintf(stderr, "Could not initialize the conversion context\n");
 exit(1);
 }
 }
 fill_yuv_image(frame_video, frame_count, codecCtx->width, codecCtx->height);
 sws_scale(sws_ctx, (const uint8_t * const *)frame_video->data, frame_video->linesize,
 0, codecCtx->height, frame_video->data, frame_video->linesize);
 }
 else {
 fill_yuv_image(frame_video, frame_count, codecCtx->width, codecCtx->height);
 }
 }

 frame_video->format = AV_PIX_FMT_YUV420P;
 frame_video->width = codecCtx->width;
 frame_video->height = codecCtx->height;

 if (formatContext->oformat->flags & 0x0020) {
 /* Raw video case - directly store the picture in the packet */
 AVPacket pkt;
 av_init_packet(&pkt);

 pkt.flags |= AV_PKT_FLAG_KEY;
 pkt.stream_index = stream->index;
 pkt.data = frame_video->data[0];
 pkt.size = sizeof(AVPicture);

 ret = av_interleaved_write_frame(formatContext, &pkt);
 }
 else {
 AVPacket pkt = { 0 };
 av_init_packet(&pkt);

 /* encode the image */
 fprintf(stderr, "\nFrame type : %c\n", av_get_picture_type_char(frame_video->pict_type));
 fprintf(stderr, "Frame pts: %lld, \n", frame_video->pts);
 fprintf(stderr, "Codec timebase: %d/%d\n", codecCtx->time_base.num, codecCtx->time_base.den);
 fprintf(stderr, "Stream timebase: %d/%d\n", stream->time_base.num, stream->time_base.den);
 fprintf(stderr, "Resacale: %lld, \n\n", av_rescale_q(1, codecCtx->time_base, stream->time_base));
 ret = avcodec_send_frame(codecCtx, frame_video);
 if (ret < 0) {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "Error encoding video frame: %s\n", error);
 exit(1);
 }
 /* If size is zero, it means the image was buffered. */
 ret = avcodec_receive_packet(codecCtx, &pkt);
 if (!ret && pkt.size) {
 pkt.stream_index = stream->index;
 fprintf(stderr, "Packet flags : %d\n", pkt.flags);
 fprintf(stderr, "Packet pts: %lld\n", pkt.pts);
 fprintf(stderr, "Packet dts: %lld\n", pkt.dts);
 fprintf(stderr, "Packet duration: %lld\n", pkt.duration);
 fprintf(stderr, "Packet pos: %lld\n\n", pkt.pos);
 
 /* Write the compressed frame to the media file. */
 ret = av_interleaved_write_frame(formatContext, &pkt);
 }
 else {
 ret = 0;
 }
 }
 if (ret != 0) {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "Error while writing video frame: %s\n", error);
 exit(1);
 }
 frame_count++;
}

static void close_video(AVFormatContext *oc, AVStream *st)
{
 av_free(frame_video->data[0]);
 av_free(frame_video);
}

/**************************************************************/
/* media file output */

int main(int argc, char **argv)
{
 // The outputed media
 char filename[100];
 const char *mediaFormat = "mp4"; AVCodecID mediaVideoCodec = AV_CODEC_ID_H264;
 //const char *mediaFormat="webm"; AVCodecID mediaVideoCodec = AV_CODEC_ID_VP8;
 AVOutputFormat *formatOut;
 AVFormatContext *formatCtx;

 // The video stream
 AVStream *stream_video;
 AVCodec *codec_video = nullptr;
 AVCodecContext *codecCtx_video = nullptr;
 double time_video = 0;

 // Return code
 int ret;

 strcpy_s(filename, "C:\\Test.");
 strcat_s(filename, mediaFormat);

 // allocate the output media context
 avformat_alloc_output_context2(&formatCtx, NULL, NULL, filename);
 if (!formatCtx) {
 return 1;
 }
 formatOut = formatCtx->oformat;

 // Add the video stream using H264 codec
 stream_video = NULL;
 stream_video = add_stream(formatCtx, &codec_video, mediaVideoCodec, &codecCtx_video);

 // Open video codec and allocate the necessary encode buffers
 if (stream_video)
 open_video(codec_video, stream_video, codecCtx_video);

 av_dump_format(formatCtx, 0, filename, 1);

 // Open the output media file, if needed
 if (!(formatOut->flags & AVFMT_NOFILE)) {
 ret = avio_open(&formatCtx->pb, filename, AVIO_FLAG_WRITE);
 if (ret < 0) {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "Could not open '%s': %s\n", filename, error);
 return 1;
 }
 }

 // Write media header
 ret = avformat_write_header(formatCtx, NULL);
 if (ret < 0) {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "Error occurred when opening output file: %s\n", error);
 return 1;
 }

 if (frame_video)
 frame_video->pts = 0;
 for (;;) {
 // Compute video time from last added video frame
 time_video = ((double)frame_video->pts) * av_q2d(stream_video->time_base);

 // Stop media if enough time
 if (!stream_video || time_video >= STREAM_DURATION)
 break;

 // Add a video frame
 write_video_frame(formatCtx, stream_video, codecCtx_video);

 // Increase frame pts according to time base
 frame_video->pts += av_rescale_q(1, codecCtx_video->time_base, stream_video->time_base);
 }

 // Write media trailer
 av_write_trailer(formatCtx);

 /* Close each codec. */
 if (stream_video)
 close_video(formatCtx, stream_video);

 if (!(formatOut->flags & AVFMT_NOFILE))
 /* Close the output file. */
 avio_close(formatCtx->pb);

 /* free the stream */
 avformat_free_context(formatCtx);

 return 0;
}



What am I missing ? Which part give me this error ?