Recherche avancée

Médias (0)

Mot : - Tags -/alertes

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (96)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (12421)

  • ffmpeg- number of frames

    11 juin 2018, par ST94

    I am streaming live feed of a webcam from PC A to PC B, both connected to a router. I am streaming the video using ffmpeg and I have the output of the commands I use at A and B as follows,

    Started at Mon Jun 11 12:51:46 CDT 2018
    Input #0, video4linux2,v4l2, from '/dev/video0':
     Duration: N/A, start: 526453.330073, bitrate: 147456 kb/s
       Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video (native))
     Stream #0:0 -> #1:0 (rawvideo (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    No pixel format specified, yuv422p for MPEG-2 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    Output #0, mpegts, to 'tcp://172.16.0.169:50000':
     Metadata:
       encoder         : Lavf57.71.100
       Stream #0:0: Video: mpeg2video (4:2:2), yuv422p, 640x480, q=2-31, 200 kb/s, 30 fps, 90k tbn, 30 tbc
       Metadata:
         encoder         : Lavc57.89.100 mpeg2video
       Side data:
         cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    [Parsed_showinfo_0 @ 0x5633adea81c0] config in time_base: 1/1000000, frame_rate: 30/1
    [Parsed_showinfo_0 @ 0x5633adea81c0] config out time_base: 0/0, frame_rate: 0/0
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:   0 pts:      0 pts_time:0       pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:059C8C1C plane_checksum:[059C8C1C] mean:[128 ] stdev:[28.1 ]
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x5633ade11c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x5633ade11c00] profile High 4:2:2, level 3.0, 4:2:2 8-bit
    [libx264 @ 0x5633ade11c00] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 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=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #1, mp4, to '/home/sana/Desktop/sender_new/sender_mp4/tcp10wf.mp4':
     Metadata:
       encoder         : Lavf57.71.100
       Stream #1:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 640x480, q=-1--1, 30 fps, 15360 tbn, 30 tbc
       Metadata:
         encoder         : Lavc57.89.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:   1 pts:  32000 pts_time:0.032   pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:A8C0B7F7 plane_checksum:[A8C0B7F7] mean:[125 ] stdev:[27.6 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:   2 pts:  63999 pts_time:0.063999 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:F8EAFA02 plane_checksum:[F8EAFA02] mean:[125 ] stdev:[27.6 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:   3 pts:  96003 pts_time:0.096003 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:8349B90A plane_checksum:[8349B90A] mean:[124 ] stdev:[27.6 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:   4 pts: 132004 pts_time:0.132004 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:B67CB4C2 plane_checksum:[B67CB4C2] mean:[124 ] stdev:[27.6 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:   5 pts: 164003 pts_time:0.164003 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:E05C3BA2 plane_checksum:[E05C3BA2] mean:[124 ] stdev:[27.6 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:   6 pts: 195998 pts_time:0.195998 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:2C9F5E9C plane_checksum:[2C9F5E9C] mean:[123 ] stdev:[27.6 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:   7 pts: 232070 pts_time:0.23207 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:46521311 plane_checksum:[46521311] mean:[122 ] stdev:[28.1 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:   8 pts: 264011 pts_time:0.264011 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:C7B37767 plane_checksum:[C7B37767] mean:[122 ] stdev:[28.3 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:   9 pts: 296061 pts_time:0.296061 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:6C1E0DF5 plane_checksum:[6C1E0DF5] mean:[123 ] stdev:[27.6 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  10 pts: 332007 pts_time:0.332007 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:7EDC1257 plane_checksum:[7EDC1257] mean:[124 ] stdev:[26.2 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  11 pts: 364006 pts_time:0.364006 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:F47CF25B plane_checksum:[F47CF25B] mean:[124 ] stdev:[26.7 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  12 pts: 396007 pts_time:0.396007 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:34BEAC53 plane_checksum:[34BEAC53] mean:[124 ] stdev:[27.5 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  13 pts: 432049 pts_time:0.432049 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:44B21C5E plane_checksum:[44B21C5E] mean:[124 ] stdev:[28.1 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  14 pts: 464006 pts_time:0.464006 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:B9449349 plane_checksum:[B9449349] mean:[123 ] stdev:[28.5 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  15 pts: 496010 pts_time:0.49601 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:51C6DCE5 plane_checksum:[51C6DCE5] mean:[123 ] stdev:[28.8 ]
    frame=   16 fps=0.0 q=19.1 q=0.0 size=      92kB time=00:00:00.43 bitrate=1742.3kbits/s speed=0.857x    
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  16 pts: 532019 pts_time:0.532019 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:AD50363E plane_checksum:[AD50363E] mean:[123 ] stdev:[28.9 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  17 pts: 564008 pts_time:0.564008 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:6F75F7A5 plane_checksum:[6F75F7A5] mean:[123 ] stdev:[28.9 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  18 pts: 596009 pts_time:0.596009 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:B3B4DD3A plane_checksum:[B3B4DD3A] mean:[123 ] stdev:[28.9 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  19 pts: 632005 pts_time:0.632005 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:AF98B81C plane_checksum:[AF98B81C] mean:[123 ] stdev:[28.9 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  20 pts: 664012 pts_time:0.664012 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:BD809E30 plane_checksum:[BD809E30] mean:[123 ] stdev:[28.9 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  21 pts: 696073 pts_time:0.696073 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:30C0816F plane_checksum:[30C0816F] mean:[123 ] stdev:[29.0 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  22 pts: 732013 pts_time:0.732013 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:BC8498BA plane_checksum:[BC8498BA] mean:[123 ] stdev:[28.9 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  23 pts: 764070 pts_time:0.76407 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:6828551A plane_checksum:[6828551A] mean:[123 ] stdev:[29.0 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  24 pts: 796014 pts_time:0.796014 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:2C381775 plane_checksum:[2C381775] mean:[123 ] stdev:[29.0 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  25 pts: 832024 pts_time:0.832024 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:B21BA7D8 plane_checksum:[B21BA7D8] mean:[123 ] stdev:[29.0 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  26 pts: 864011 pts_time:0.864011 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:3F170D6F plane_checksum:[3F170D6F] mean:[123 ] stdev:[29.1 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  27 pts: 896015 pts_time:0.896015 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:4F982F14 plane_checksum:[4F982F14] mean:[123 ] stdev:[29.2 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  28 pts: 932073 pts_time:0.932073 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:0BD2826C plane_checksum:[0BD2826C] mean:[123 ] stdev:[29.2 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  29 pts: 964016 pts_time:0.964016 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:1C82D871 plane_checksum:[1C82D871] mean:[123 ] stdev:[29.4 ]
    [Parsed_showinfo_0 @ 0x5633adea81c0] n:  30 pts: 996013 pts_time:0.996013 pos:       -1 fmt:yuyv422 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:073C2E08 plane_checksum:[073C2E08] mean:[123 ] stdev:[29.4 ]
    frame=   31 fps= 31 q=15.3 q=0.0 size=     115kB time=00:00:00.93 bitrate=1012.0kbits/s speed=0.924x
    ......................................
    ......................................
    video:2301kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    [libx264 @ 0x5633ade11c00] frame I:6     Avg QP:20.14  size: 16164
    [libx264 @ 0x5633ade11c00] frame P:356   Avg QP:22.44  size:  1117
    [libx264 @ 0x5633ade11c00] frame B:1053  Avg QP:23.78  size:   221
    [libx264 @ 0x5633ade11c00] consecutive B-frames:  0.7%  0.1%  0.2% 98.9%
    [libx264 @ 0x5633ade11c00] mb I  I16..4: 29.9% 53.6% 16.5%
    [libx264 @ 0x5633ade11c00] mb P  I16..4:  0.6%  0.7%  0.1%  P16..4: 22.6%  1.7%  2.1%  0.0%  0.0%    skip:72.3%
    [libx264 @ 0x5633ade11c00] mb B  I16..4:  0.0%  0.1%  0.0%  B16..8:  8.6%  0.3%  0.0%  direct: 0.1%  skip:90.9%  L0:38.6% L1:59.1% BI: 2.3%
    [libx264 @ 0x5633ade11c00] 8x8 transform intra:54.6% inter:81.7%
    [libx264 @ 0x5633ade11c00] coded y,uvDC,uvAC intra: 48.8% 63.6% 21.7% inter: 0.9% 6.4% 0.1%
    [libx264 @ 0x5633ade11c00] i16 v,h,dc,p:  5% 21%  2% 71%
    [libx264 @ 0x5633ade11c00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 21% 12%  7%  7%  6%  9%  8%  8%
    [libx264 @ 0x5633ade11c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 29%  9%  4%  6%  5% 10%  5%  4%
    [libx264 @ 0x5633ade11c00] i8c dc,h,v,p: 54% 17% 23%  7%
    [libx264 @ 0x5633ade11c00] Weighted P-Frames: Y:1.7% UV:0.8%
    [libx264 @ 0x5633ade11c00] ref P L0: 65.0%  4.9% 21.3%  8.8%  0.0%
    [libx264 @ 0x5633ade11c00] ref B L0: 90.2%  8.5%  1.3%
    [libx264 @ 0x5633ade11c00] ref B L1: 95.3%  4.7%
    [libx264 @ 0x5633ade11c00] kb/s:123.38

    and output at B is as follows,

    `enter code here`Input #0, mpegts, from 'tcp://172.16.0.169:50000?listen':
     Duration: N/A, start: 1.433333, bitrate: N/A
     Program 1
       Metadata:
         service_name    : Service01
         service_provider: FFmpeg
       Stream #0:0[0x100]: Video: mpeg2video (4:2:2) ([2][0][0][0] / 0x0002), yuv422p(tv, progressive), 640x480 [SAR 1:1 DAR 4:3], 30 fps, 30 tbr, 90k tbn, 60 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    [Parsed_showinfo_0 @ 0x564b15967460] config in time_base: 1/90000, frame_rate: 30/1
    [Parsed_showinfo_0 @ 0x564b15967460] config out time_base: 0/0, frame_rate: 0/0
    [Parsed_showinfo_0 @ 0x564b15967460] n:   0 pts:      0 pts_time:0       pos:      564 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:1 type:I checksum:C4C468FE plane_checksum:[D95CF033 55257422 E595049A] mean:[116 133 135 ] stdev:[53.9 21.2 24.8 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - unknown side data type 12 (8 bytes)
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x564b1590fd80] using SAR=1/1
    [libx264 @ 0x564b1590fd80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x564b1590fd80] profile High 4:2:2, level 3.0, 4:2:2 8-bit
    [libx264 @ 0x564b1590fd80] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 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=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to '/home/sana/Desktop/receiver_new/receiver_new_mp4/tcp10wf.mp4':
     Metadata:
       encoder         : Lavf57.71.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 30 fps, 15360 tbn, 30 tbc
       Metadata:
         encoder         : Lavc57.89.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    [Parsed_showinfo_0 @ 0x564b15967460] n:   1 pts:   3000 pts_time:0.0333333 pos:   160740 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:1 type:I checksum:ABE94737 plane_checksum:[9EBD5B29 764AF3E3 D38AF80D] mean:[217 128 130 ] stdev:[29.5 2.8 4.3 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:   2 pts:   6000 pts_time:0.0666667 pos:   180480 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:E0B4988D plane_checksum:[4E367382 03AEE4B1 318F404B] mean:[216 128 130 ] stdev:[30.3 3.5 3.4 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - unknown side data type 12 (8 bytes)
    [Parsed_showinfo_0 @ 0x564b15967460] n:   3 pts:   9000 pts_time:0.1     pos:   197588 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:1 type:I checksum:B1C91876 plane_checksum:[AB0F6A6E 6CC6578E E607566B] mean:[132 129 128 ] stdev:[41.4 3.3 3.2 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:   4 pts:  12000 pts_time:0.133333 pos:   229736 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:8BA7FB44 plane_checksum:[5DEF68EE E8213305 17EB5F51] mean:[132 129 128 ] stdev:[41.4 3.3 3.2 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:   5 pts:  15000 pts_time:0.166667 pos:   231804 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:AD4C2994 plane_checksum:[24819277 A69D34D4 B3CD623A] mean:[132 129 128 ] stdev:[41.4 3.3 3.2 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:   6 pts:  18000 pts_time:0.2     pos:   232556 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:7AD4A9FF plane_checksum:[F2328134 6200B528 45A97394] mean:[109 129 128 ] stdev:[40.2 3.0 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:   7 pts:  21000 pts_time:0.233333 pos:   244588 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:942BD05A plane_checksum:[5ABAA382 B8B0B726 FD1B75A3] mean:[109 129 128 ] stdev:[40.2 3.0 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:   8 pts:  24000 pts_time:0.266667 pos:   245528 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:78F6F66E plane_checksum:[4C33C2B1 E905BB7E 064B7830] mean:[109 129 128 ] stdev:[40.2 3.0 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:   9 pts:  27000 pts_time:0.3     pos:   246092 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:637EFB0B plane_checksum:[D25DC425 30A7BD43 069D7994] mean:[109 129 128 ] stdev:[40.2 3.0 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  10 pts:  30000 pts_time:0.333333 pos:   246656 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:9E78061E plane_checksum:[9C27CBE2 DB4ABF7E 267D7AA0] mean:[109 129 128 ] stdev:[40.2 3.0 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  11 pts:  33000 pts_time:0.366667 pos:   247220 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:08E014FD plane_checksum:[69E7D8AA B0E2C07F 6F557BB6] mean:[109 129 128 ] stdev:[40.2 3.0 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  12 pts:  36000 pts_time:0.4     pos:   247784 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:87DA207B plane_checksum:[2E59E1CF 3AABC10A D1E97D84] mean:[109 129 128 ] stdev:[40.2 3.0 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  13 pts:  39000 pts_time:0.433333 pos:   248348 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:914F3267 plane_checksum:[EBC0F215 BD45C2D3 AC0A7D61] mean:[109 129 128 ] stdev:[40.2 3.0 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  14 pts:  42000 pts_time:0.466667 pos:   248912 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:9948509D plane_checksum:[CC2F0C83 ED75C5A9 210E7E62] mean:[109 129 128 ] stdev:[40.2 3.0 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - unknown side data type 12 (8 bytes)
    [Parsed_showinfo_0 @ 0x564b15967460] n:  15 pts:  45000 pts_time:0.5     pos:   249852 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:1 type:I checksum:2910004A plane_checksum:[534C140D 40CEE6CC 4EF70562] mean:[109 129 128 ] stdev:[40.2 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  16 pts:  48000 pts_time:0.533333 pos:   263200 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:6BBB211A plane_checksum:[78712F93 80CAE91F A3100859] mean:[109 129 128 ] stdev:[40.2 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  17 pts:  51000 pts_time:0.566667 pos:   263952 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:ACF52F6A plane_checksum:[B1EB3C80 4FC8E9A1 9CED093A] mean:[109 129 128 ] stdev:[40.2 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  18 pts:  54000 pts_time:0.6     pos:   264328 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:18206027 plane_checksum:[31466208 09F60A1D 12DAF3F3] mean:[113 129 128 ] stdev:[40.6 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  19 pts:  57000 pts_time:0.633333 pos:   268276 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:64B67919 plane_checksum:[685A7A8E 3EC50A6E 33B6F40E] mean:[113 129 128 ] stdev:[40.6 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  20 pts:  60000 pts_time:0.666667 pos:   268652 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:2EDF8D96 plane_checksum:[C5478D34 E97E0AD1 A102F582] mean:[113 129 128 ] stdev:[40.6 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  21 pts:  63000 pts_time:0.7     pos:   269216 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:26113995 plane_checksum:[17BE2921 F51A1C4A C9D2F41B] mean:[114 129 128 ] stdev:[40.9 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  22 pts:  66000 pts_time:0.733333 pos:   272224 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:CAA9871C plane_checksum:[943974ED 7B351CE2 0458F53E] mean:[114 129 128 ] stdev:[40.9 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  23 pts:  69000 pts_time:0.766667 pos:   272788 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:C0C1DBB3 plane_checksum:[C2FEC442 0FE01EA7 057AF8BB] mean:[114 129 128 ] stdev:[40.8 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  24 pts:  72000 pts_time:0.8     pos:   273728 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:924A4994 plane_checksum:[833C2885 BD2A22BB B2DBFE45] mean:[115 129 128 ] stdev:[40.8 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  25 pts:  75000 pts_time:0.833333 pos:   274668 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:9451D3A0 plane_checksum:[169CAC73 177C25E0 C23E014D] mean:[115 129 128 ] stdev:[40.7 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  26 pts:  78000 pts_time:0.866667 pos:   275232 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:49A639A2 plane_checksum:[4DF60BD9 821F2A4F 108D037A] mean:[115 129 128 ] stdev:[40.7 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - unknown side data type 12 (8 bytes)
    [Parsed_showinfo_0 @ 0x564b15967460] n:  27 pts:  81000 pts_time:0.9     pos:   276172 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:1 type:I checksum:FC6359F1 plane_checksum:[B3915D35 4B0DE947 7F961366] mean:[116 129 128 ] stdev:[40.3 2.9 3.1 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  28 pts:  84000 pts_time:0.933333 pos:   286700 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:B39C9D3F plane_checksum:[34749CEA BA34EAFC E248154A] mean:[116 129 128 ] stdev:[40.2 2.9 3.1 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  29 pts:  87000 pts_time:0.966667 pos:   287264 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:97FED800 plane_checksum:[300AD70C 0EBEEB31 DEE515B4] mean:[116 129 128 ] stdev:[40.2 2.9 3.0 ]
    [Parsed_showinfo_0 @ 0x564b15967460]   side data - pan/scan
    [Parsed_showinfo_0 @ 0x564b15967460] n:  30 pts:  90000 pts_time:1       pos:   287828 fmt:yuv422p sar:1/1 s:640x480 i:P iskey:0 type:P checksum:B278FBDC plane_checksum:[6094F812 B757EBEF 839F17CC] mean:[116 129 128 ] stdev:[40.2 2.9 3.0 ]
    ................................
    ..................................
    frame= 1415 fps= 34 q=-1.0 Lsize=    1047kB time=00:00:47.06 bitrate= 182.2kbits/s speed=1.12x    
    video:1032kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.490835%
    [libx264 @ 0x55b73dba9fc0] frame I:6     Avg QP:16.30  size:  9839
    [libx264 @ 0x55b73dba9fc0] frame P:591   Avg QP:20.05  size:  1380
    [libx264 @ 0x55b73dba9fc0] frame B:818   Avg QP:22.29  size:   221
    [libx264 @ 0x55b73dba9fc0] consecutive B-frames: 20.8%  5.2%  3.0% 71.0%
    [libx264 @ 0x55b73dba9fc0] mb I  I16..4: 47.5% 49.8%  2.8%
    [libx264 @ 0x55b73dba9fc0] mb P  I16..4:  1.7%  4.8%  0.2%  P16..4: 12.0%  2.2%  2.9%  0.0%  0.0%    skip:76.1%
    [libx264 @ 0x55b73dba9fc0] mb B  I16..4:  0.2%  0.4%  0.0%  B16..8: 14.5%  0.2%  0.0%  direct: 0.4%  skip:84.3%  L0:60.3% L1:39.3% BI: 0.5%
    [libx264 @ 0x55b73dba9fc0] 8x8 transform intra:67.9% inter:92.5%
    [libx264 @ 0x55b73dba9fc0] coded y,uvDC,uvAC intra: 44.0% 48.3% 1.9% inter: 1.5% 3.6% 0.1%
    [libx264 @ 0x55b73dba9fc0] i16 v,h,dc,p: 20% 61% 14%  5%
    [libx264 @ 0x55b73dba9fc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 22% 52%  2%  0%  0%  1%  1%  7%
    [libx264 @ 0x55b73dba9fc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 52% 33%  8%  2%  1%  1%  1%  1%  1%
    [libx264 @ 0x55b73dba9fc0] i8c dc,h,v,p: 47% 23% 28%  3%
    [libx264 @ 0x55b73dba9fc0] Weighted P-Frames: Y:0.3% UV:0.2%
    [libx264 @ 0x55b73dba9fc0] ref P L0: 82.7%  6.2%  7.6%  3.5%  0.0%
    [libx264 @ 0x55b73dba9fc0] ref B L0: 71.7% 22.3%  6.1%
    [libx264 @ 0x55b73dba9fc0] ref B L1: 93.6%  6.4%
    [libx264 @ 0x55b73dba9fc0] kb/s:179.05`

    I have skipped few lines of output as there are many frames. So if you see at the end of output on both A and B sides and look at the number of I, P and B frames,the number of P and B frames on receiver B is more than that at sender A. Can anyone please tell me why there is a change in the number of frames ?

  • What ffmpeg settings to ensure 0 duplicate frames and 0 dropped frames when capturing to mpeg-2 program stream using ffmpeg/avfoundation on Mac ?

    16 février 2017, par aerodavo

    I’m trying to capture to a DVD compliant mpeg-2 file (ffmpeg : -target ntsc-dvd) from the HDMI output of a camcorder into a Magewell HDMI to USB 3.0 box into my Late 2012 15" non-retina MacBook Pro (quad core 2.3, 16gb ram, ssd), using ffmpeg/avfoundation.

    I’ve tried everything I can think of, or find online. I’m still getting duplicate and dropped frames, which either leads to audio/video sync issues, or audio dropouts, especially for longer recordings. I need this to be stable for recordings of up to 2.5 hours. This is the Terminal output for a 1.5 hour recording :

    Lapaki:~ Lapaki$ /Users/Lapaki/Desktop/ffmpeg -f avfoundation -video_size 960x540 -pixel_format uyvy422 -framerate ntsc -i "XI:XI" -vf crop=iw-240:ih:120:0 -target ntsc-dvd -aspect 4:3 -q:v 3 -ab 256k /Users/Lapaki/Desktop/FF\ Test/`date +%F`\ `date +%H_%M_%S`.mpg
    ffmpeg version 3.2.3-tessus Copyright (c) 2000-2017 the FFmpeg developers
     built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
     configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    Input #0, avfoundation, from 'XI:XI':
     Duration: N/A, start: 610606.984208, bitrate: N/A
       Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 960x540, 29.97 fps, 29.97 tbr, 1000k tbn, 1000k tbc
       Stream #0:1: Audio: pcm_f32le, 48000 Hz, stereo, flt, 3072 kb/s
    Output #0, dvd, to '/Users/Lapaki/Desktop/FF Test/2017-02-15 17_46_28.mpg':
     Metadata:
       encoder         : Lavf57.56.101
       Stream #0:0: Video: mpeg2video (Main), yuv420p, 720x480 [SAR 8:9 DAR 4:3], q=2-31, 6000 kb/s, 29.97 fps, 90k tbn, 29.97 tbc
       Metadata:
         encoder         : Lavc57.64.101 mpeg2video
       Side data:
         cpb: bitrate max/min/avg: 9000000/0/6000000 buffer size: 1835008 vbv_delay: -1
       Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
       Metadata:
         encoder         : Lavc57.64.101 ac3
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video (native))
     Stream #0:1 -> #0:1 (pcm_f32le (native) -> ac3 (native))
    Press [q] to stop, [?] for help
    [swscaler @ 0x7fd315892800] Warning: data is not aligned! This can lead to a speedloss
    frame=   20 fps=0.0 q=3.0 size=     298kB time=00:00:00.65 bitrate=3721.4kbits/sframe=   35 fps= 35 q=3.0 size=     498kB time=00:00:01.13 bitrate=3591.2kbits/sframe=   50 fps= 33 q=3.0 size=     708kB time=00:00:01.64 bitrate=3519.4kbits/sframe=   65 fps= 32 q=3.0 size=     920kB time=00:00:02.16  
    ...
    bitrate=2721.7kbits/frame=162094 fps= 30 q=3.0 size= 1796936kB time=01:30:08.47 bitrate=2721.7kbits/frame=162109 fps= 30 q=3.0 size= 1797142kB time=01:30:08.98 bitrate=2721.8kbits/frame=162110 fps= 30 q=3.0 Lsize= 1797202kB time=01:30:09.01 bitrate=2721.9kbits/s dup=221 drop=0 speed=   1x    
    video:1579050kB audio:168069kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.866632%

    I deleted the middle part (denoted by the "..."), which is just a lot more of the same accumulating information. By the end there are 221 duplicate frames, and for this one I didn’t get any dropped frames, but that happens every other time as well it seems.

    With this code, the audio seems to stay in pretty good sync, but I get little dropouts every 30 seconds to a minute or so. On this recording, there are dropouts at :

    00:00:43, 00:01:19, 00:01:47, 00:02:17, 00:03:18, ...

    I stopped listening there ; they happen at the end too, so I assume similarly spaced dropouts are happening throughout the file.

    Is there some secret ffmpeg code to ensure there are no dropped or duplicate frames when capturing from a live source to dvd compliant mpeg-2 files ?

    When I convert from pretty much any type of file to mpeg-2 files using -target ntsc-dvd, the speed is something like 10x on this machine, so it seems like it would have no problem keeping up with a live source, right ?

    I’ve also tried constant bit rate using -b:v 5000k -minrate 5000k -maxrate 5000k -bufsize 2500k, which also doesn’t prevent dropped/duplicate frames.

    I’ve tried separating out the audio and video inputs, which doesn’t solve it.

    I’ve tried using -vsync 0 on the video input, which does seem to solve the issue, because the output doesn’t report dups/drops, but the audio/video drift out of sync more and more, so that hasn’t worked either.

    Thanks so much for any help. I’ve been testing and testing and searching and searching for weeks...

  • FFmpeg encoding produces slightly incompatible MKV/MP4 container

    11 juin 2018, par james2048

    I’ve been using the FFmpeg libraries to read and write media files using the C API.

    So far, reading seems to be pretty straightforward. I am able to read frames which I can then process, convert to RGB, process, and then convert back to YUV420 to be encoded.

    The encoded files play back with VLC media player fine, and Windows Media Player if I have a codec pack installed. However, they do behave strangely : the stock Windows 10 player won’t play them, same for Adobe Premiere. Also thumbnailers don’t work on it.
    Basically it seems like nothing other than VLC or FFmpeg itself can play/process the file. I have seen this with both MP4 and MKV, so it is not a format-specific issue.

    The problems go away once you remux the file with FFmpeg, for example "ffmpeg -i input.mkv -c copy output.mkv". Everything can play the file correctly.
    Also, the "remuxing.c" sample from the official samples works as well, with the same library version and compilers that I’m using (Visual Studio 2017, FFmpeg compiled with MinGW). It will fix the file and make it playable in all software.

    I’m not sure what could be causing this. I also don’t understand what the remuxing "fixed". It must be a container issue as the frames aren’t touched by remuxing.
    I have analysed the output MKVs with FFprobe -show_packets. It seems to have budged the packet timestamps a little constant factor, and the output stream now has
    is_avc=true and nal_length_size=4 instead of is_avc=false and nal_length_size=0, but apart from that the files are identical.

    Now here’s the output of FFprobe with the 3 last test packets, stream info and format info for both streams. As you can see, they are identical except for a couple of field. But something in here must have been "fixed" during remuxing to make it work.

    [PACKET]
    codec_type=video
    stream_index=0
    pts=59050
    pts_time=59.050000
    dts=58890
    dts_time=58.890000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=427
    pos=277358
    flags=__
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=58970
    pts_time=58.970000
    dts=58970
    dts_time=58.970000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=205
    pos=277792
    flags=__
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=59130
    pts_time=59.130000
    dts=59050
    dts_time=59.050000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=268
    pos=278004
    flags=__
    [/PACKET]
    [STREAM]
    index=0
    codec_name=h264
    codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    profile=Main
    codec_type=video
    codec_time_base=1/2000
    codec_tag_string=[0][0][0][0]
    codec_tag=0x0000
    width=720
    height=576
    coded_width=720
    coded_height=576
    has_b_frames=2
    sample_aspect_ratio=N/A
    display_aspect_ratio=N/A
    pix_fmt=yuv420p
    level=50
    color_range=unknown
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=left
    field_order=progressive
    timecode=N/A
    refs=1
    is_avc=false
    nal_length_size=0
    id=N/A
    r_frame_rate=299/12
    avg_frame_rate=1000/1
    time_base=1/1000
    start_pts=0
    start_time=0.000000
    duration_ts=N/A
    duration=N/A
    bit_rate=N/A
    max_bit_rate=N/A
    bits_per_raw_sample=8
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=737
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:DURATION=00:00:59.211000000
    [/STREAM]
    [FORMAT]
    filename=testEncLeft.mkv
    nb_streams=1
    nb_programs=0
    format_name=matroska,webm
    format_long_name=Matroska / WebM
    start_time=0.000000
    duration=59.211000
    size=278349
    bit_rate=37607
    probe_score=100
    TAG:COMMENT=Slickline Player Export
    TAG:ENCODER=Lavf57.83.100
    [/FORMAT]

    And the info after remuxing, which works :

    [PACKET]
    codec_type=video
    stream_index=0
    pts=59050
    pts_time=59.050000
    dts=58890
    dts_time=58.890000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=427
    pos=277418
    flags=__
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=58970
    pts_time=58.970000
    dts=58970
    dts_time=58.970000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=205
    pos=277852
    flags=__
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=59130
    pts_time=59.130000
    dts=59050
    dts_time=59.050000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=268
    pos=278064
    flags=__
    [/PACKET]
    [STREAM]
    index=0
    codec_name=h264
    codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    profile=Main
    codec_type=video
    codec_time_base=1/2000
    codec_tag_string=[0][0][0][0]
    codec_tag=0x0000
    width=720
    height=576
    coded_width=720
    coded_height=576
    has_b_frames=2
    sample_aspect_ratio=N/A
    display_aspect_ratio=N/A
    pix_fmt=yuv420p
    level=50
    color_range=unknown
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=left
    field_order=progressive
    timecode=N/A
    refs=1
    is_avc=true
    nal_length_size=4
    id=N/A
    r_frame_rate=299/12
    avg_frame_rate=1000/1
    time_base=1/1000
    start_pts=0
    start_time=0.000000
    duration_ts=N/A
    duration=N/A
    bit_rate=N/A
    max_bit_rate=N/A
    bits_per_raw_sample=8
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=737
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:DURATION=00:00:59.212000000
    [/STREAM]
    [FORMAT]
    filename=fixedLeft.mkv
    nb_streams=1
    nb_programs=0
    format_name=matroska,webm
    format_long_name=Matroska / WebM
    start_time=0.000000
    duration=59.212000
    size=278409
    bit_rate=37615
    probe_score=100
    TAG:COMMENT=Slickline Player Export
    TAG:ENCODER=Lavf58.12.100
    [/FORMAT]

    Here is how I’m setting up the output context, for reference : it’s pretty standard, following the sample code.

    int ret;

    avformat_alloc_output_context2(&outputFormatCtx, nullptr, nullptr, outFilePath.c_str());

    av_dict_set(&outputFormatCtx->metadata, "comment", "FFmpeg Export", 0);

    if (!outputFormatCtx)
    {
       LOG_AND_THROW("Could not allocate output context");
    }

    outputVideoStream = avformat_new_stream(outputFormatCtx, nullptr);
    outputVideoStream->time_base = AVRational{ 1, AV_TIME_BASE }; // Stream timebase will be used by codec

    if (!outputVideoStream)
    {
       LOG_AND_THROW("Failed allocating output stream");
    }

    // defaults to "libx264"
    AVCodec *outCodec = avcodec_find_encoder_by_name(selectedCodecName.c_str());

    if (!outCodec)
    {
       LOG_AND_THROW("Failed finding output codec");
    }

    AVDictionary *opts = nullptr;

    if (selectedCodecName == "libx264")
    {
       opts = getX264CodecOptions();
    }

    encoderCtx = avcodec_alloc_context3(outCodec);

    if (!encoderCtx)
    {
       LOG_AND_THROW("Failed to allocate the encoder context");
    }

    encoderCtx->width = width;
    encoderCtx->height = height;
    encoderCtx->pix_fmt = AV_PIX_FMT_YUV420P;
    // time base for the frames we will provide to the encoder
    encoderCtx->time_base = AVRational{ 1, AV_TIME_BASE };
    // convert framerate from double to rational
    encoderCtx->framerate = AVRational{ (int)(frameRate * AV_TIME_BASE), AV_TIME_BASE};

    // Match encoderCtx time base for the stream
    outputVideoStream->time_base = encoderCtx->time_base;

    ret = avcodec_open2(encoderCtx, outCodec, &opts);

    if (ret < 0)
    {
       LOG_AND_THROW_PARAM("Cannot open video encoder for stream: %d", ret);
    }

    // Fill in some params for MP4 stream, details about encoder
    ret = avcodec_parameters_from_context(outputVideoStream->codecpar, encoderCtx);

    if (ret < 0)
    {
       LOG_AND_THROW_PARAM("Failed to copy encoder parameters to output stream: %d", ret);
    }

    if (outputFormatCtx->oformat->flags & AVFMT_GLOBALHEADER)
    {
       encoderCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
    }

    av_dump_format(outputFormatCtx, 0, filePath.c_str(), 1);

    // End of encoder settings, setting up MP4
    if (!(outputFormatCtx->oformat->flags & AVFMT_NOFILE))
    {
       ret = avio_open(&outputFormatCtx->pb, outFilePath.c_str(), AVIO_FLAG_WRITE);

       if (ret < 0)
       {
           LOG_AND_THROW_PARAMSTR("Could not open output file '%s'", outFilePath.c_str());
       }
    }

    ret = avformat_write_header(outputFormatCtx, nullptr);

    if (ret < 0)
    {
       LOG_AND_THROW_PARAM("Error occurred when opening output file for writing: %d", ret);
    }

    Can anyone help me figure out why the container is not playing properly ?

    Thanks in advance.

    -James