Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (37)

  • Activation de l’inscription des visiteurs

    12 avril 2011, par

    Il est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
    Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
    Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce 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" ;

Sur d’autres sites (9281)

  • FFmpeg warning : could not find codec parameters for stream 1 [closed]

    17 avril 2020, par Mocchi

    Hello : I have videos in the TS container that are Advanced Video Codec created by Elgato Game Capture HD60 Pro. I am trying to convert the TS videos because sometimes the Elgato MP4 output videos have audio/video sync issues. I have been trying for a few days now to get a clean remuxed video into MP4. I am using this simple batch file :

    



    ffmpeg -analyzeduration 10000M -probesize 10000000M -i "Game Video.ts" -acodec copy -vcodec copy "Game Video.mp4"
pause


    



    I always get these warnings no matter what I have tried. even if I use the -vn command to ignore the video. which makes me believe FFmpeg is seeing something or can't read something in my source video. The Source video Information via Media Info is here, there is 12 Audio streams which are all the same and I only put the first two here :

    



    General
ID : 1 (0x1)
Complete name : P :\Game Video.ts
Format : MPEG-TS
File size : 8.82 GiB
Duration : 54 min 43 s
Overall bit rate mode : Variable
Overall bit rate : 23.1 Mb/s

    



    Video
ID : 100 (0x64)
Menu ID : 2 (0x2)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 1 frame
Format settings, GOP : M=1, N=15
Codec ID : 27
Duration : 54 min 43 s
Bit rate mode : Variable
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 59.940 (60000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Color range : Full
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

    



    Audio #1
ID : 101 (0x65)
Menu ID : 2 (0x2)
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Format version : Version 4
Muxing mode : ADTS
Codec ID : 15-2
Duration : 54 min 43 s
Bit rate mode : Variable
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Delay relative to video : 13 ms
Language : English

    



    Audio #2
ID : 103 (0x67)
Menu ID : 2 (0x2)
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Format version : Version 4
Muxing mode : ADTS
Codec ID : 15-2
Duration : 54 min 43 s
Bit rate mode : Variable
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Delay relative to video : 13 ms
Language : English

    



    FFmpeg does create a MP4 video which seems to be good ; the Media Info is here :

    



    General
Complete name : P :\Game Video.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 7.44 GiB
Duration : 54 min 43 s
Overall bit rate mode : Variable
Overall bit rate : 19.5 Mb/s
Writing application : Lavf58.29.100

    



    Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 1 frame
Format settings, GOP : M=1, N=15
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 54 min 43 s
Bit rate mode : Variable
Bit rate : 19.2 Mb/s
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 59.862 FPS
Minimum frame rate : 0.461 FPS
Maximum frame rate : 59.960 FPS
Original frame rate : 59.940 (60000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.348
Stream size : 7.35 GiB (99%)
Color range : Full
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Codec configuration box : avcC

    



    Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 54 min 43 s
Bit rate mode : Constant
Bit rate : 221 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 86.5 MiB (1%)
Language : English
Default : Yes
Alternate group : 1

    



    I have not been able to figure out how to address the FFmpeg warnings and I am concerned that there is something wrong with the video that I will not find out until after I delete the source video. Any help is appreciated. here is the output from FFmpeg :

    



    P:\>ffmpeg -analyzeduration 10000M -probesize 10000000M -i "Game Video.ts" -acod
ec copy -vcodec copy "Game Video.mp4"
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20200122
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3
 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libas
s --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --ena
ble-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libth
eora --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-libopenm
pt
  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
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[mpegts @ 00000000003b8fc0] start time for stream 1 is not set in estimate_timin
gs_from_pts
[mpegts @ 00000000003b8fc0] Could not find codec parameters for stream 1 (Video:
 mpeg2video ([2][0][0][0] / 0x0002), none(tv)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'Game Video.ts':
  Duration: 00:54:43.40, start: 505.283956, bitrate: 23076 kb/s
  Program 2
    Stream #0:0[0x64]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuvj420p(pc,
 bt709, progressive), 1280x720 [SAR 96:96 DAR 16:9], 59.94 fps, 59.94 tbr, 90k t
bn, 119.88 tbc
    Stream #0:1[0x66]: Video: mpeg2video ([2][0][0][0] / 0x0002), none(tv), 90k
tbr, 90k tbn, 90k tbc
    Stream #0:2[0x67](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 225 kb/s
    Stream #0:3[0x69](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 224 kb/s
    Stream #0:4[0x3ec](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
 stereo, fltp, 225 kb/s
    Stream #0:5[0x3f0](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
 stereo, fltp, 224 kb/s
    Stream #0:6[0x3f7](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
 stereo, fltp, 225 kb/s
    Stream #0:7[0x65](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 225 kb/s
    Stream #0:8[0x3f3](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
 stereo, fltp, 225 kb/s
    Stream #0:9[0x3eb](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
 stereo, fltp, 225 kb/s
    Stream #0:10[0x3f5](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz
, stereo, fltp, 225 kb/s
    Stream #0:11[0x3ed](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz
, stereo, fltp, 225 kb/s
    Stream #0:12[0x3f1](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz
, stereo, fltp, 225 kb/s
    Stream #0:13[0x4e7](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz
, stereo, fltp, 225 kb/s
Output #0, mp4, to 'Game Video.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709, pro
gressive), 1280x720 [SAR 96:96 DAR 16:9], q=2-31, 59.94 fps, 59.94 tbr, 90k tbn,
 90k tbc
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, flt
p, 225 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 3067 fps=0.0 q=-1.0 size=  111616kB time=00:00:51.16 bitrate=17871.9kbits
frame= 5766 fps=5766 q=-1.0 size=  220160kB time=00:01:36.19 bitrate=18748.6kbit
frame= 8478 fps=5652 q=-1.0 size=  330496kB time=00:02:21.42 bitrate=19143.9kbit
frame=11166 fps=5583 q=-1.0 size=  438272kB time=00:03:06.28 bitrate=19273.1kbit
frame=13962 fps=5254 q=-1.0 size=  549632kB time=00:03:52.94 bitrate=19329.1kbit
frame=16771 fps=5312 q=-1.0 size=  662784kB time=00:04:39.79 bitrate=19405.7kbit
frame=19591 fps=5357 q=-1.0 size=  775424kB time=00:05:26.85 bitrate=19434.7kbit
frame=22357 fps=5378 q=-1.0 size=  887808kB time=00:06:12.99 bitrate=19498.6kbit
frame=24205 fps=5197 q=-1.0 size=  963584kB time=00:06:43.80 bitrate=19548.3kbit
frame=26914 fps=5219 q=-1.0 size= 1073152kB time=00:07:29.02 bitrate=19578.4kbit
frame=28873 fps=5104 q=-1.0 size= 1149696kB time=00:08:01.71 bitrate=19551.8kbit
frame=31566 fps=5127 q=-1.0 size= 1256704kB time=00:08:46.63 bitrate=19548.3kbit
frame=33579 fps=5022 q=-1.0 size= 1336832kB time=00:09:20.21 bitrate=19548.3kbit
frame=36292 fps=5050 q=-1.0 size= 1444096kB time=00:10:05.46 bitrate=19538.7kbit
frame=38205 fps=4970 q=-1.0 size= 1519872kB time=00:10:37.40 bitrate=19533.7kbit
frame=41030 fps=5012 q=-1.0 size= 1631488kB time=00:11:24.52 bitrate=19524.6kbit
frame=43471 fps=4947 q=-1.0 size= 1729280kB time=00:12:05.25 bitrate=19532.9kbit
frame=46199 fps=4974 q=-1.0 size= 1838080kB time=00:12:50.75 bitrate=19536.1kbit
frame=48026 fps=4907 q=-1.0 size= 1909760kB time=00:13:21.24 bitrate=19525.6kbit
frame=50849 fps=4943 q=-1.0 size= 2022144kB time=00:14:08.34 bitrate=19526.8kbit
frame=53324 fps=4909 q=-1.0 size= 2120960kB time=00:14:49.64 bitrate=19530.2kbit
frame=56043 fps=4933 q=-1.0 size= 2231552kB time=00:15:34.99 bitrate=19551.8kbit
frame=58032 fps=4892 q=-1.0 size= 2316288kB time=00:16:08.15 bitrate=19599.2kbit
frame=60918 fps=4928 q=-1.0 size= 2436608kB time=00:16:56.31 bitrate=19640.2kbit
frame=62869 fps=4878 q=-1.0 size= 2516480kB time=00:17:28.85 bitrate=19654.8kbit
frame=65418 fps=4886 q=-1.0 size= 2622464kB time=00:18:11.39 bitrate=19684.3kbit
frame=67200 fps=4839 q=-1.0 size= 2696960kB time=00:18:41.12 bitrate=19706.5kbit
frame=69648 fps=4841 q=-1.0 size= 2799360kB time=00:19:22.17 bitrate=19732.3kbit
frame=72165 fps=4802 q=-1.0 size= 2908160kB time=00:20:04.20 bitrate=19783.8kbit
frame=74787 fps=4816 q=-1.0 size= 3016704kB time=00:20:47.93 bitrate=19803.0kbit
frame=76580 fps=4775 q=-1.0 size= 3090432kB time=00:21:19.98 bitrate=19779.1kbit
frame=78741 fps=4761 q=-1.0 size= 3182080kB time=00:21:57.86 bitrate=19780.2kbit
frame=81470 fps=4781 q=-1.0 size= 3295232kB time=00:22:43.39 bitrate=19799.6kbit
frame=84198 fps=4801 q=-1.0 size= 3409664kB time=00:23:28.87 bitrate=19825.7kbit
frame=86826 fps=4813 q=-1.0 size= 3519744kB time=00:24:12.75 bitrate=19847.6kbit
frame=89508 fps=4828 q=-1.0 size= 3626752kB time=00:24:57.49 bitrate=19840.1kbit
frame=91254 fps=4793 q=-1.0 size= 3699456kB time=00:25:26.61 bitrate=19851.8kbit
frame=94034 fps=4813 q=-1.0 size= 3817472kB time=00:26:12.99 bitrate=19881.1kbit
frame=96349 fps=4808 q=-1.0 size= 3911168kB time=00:26:51.62 bitrate=19880.7kbit
frame=98600 fps=4801 q=-1.0 size= 4004864kB time=00:27:29.17 bitrate=19893.5kbit
frame=100838 fps=4793 q=-1.0 size= 4098048kB time=00:28:06.48 bitrate=19906.0kbi
frame=103620 fps=4811 q=-1.0 size= 4206848kB time=00:28:52.92 bitrate=19886.9kbi
frame=105687 fps=4795 q=-1.0 size= 4292608kB time=00:29:27.40 bitrate=19896.4kbi
frame=107646 fps=4776 q=-1.0 size= 4374016kB time=00:30:00.10 bitrate=19905.4kbi
frame=110196 fps=4752 q=-1.0 size= 4482560kB time=00:30:42.66 bitrate=19928.2kbi
frame=112831 fps=4763 q=-1.0 size= 4592896kB time=00:31:26.61 bitrate=19943.1kbi
frame=114561 fps=4736 q=-1.0 size= 4667648kB time=00:31:55.47 bitrate=19962.3kbi
frame=116471 fps=4714 q=-1.0 size= 4744960kB time=00:32:27.34 bitrate=19960.8kbi
frame=119043 fps=4723 q=-1.0 size= 4850432kB time=00:33:10.25 bitrate=19964.7kbi
frame=120907 fps=4704 q=-1.0 size= 4930816kB time=00:33:41.35 bitrate=19983.2kbi
frame=122932 fps=4691 q=-1.0 size= 5012992kB time=00:34:15.10 bitrate=19982.6kbi
frame=125679 fps=4706 q=-1.0 size= 5123584kB time=00:35:00.94 bitrate=19977.8kbi
frame=127629 fps=4691 q=-1.0 size= 5205760kB time=00:35:33.48 bitrate=19988.7kbi
frame=129623 fps=4679 q=-1.0 size= 5284864kB time=00:36:06.76 bitrate=19980.8kbi
frame=132378 fps=4693 q=-1.0 size= 5394432kB time=00:36:52.71 bitrate=19971.5kbi
frame=134255 fps=4677 q=-1.0 size= 5469440kB time=00:37:24.05 bitrate=19966.4kbi
frame=136291 fps=4667 q=-1.0 size= 5549312kB time=00:37:58.03 bitrate=19955.7kbi
frame=139035 fps=4680 q=-1.0 size= 5658368kB time=00:38:43.79 bitrate=19947.2kbi
frame=140864 fps=4663 q=-1.0 size= 5730560kB time=00:39:14.30 bitrate=19939.9kbi
frame=142685 fps=4647 q=-1.0 size= 5801984kB time=00:39:44.68 bitrate=19931.3kbi
frame=145415 fps=4660 q=-1.0 size= 5910528kB time=00:40:30.25 bitrate=19923.4kbi
frame=147296 fps=4646 q=-1.0 size= 5984000kB time=00:41:01.61 bitrate=19914.1kbi
frame=149243 fps=4634 q=-1.0 size= 6060032kB time=00:41:34.10 bitrate=19904.4kbi
frame=151934 fps=4645 q=-1.0 size= 6164992kB time=00:42:18.99 bitrate=19891.2kbi
frame=153880 fps=4634 q=-1.0 size= 6241280kB time=00:42:51.48 bitrate=19882.9kbi
frame=155799 fps=4622 q=-1.0 size= 6316032kB time=00:43:23.50 bitrate=19873.6kbi
frame=158502 fps=4633 q=-1.0 size= 6426112kB time=00:44:08.60 bitrate=19875.7kbi
frame=160503 fps=4624 q=-1.0 size= 6505984kB time=00:44:41.98 bitrate=19872.2kbi
frame=162396 fps=4612 q=-1.0 size= 6584832kB time=00:45:13.58 bitrate=19878.9kbi
frame=165264 fps=4628 q=-1.0 size= 6705920kB time=00:46:01.43 bitrate=19893.6kbi
frame=167267 fps=4619 q=-1.0 size= 6788608kB time=00:46:34.84 bitrate=19898.2kbi
frame=169281 fps=4611 q=-1.0 size= 6873600kB time=00:47:08.42 bitrate=19908.1kbi
frame=171831 fps=4607 q=-1.0 size= 6972160kB time=00:47:50.95 bitrate=19894.4kbi
frame=174586 fps=4619 q=-1.0 size= 7080192kB time=00:48:36.95 bitrate=19884.1kbi
frame=176481 fps=4608 q=-1.0 size= 7156736kB time=00:49:08.54 bitrate=19883.7kbi
frame=178470 fps=4599 q=-1.0 size= 7234560kB time=00:49:41.74 bitrate=19876.1kbi
frame=181282 fps=4612 q=-1.0 size= 7344128kB time=00:50:28.65 bitrate=19864.6kbi
frame=183059 fps=4598 q=-1.0 size= 7414784kB time=00:50:58.33 bitrate=19861.1kbi
frame=185151 fps=4588 q=-1.0 size= 7496960kB time=00:51:33.23 bitrate=19854.7kbi
frame=188046 fps=4603 q=-1.0 size= 7610368kB time=00:52:21.50 bitrate=19845.3kbi
frame=189885 fps=4591 q=-1.0 size= 7685888kB time=00:52:52.20 bitrate=19848.3kbi
frame=193431 fps=4621 q=-1.0 size= 7761408kB time=00:53:51.34 bitrate=19676.5kbi
frame=196550 fps=4669 q=-1.0 Lsize= 7799116kB time=00:54:43.37 bitrate=19458.7kb
its/s speed=  78x
video:7704206kB audio:89623kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.067837%


    



    Do I need to tell FFmpeg more information about the source file which I have seen suggested but I have been unable to implement. Again all Help is appreciated

    


  • MP4 Created Using FFmpeg API Can't Be Played in Media Players

    11 avril 2020, par RandyCroucher

    I've been struggling with this issue for days. There are similar issues posted here and around the web, but none of the solutions seem to work for me. They are possibly outdated ?

    



    Here is the current iteration of code I'm using to generate the MP4 file.

    



    It generates a simple 2 second .mp4 file that fails to play in any player I've tried. If I run that mp4 file back through the FFmpeg command line, it will generate a perfectly playable movie out of it. So the data is there.

    



    Also, if you modify the output file name in this code from .mp4 to .avi, this code generates a playable avi file too. So whatever it is, it is tied to the H.264 format.

    



    I'm sure I'm missing something simple, but for the life of me, I can't figure out what that is.

    



    Any help would be greatly appreciated !

    



    Here is a link to the VC++ project. MovieMaker.zip

    



    MovieMaker.h

    



    #pragma once&#xA;&#xA;extern "C"&#xA;{&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libswscale></libswscale>swscale.h>&#xA;#include <libavutil></libavutil>opt.h>&#xA;}&#xA;&#xA;class FMovieMaker&#xA;{&#xA;public:&#xA;    ~FMovieMaker();&#xA;&#xA;    bool Initialize(const char* FileName, int Width = 1920, int Height = 1080, int FPS = 30, int BitRate = 2000);&#xA;    bool RecordFrame(uint8_t* BGRAData);&#xA;    bool Finalize();&#xA;&#xA;    bool IsInitialized() const { return bInitialized; }&#xA;    int GetWidth() const { return CodecContext ? CodecContext->width : 0; }&#xA;    int GetHeight() const { return CodecContext ? CodecContext->height : 0; }&#xA;&#xA;private:&#xA;    bool EncodeFrame(bool bFinalize);&#xA;    void Log(const char* fmt, ...);&#xA;&#xA;    AVOutputFormat* OutputFormat = nullptr;&#xA;    AVFormatContext* FormatContext = nullptr;&#xA;    AVCodecContext* CodecContext = nullptr;&#xA;    AVFrame* Frame = nullptr;&#xA;    SwsContext* ColorConverter = nullptr;&#xA;    int64_t RecordedFrames = 0;&#xA;    bool bInitialized = false;&#xA;};&#xA;

    &#xA;&#xA;

    MovieMaker.cpp

    &#xA;&#xA;

    #include "MovieMaker.h"&#xA;&#xA;FMovieMaker::~FMovieMaker()&#xA;{&#xA;    if (IsInitialized())&#xA;        Finalize();&#xA;}&#xA;&#xA;bool FMovieMaker::Initialize(const char* FileName, int Width /*= 1920*/, int Height /*= 1080*/, int FPS /*= 30*/, int BitRate /*= 2000*/)&#xA;{&#xA;    OutputFormat = av_guess_format(nullptr, FileName, nullptr);&#xA;    if (!OutputFormat)&#xA;    {&#xA;        Log("Couldn&#x27;t guess the output format from the filename: %s", FileName);&#xA;        return false;&#xA;    }&#xA;&#xA;    AVCodecID CodecID = OutputFormat->video_codec;&#xA;    if (CodecID == AV_CODEC_ID_NONE)&#xA;    {&#xA;        Log("Could not determine a codec to use");&#xA;        return false;&#xA;    }&#xA;&#xA;    /* allocate the output media context */&#xA;    int ErrorCode = avformat_alloc_output_context2(&amp;FormatContext, OutputFormat, nullptr, FileName);&#xA;    if (ErrorCode &lt; 0)&#xA;    {&#xA;        char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;        av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;        Log("Failed to allocate format context: %s", Error);&#xA;        return false;&#xA;    }&#xA;    else if (!FormatContext)&#xA;    {&#xA;        Log("Failed to get format from filename: %s", FileName);&#xA;        return false;&#xA;    }&#xA;&#xA;    /* find the video encoder */&#xA;    const AVCodec* Codec = avcodec_find_encoder(CodecID);&#xA;    if (!Codec)&#xA;    {&#xA;        Log("Codec &#x27;%d&#x27; not found", CodecID);&#xA;        return false;&#xA;    }&#xA;&#xA;    /* create the video stream */&#xA;    AVStream* Stream = avformat_new_stream(FormatContext, Codec);&#xA;    if (!Stream)&#xA;    {&#xA;        Log("Failed to allocate stream");&#xA;        return false;&#xA;    }&#xA;&#xA;    /* create the codec context */&#xA;    CodecContext = avcodec_alloc_context3(Codec);&#xA;    if (!CodecContext)&#xA;    {&#xA;        Log("Could not allocate video codec context");&#xA;        return false;&#xA;    }&#xA;&#xA;    Stream->codecpar->codec_id = OutputFormat->video_codec;&#xA;    Stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;    Stream->codecpar->width = Width;&#xA;    Stream->codecpar->height = Height;&#xA;    Stream->codecpar->format = AV_PIX_FMT_YUV420P;&#xA;    Stream->codecpar->bit_rate = (int64_t)BitRate * 1000;&#xA;    avcodec_parameters_to_context(CodecContext, Stream->codecpar);&#xA;&#xA;    CodecContext->time_base = { 1, FPS };&#xA;    CodecContext->max_b_frames = 2;&#xA;    CodecContext->gop_size = 12;&#xA;    CodecContext->framerate = { FPS, 1 };&#xA;&#xA;    if (Stream->codecpar->codec_id == AV_CODEC_ID_H264)&#xA;        av_opt_set(CodecContext, "preset", "medium", 0);&#xA;    else if (Stream->codecpar->codec_id == AV_CODEC_ID_H265)&#xA;        av_opt_set(CodecContext, "preset", "medium", 0);&#xA;&#xA;    avcodec_parameters_from_context(Stream->codecpar, CodecContext);&#xA;&#xA;    if (FormatContext->oformat->flags &amp; AVFMT_GLOBALHEADER)&#xA;        CodecContext->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;&#xA;    if ((ErrorCode = avcodec_open2(CodecContext, Codec, NULL)) &lt; 0)&#xA;    {&#xA;        char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;        av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;        Log("Failed to open codec: %s", Error);&#xA;        return false;&#xA;    }&#xA;&#xA;    if (!(OutputFormat->flags &amp; AVFMT_NOFILE))&#xA;    {&#xA;        if ((ErrorCode = avio_open(&amp;FormatContext->pb, FileName, AVIO_FLAG_WRITE)) &lt; 0)&#xA;        {&#xA;            char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;            av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;            Log("Failed to open file: %s", Error);&#xA;            return false;&#xA;        }&#xA;    }&#xA;&#xA;    Stream->time_base = CodecContext->time_base;&#xA;    if ((ErrorCode = avformat_write_header(FormatContext, NULL)) &lt; 0)&#xA;    {&#xA;        char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;        av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;        Log("Failed to write header: %s", Error);&#xA;        return false;&#xA;    }&#xA;&#xA;    CodecContext->time_base = Stream->time_base;&#xA;&#xA;    av_dump_format(FormatContext, 0, FileName, 1);&#xA;&#xA;    // create the frame&#xA;    {&#xA;        Frame = av_frame_alloc();&#xA;        if (!Frame)&#xA;        {&#xA;            Log("Could not allocate video frame");&#xA;            return false;&#xA;        }&#xA;        Frame->format = CodecContext->pix_fmt;&#xA;        Frame->width = CodecContext->width;&#xA;        Frame->height = CodecContext->height;&#xA;&#xA;        ErrorCode = av_frame_get_buffer(Frame, 32);&#xA;        if (ErrorCode &lt; 0)&#xA;        {&#xA;            char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;            av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;            Log("Could not allocate the video frame data: %s", Error);&#xA;            return false;&#xA;        }&#xA;    }&#xA;&#xA;    // create a color converter&#xA;    {&#xA;        ColorConverter = sws_getContext(CodecContext->width, CodecContext->height, AV_PIX_FMT_BGRA,&#xA;                                        CodecContext->width, CodecContext->height, AV_PIX_FMT_YUV420P, 0, 0, 0, 0);&#xA;        if (!ColorConverter)&#xA;        {&#xA;            Log("Could not allocate color converter");&#xA;            return false;&#xA;        }&#xA;    }&#xA;&#xA;    bInitialized = true;&#xA;    return true;&#xA;}&#xA;&#xA;bool FMovieMaker::RecordFrame(uint8_t* BGRAData)&#xA;{&#xA;    if (!bInitialized)&#xA;    {&#xA;        Log("Cannot record frames on an uninitialized Video Recorder");&#xA;        return false;&#xA;    }&#xA;&#xA;    /*make sure the frame data is writable */&#xA;    int ErrorCode = av_frame_make_writable(Frame);&#xA;    if (ErrorCode &lt; 0)&#xA;    {&#xA;        char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;        av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;        Log("Could not make the frame writable: %s", Error);&#xA;        return false;&#xA;    }&#xA;&#xA;    /* convert the bgra bitmap data into yuv frame data */&#xA;    int inLinesize[1] = { 4 * CodecContext->width }; // RGB stride&#xA;    sws_scale(ColorConverter, &amp;BGRAData, inLinesize, 0, CodecContext->height, Frame->data, Frame->linesize);&#xA;&#xA;    //Frame->pts = RecordedFrames&#x2B;&#x2B;;&#xA;    Frame->pts = CodecContext->time_base.den / CodecContext->time_base.num * CodecContext->framerate.den / CodecContext->framerate.num * (RecordedFrames&#x2B;&#x2B;);&#xA;    //The following assumes that codecContext->time_base = (AVRational){1, 1};&#xA;    //Frame->pts = frameduration * (RecordedFrames&#x2B;&#x2B;) * Stream->time_base.den / (Stream->time_base.num * fps);&#xA;    //Frame->pts &#x2B;= av_rescale_q(1, CodecContext->time_base, Stream->time_base);&#xA;&#xA;    return EncodeFrame(false);&#xA;}&#xA;&#xA;bool FMovieMaker::EncodeFrame(bool bFinalize)&#xA;{&#xA;    /* send the frame to the encoder */&#xA;    int ErrorCode = avcodec_send_frame(CodecContext, bFinalize ? nullptr : Frame);&#xA;    if (ErrorCode &lt; 0)&#xA;    {&#xA;        char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;        av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;        Log("Error sending a frame for encoding: %s", Error);&#xA;        return false;&#xA;    }&#xA;&#xA;    AVPacket Packet;&#xA;    av_init_packet(&amp;Packet);&#xA;    Packet.data = NULL;&#xA;    Packet.size = 0;&#xA;    Packet.flags |= AV_PKT_FLAG_KEY;&#xA;    Packet.pts = Frame->pts;&#xA;&#xA;    if (avcodec_receive_packet(CodecContext, &amp;Packet) == 0)&#xA;    {&#xA;        //std::cout &lt;&lt; "pkt key: " &lt;&lt; (Packet.flags &amp; AV_PKT_FLAG_KEY) &lt;&lt; " " &lt;&lt; Packet.size &lt;&lt; " " &lt;&lt; (counter&#x2B;&#x2B;) &lt;&lt; std::endl;&#xA;        uint8_t* size = ((uint8_t*)Packet.data);&#xA;        //std::cout &lt;&lt; "first: " &lt;&lt; (int)size[0] &lt;&lt; " " &lt;&lt; (int)size[1] &lt;&lt; " " &lt;&lt; (int)size[2] &lt;&lt; " " &lt;&lt; (int)size[3] &lt;&lt; " " &lt;&lt; (int)size[4] &lt;&lt; " " &lt;&lt; (int)size[5] &lt;&lt; " " &lt;&lt; (int)size[6] &lt;&lt; " " &lt;&lt; (int)size[7] &lt;&lt; std::endl;&#xA;&#xA;        av_interleaved_write_frame(FormatContext, &amp;Packet);&#xA;        av_packet_unref(&amp;Packet);&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;bool FMovieMaker::Finalize()&#xA;{&#xA;    if (!bInitialized)&#xA;    {&#xA;        Log("Cannot finalize uninitialized Video Recorder");&#xA;        return false;&#xA;    }&#xA;&#xA;    //DELAYED FRAMES&#xA;    AVPacket Packet;&#xA;    av_init_packet(&amp;Packet);&#xA;    Packet.data = NULL;&#xA;    Packet.size = 0;&#xA;&#xA;    for (;;)&#xA;    {&#xA;        avcodec_send_frame(CodecContext, NULL);&#xA;        if (avcodec_receive_packet(CodecContext, &amp;Packet) == 0)&#xA;        {&#xA;            av_interleaved_write_frame(FormatContext, &amp;Packet);&#xA;            av_packet_unref(&amp;Packet);&#xA;        }&#xA;        else&#xA;            break;&#xA;    }&#xA;&#xA;    av_write_trailer(FormatContext);&#xA;    if (!(OutputFormat->flags &amp; AVFMT_NOFILE))&#xA;    {&#xA;        int ErrorCode = avio_close(FormatContext->pb);&#xA;        if (ErrorCode &lt; 0)&#xA;        {&#xA;            char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;            av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;            Log("Failed to close file: %s", Error);&#xA;        }&#xA;    }&#xA;&#xA;    if (Frame)&#xA;    {&#xA;        av_frame_free(&amp;Frame);&#xA;        Frame = nullptr;&#xA;    }&#xA;&#xA;    if (CodecContext)&#xA;    {&#xA;        avcodec_free_context(&amp;CodecContext);&#xA;        CodecContext = nullptr;&#xA;    }&#xA;&#xA;    if (FormatContext)&#xA;    {&#xA;        avformat_free_context(FormatContext);&#xA;        FormatContext = nullptr;&#xA;    }&#xA;&#xA;    if (ColorConverter)&#xA;    {&#xA;        sws_freeContext(ColorConverter);&#xA;        ColorConverter = nullptr;&#xA;    }&#xA;&#xA;    bInitialized = false;&#xA;    return true;&#xA;}&#xA;&#xA;void FMovieMaker::Log(const char* fmt, ...)&#xA;{&#xA;    va_list args;&#xA;    fprintf(stderr, "LOG: ");&#xA;    va_start(args, fmt);&#xA;    vfprintf(stderr, fmt, args);&#xA;    va_end(args);&#xA;    fprintf(stderr, "\n");&#xA;}&#xA;

    &#xA;&#xA;

    Main.cpp

    &#xA;&#xA;

    #include "MovieMaker.h"&#xA;&#xA;uint8_t FtoB(float x)&#xA;{&#xA;    if (x &lt;= 0.0f)&#xA;        return 0;&#xA;    if (x >= 1.0f)&#xA;        return 255;&#xA;    else&#xA;        return (uint8_t)(x * 255.0f);&#xA;}&#xA;&#xA;void SetPixelColor(float X, float Y, float Width, float Height, float t, uint8_t* BGRA)&#xA;{&#xA;    t &#x2B;= 12.0f; // more interesting colors at this time&#xA;&#xA;    float P[2] = { 0.1f * X - 25.0f, 0.1f * Y - 25.0f };&#xA;    float V = sqrtf(P[0] * P[0] &#x2B; P[1] * P[1]);&#xA;    BGRA[0] = FtoB(sinf(V &#x2B; t / 0.78f));&#xA;    BGRA[1] = FtoB(sinf(V &#x2B; t / 10.0f));&#xA;    BGRA[2] = FtoB(sinf(V &#x2B; t / 36e2f));&#xA;    BGRA[3] = 255;&#xA;}&#xA;&#xA;int main()&#xA;{&#xA;    FMovieMaker MovieMaker;&#xA;&#xA;    const char* FileName = "C:\\ffmpeg\\MyMovieMakerMovie.mp4";&#xA;    int Width = 640;&#xA;    int Height = 480;&#xA;    int FPS = 30;&#xA;    int BitRateKBS = 2000;&#xA;&#xA;    if (MovieMaker.Initialize(FileName, Width, Height, FPS, BitRateKBS))&#xA;    {&#xA;        int Size = Width * 4 * Height;&#xA;        uint8_t* BGRAData = new uint8_t[Size];&#xA;        memset(BGRAData, 255, Size);&#xA;&#xA;        for (float Frame = 0; Frame &lt; 60; Frame&#x2B;&#x2B;)&#xA;        {&#xA;            // fill the image data with something interesting&#xA;            for (float Y = 0; Y &lt; Height; Y&#x2B;&#x2B;)&#xA;            {&#xA;                for (float X = 0; X &lt; Width; X&#x2B;&#x2B;)&#xA;                {&#xA;                    SetPixelColor(X, Y, (float)Width, (float)Height, Frame / (float)FPS, &amp;BGRAData[(int)(Y * Width &#x2B; X) * 4]);&#xA;                }&#xA;            }&#xA;&#xA;            if (!MovieMaker.RecordFrame(BGRAData))&#xA;                break;&#xA;        }&#xA;&#xA;        delete[] BGRAData;&#xA;&#xA;        MovieMaker.Finalize();&#xA;    }&#xA;}&#xA;

    &#xA;&#xA;

    If I have the lines that add the AV_CODEC_FLAG_GLOBAL_HEADER flag like shown above, I get all sorts of issues in the output from ffprobe MyMovieMakerMovie.mp4.

    &#xA;&#xA;

    C:\ffmpeg>ffprobe MyMovieMakerMovie.mp4&#xA;ffprobe version 4.2.2 Copyright (c) 2007-2019 the FFmpeg developers&#xA;  built with gcc 9.2.1 (GCC) 20200122&#xA;  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --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&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;[h264 @ 000001d44b795b00] non-existing PPS 0 referenced&#xA;[h264 @ 000001d44b795b00] decode_slice_header error&#xA;[h264 @ 000001d44b795b00] no frame!&#xA;...&#xA;[h264 @ 000001d44b795b00] non-existing PPS 0 referenced&#xA;[h264 @ 000001d44b795b00] decode_slice_header error&#xA;[h264 @ 000001d44b795b00] no frame!&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000001d44b783880] decoding for stream 0 failed&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000001d44b783880] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 640x480, 20528 kb/s): unspecified pixel format&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; and &#x27;probesize&#x27; options&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;MyMovieMakerMovie.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.29.100&#xA;  Duration: 00:00:01.97, start: 0.000000, bitrate: 20529 kb/s&#xA;    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 640x480, 20528 kb/s, 30.51 fps, 30 tbr, 15360 tbn, 30720 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;

    &#xA;&#xA;

    Without adding the AV_CODEC_FLAG_GLOBAL_HEADER flag, I get a clean output from ffprobe, but the video still doesn't play. Notice it thinks the frame rate is 30.51, I'm not sure why.

    &#xA;&#xA;

    C:\ffmpeg>ffprobe MyMovieMakerMovie.mp4&#xA;ffprobe version 4.2.2 Copyright (c) 2007-2019 the FFmpeg developers&#xA;  built with gcc 9.2.1 (GCC) 20200122&#xA;  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --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&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;MyMovieMakerMovie.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.29.100&#xA;  Duration: 00:00:01.97, start: 0.000000, bitrate: 20530 kb/s&#xA;    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480, 20528 kb/s, 30.51 fps, 30 tbr, 15360 tbn, 60 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;

    &#xA;

  • MAINTAINERS : Don't mention Google+

    17 mars 2020, par Andreas Rheinhardt
    MAINTAINERS : Don't mention Google+
    

    It has been shut down in April 2019.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] MAINTAINERS