Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#9114 closed defect (invalid)

[MPEG-TS] Metadata tables not copied when remuxing to .ts container

Reported by: droid-xx Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: mpegts
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

MPEG-2 PSI tables not copied over:
CAT

DVB SI tables not copied (and probably more which I couldn't verify):
AIT, EIT, NIT, TDT, TOT

As far as I can tell only SDT is copied when -map_metadata 0:p is added, otherwise an SDT is created with default service name & provider fields.

Perhaps this is intended behavior and it's not in ffmpeg's scope to copy all these tables, but -map_metadata should at least include some more tables like NIT.

Sample .ts container with SDT and NIT:
https://github.com/aventuri/opencaster/tree/master/tutorials/start-here

Change History (10)

comment:1 by droid-xx, 3 years ago

Example command line output when remuxing above .ts container (only SDT is copied):

ffmpeg -i input.ts -map 0 -map_metadata 0:p -c copy output.ts
ffmpeg version N-100860-gc31a7d07f6-ffmpeg-windows-build-helpers Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (GCC)
  configuration: --pkg-config=pkg-config --pkg-config-flags=--static --extra-version=ffmpeg-windows-build-helpers --enable-version3 --disable-debug --disable-w32threads --arch=x86 --target-os=mingw32 --cross-prefix=/home/anton/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32- --enable-libcaca --enable-gray --enable-libtesseract --enable-fontconfig --enable-gmp --enable-gnutls --enable-libass --enable-libbluray --enable-libbs2b --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libvorbis --enable-libwebp --enable-libzimg --enable-libzvbi --enable-libmysofa --enable-libopenjpeg --enable-libopenh264 --enable-liblensfun --enable-libvmaf --enable-libsrt --enable-demuxer=dash --enable-libxml2 --enable-opengl --enable-libdav1d --enable-cuda-llvm --enable-libaom --enable-libvpx --enable-nvenc --enable-nvdec --extra-libs=-lharfbuzz --extra-libs=-lm --extra-libs=-lpthread --extra-cflags=-DLIBTWOLAME_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-cflags=-DCACA_STATIC --enable-amf --enable-libmfx --enable-gpl --enable-frei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-libx264 --enable-libx265 --enable-avisynth --enable-libaribb24 --enable-libxvid --enable-libdavs2 --enable-libxavs --enable-avresample --extra-cflags='-mtune=generic' --extra-cflags=-O3 --enable-static --disable-shared --prefix=/home/anton/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32
  libavutil      56. 64.100 / 56. 64.100
  libavcodec     58.119.100 / 58.119.100
  libavformat    58. 65.101 / 58. 65.101
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7.100.100 /  7.100.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, mpegts, from 'input.ts':
  Duration: 00:00:07.97, start: 0.220000, bitrate: 13307 kb/s
  Program 1 
    Metadata:
      service_name    : Avalpa 1
      service_provider: Avalpa
    Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 720x576 [SAR 16:15 DAR 4:3], 2000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Side data:
      cpb: bitrate max/min/avg: 2000000/0/0 buffer size: 1835008 vbv_delay: N/A
    Stream #0:1[0x814]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 128 kb/s
Output #0, mpegts, to 'output.ts':
  Metadata:
    service_name    : Avalpa 1
    service_provider: Avalpa
    encoder         : Lavf58.65.101
    Stream #0:0: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 720x576 [SAR 16:15 DAR 4:3], q=2-31, 2000 kb/s, 25 fps, 25 tbr, 90k tbn, 90k tbc
    Side data:
      cpb: bitrate max/min/avg: 2000000/0/0 buffer size: 1835008 vbv_delay: N/A
    Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=  200 fps=0.0 q=-1.0 Lsize=    2156kB time=00:00:15.88 bitrate=1111.6kbits/s speed= 999x    
video:1933kB audio:125kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.787599%

comment:2 by Carl Eugen Hoyos, 3 years ago

Keywords: dvb metadata removed
Resolution: invalid
Status: newclosed

To the best of my knowledge, this is a misunderstanding wrt how FFmpeg works.

in reply to:  2 comment:3 by Carl Eugen Hoyos, 3 years ago

Replying to cehoyos:

To the best of my knowledge, this is a misunderstanding wrt how FFmpeg works.

and what FFmpeg is.

comment:4 by droid-xx, 3 years ago

Which part is a misunderstanding? There's a .ts container with a NIT. If you want to make a change, add a stream, modify a disposition, or whatever, will result in a .ts container without the NIT. So, network name is gone for example, whereas -map_metadata will preserve SDT. It could also preserve NIT (as an example)...

https://lists.ffmpeg.org/pipermail/ffmpeg-user/2013-November/018425.html

ffmpeg will also drop other information as well from the input .ts container, e.g. a lot of descriptors are gone insted of copied over (not described in this ticket). Isn't that something that should be fixed?

comment:5 by droid-xx, 3 years ago

Resolution: invalid
Status: closedreopened

comment:6 by droid-xx, 3 years ago

Re-opening this so that my recent comment is not lost.
I won't re-open this again if you insist to mark it as invalid.

comment:7 by Carl Eugen Hoyos, 3 years ago

Resolution: invalid
Status: reopenedclosed

comment:8 by droid-xx, 3 years ago

Thank you for clarifying things ;)

comment:9 by Balling, 3 years ago

You can use TransEdit 4.2.1.1 to see this stuff.

There is PAT, NIT, SDT...

comment:10 by droid-xx, 3 years ago

I can use several tools to see the tables. It's not about seeing this stuff but about preserving it in the output.

Note: See TracTickets for help on using tickets.