[FFmpeg-user] Change container/encoder used to create a file without re-encoding

Moritz Barsnick barsnick at gmx.net
Sat Jun 8 23:42:45 EEST 2019


On Sat, Jun 08, 2019 at 15:37:25 -0300, Carlos M wrote:
> But the TSC is not added. It does remove though the "writing application"
> information, that was one of the things i was looking.
>
> I read somewhere that "-movflags +use_metadata_tags" is only for MOV, maybe
> s not fully implemented for MP4?

Works for me (also with 4.1, in case you're wondering):

barsnick at sunshine:~ > ffmpeg -f lavfi -i testsrc -movflags +use_metadata_tags -metadata TSC=1001 -t 1 output.mp4
ffmpeg version N-93939-g819ed1d Copyright (c) 2000-2019 the FFmpeg developers
  built with icc (ICC) 14.0.3 20140422
  configuration: --prefix=/usr/new/tools/video/install/ffmpeg/2019-05-28 --cc=icc --cxx=icpc --enable-gpl --enable-version3 --enable-nonfree --disable-shared --enable-gnutls --enable-libcdio --enabl
e-libfreetype --enable-libx264 --enable-libvpx --enable-libmp3lame --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtwolame --enable-librtmp --enable-libass --enable
-libv4l2 --enable-libvidstab --enable-libfdk-aac --enable-libsmbclient --enable-libzvbi --enable-libtesseract --enable-libzmq --enable-libopus --enable-libcodec2 --enable-libxml2 --enable-libopencv
  libavutil      56. 28.100 / 56. 28.100
  libavcodec     58. 52.102 / 58. 52.102
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 54.101 /  7. 54.101
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, lavfi, from 'testsrc':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 0xa6bba40] Warning: data is not aligned! This can lead to a speed loss
[libx264 @ 0xa6b7a40] using SAR=1/1
[libx264 @ 0xa6b7a40] using cpu capabilities: MMX2 SSE2 Cache64
[libx264 @ 0xa6b7a40] profile High 4:4:4 Predictive, level 1.3, 4:4:4 8-bit
[libx264 @ 0xa6b7a40] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 p
sy_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=4 threads=3 lookahead_threads=1 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 mbt
ree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    TSC             : 1001
    encoder         : Lavf58.27.103
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv444p, 320x240 [SAR 1:1 DAR 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.52.102 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=   25 fps=0.0 q=-1.0 Lsize=       8kB time=00:00:00.88 bitrate=  78.2kbits/s speed=1.33x
video:7kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 16.182629%
[libx264 @ 0xa6b7a40] frame I:1     Avg QP:19.65  size:  2872
[libx264 @ 0xa6b7a40] frame P:8     Avg QP:17.53  size:   361
[libx264 @ 0xa6b7a40] frame B:16    Avg QP:14.57  size:    61
[libx264 @ 0xa6b7a40] consecutive B-frames: 12.0%  0.0% 24.0% 64.0%
[libx264 @ 0xa6b7a40] mb I  I16..4: 30.3% 42.3% 27.3%
[libx264 @ 0xa6b7a40] mb P  I16..4:  1.3%  1.6%  0.3%  P16..4:  9.5%  3.3%  1.9%  0.0%  0.0%    skip:82.2%
[libx264 @ 0xa6b7a40] mb B  I16..4:  0.2%  0.1%  0.0%  B16..8:  4.3%  0.1%  0.0%  direct: 0.2%  skip:95.0%  L0:49.3% L1:46.4% BI: 4.3%
[libx264 @ 0xa6b7a40] 8x8 transform intra:43.8% inter:52.9%
[libx264 @ 0xa6b7a40] coded y,u,v intra: 12.0% 11.4% 11.1% inter: 0.8% 0.9% 0.7%
[libx264 @ 0xa6b7a40] i16 v,h,dc,p: 67% 23%  4%  7%
[libx264 @ 0xa6b7a40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 69%  8% 23%  0%  0%  0%  0%  0%  0%
[libx264 @ 0xa6b7a40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 51% 25% 17%  2%  1%  1%  0%  2%  0%
[libx264 @ 0xa6b7a40] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0xa6b7a40] ref P L0: 65.5%  7.7% 21.7%  5.1%
[libx264 @ 0xa6b7a40] ref B L0: 64.9% 32.0%  3.1%
[libx264 @ 0xa6b7a40] ref B L1: 95.4%  4.6%
[libx264 @ 0xa6b7a40] kb/s:53.83
barsnick at sunshine:~ > ffmpeg -i output.mp4
ffmpeg version N-93939-g819ed1d Copyright (c) 2000-2019 the FFmpeg developers
  built with icc (ICC) 14.0.3 20140422
  configuration: --prefix=/usr/new/tools/video/install/ffmpeg/2019-05-28 --cc=icc --cxx=icpc --enable-gpl --enable-version3 --enable-nonfree --disable-shared --enable-gnutls --enable-libcdio --enabl
e-libfreetype --enable-libx264 --enable-libvpx --enable-libmp3lame --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtwolame --enable-librtmp --enable-libass --enable
-libv4l2 --enable-libvidstab --enable-libfdk-aac --enable-libsmbclient --enable-libzvbi --enable-libtesseract --enable-libzmq --enable-libopus --enable-libcodec2 --enable-libxml2 --enable-libopencv
  libavutil      56. 28.100 / 56. 28.100
  libavcodec     58. 52.102 / 58. 52.102
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 54.101 /  7. 54.101
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    TSC             : 1001
    encoder         : Lavf58.27.103
  Duration: 00:00:01.00, start: 0.000000, bitrate: 68 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 320x240 [SAR 1:1 DAR 4:3], 59 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
At least one output file must be specified


Moritz


More information about the ffmpeg-user mailing list