Opened 3 months ago

Closed 3 months ago

#7744 closed enhancement (fixed)

adding format_identifier via -tag[:specifier] to MPEGTS

Reported by: zoolog Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: mpegts
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by cehoyos)

Summary of the bug:
I have the TS file, where I can see codec_tag_string setted to HEVC. This file is played by LG, Toshiba etc. tv's. When I'm trying to force this media format identifier to my file with ffmpeg with -vtag param, I can see codec_tag_string in FFmpeg output but the output file stays without changes.

Example file 33-06000.ts with codec_tag_string=HEVC attached.
Input file 5000-000.ts for test attached as well.

ffmpeg version 4.1.1

How to reproduce:

/usr/bin/ffmpeg -hide_banner -i /5000-000.ts -vtag HEVC -vcodec copy -acodec copy -sn -f mpegts 50.ts
Input #0, mpegts, from '/5000-000.ts':
  Duration: 00:00:05.31, start: 1.400000, bitrate: 13307 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 126 kb/s
Output #0, mpegts, to '50.ts':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: hevc (Main 10) (HEVC / 0x43564548), yuv420p10le(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 50 fps, 50 tbr, 90k tbn, 90k tbc
    Stream #0:1(eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 126 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  192 fps=0.0 q=-1.0 Lsize=    9101kB time=00:00:05.26 bitrate=14149.7kbits/s speed= 304x
video:8334kB audio:84kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.112041%
ffprobe -hide_banner 50.ts
Input #0, mpegts, from '50.ts':
  Duration: 00:00:05.31, start: 1.400000, bitrate: 14038 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 126 kb/s

Change History (12)

comment:1 Changed 3 months ago by zoolog

Last edited 3 months ago by cehoyos (previous) (diff)

comment:2 Changed 3 months ago by cehoyos

  • Version changed from 4.1 to unspecified

Please understand that only bug reports against current FFmpeg git head and without the -hide_banner options are valid. The download links you provided do not work here.

The tag option cannot work for all formats, it does not work for mpegts. What is wrong with the output file you get?

comment:3 Changed 3 months ago by zoolog

If it is nessesary, I can show the same bahavior on latest git and without hide_banner, but the main thing is not at that. The main question is how to specify the format identifier to mpegts. Codec tag string is possible and works on mpegts, you can see it on example file I have attached 33-06000.ts
If the download links don't work here, how can I provide it? Filesize is more than 2.5 MB and I cannot attache it here directly. Thank you for the answer

comment:4 Changed 3 months ago by cehoyos

  • Description modified (diff)

The tag option cannot work for all formats, it does not work for mpegts. What is wrong with the output file you get?

comment:5 follow-up: Changed 3 months ago by zoolog

My output file cannot be opened on LG and Toshiba TVs, example file with codec_tag_string=HEVC is played without any problems.

in output file I get I have codec_tag_string=[36][0][0][0]
in example 33-06000.ts file codec_tag_string=HEVC
How can I make "codec_tag_string=HEVC" for output TS file with ffmpeg?

comment:6 in reply to: ↑ 5 Changed 3 months ago by cehoyos

Replying to zoolog:

My output file cannot be opened on LG and Toshiba TVs, example file with codec_tag_string=HEVC is played without any problems.

Did you report this bug to the manufacturers?
Did you test using such a file as input for FFmpeg?

in output file I get I have codec_tag_string=[36][0][0][0]
in example 33-06000.ts file codec_tag_string=HEVC
How can I make "codec_tag_string=HEVC" for output TS file with ffmpeg?

You cannot.

comment:7 Changed 3 months ago by zoolog

Ticket #2162 is related to my topic. How can I request to add this feature?
The field name for TS track is format_identifier.

ISO/IEC 13818-1:2000 clause 2.6.9 specifies format_identifier is a 32-bit value obtained from a Registration Authority as designated by ISO/IEC JTC 1/SC 29

dvbsnooop output for video track:

Stream_type: 36 (0x24) [= ITU-T Rec. H.222.0 | ISO/IEC 13818-1 reserved]
Elementary_PID: 211 (0x00d3)

MPEG-DescriptorTag?: 5 (0x05) [= registration_descriptor]
descriptor_length: 4 (0x04)
format_identifier: 1212503619 (0x48455643) [= see: SC29]

HEVC

Last edited 3 months ago by zoolog (previous) (diff)

comment:8 Changed 3 months ago by zoolog

  • Keywords format_identifier added; vtag removed
  • Status changed from new to open
  • Summary changed from ffmpeg doesn't force vtag to MPEGTS to adding format_identifier via -tag[:specifier] to MPEGTS
  • Type changed from defect to task

comment:9 Changed 3 months ago by zoolog

  • Type changed from task to enhancement

comment:10 Changed 3 months ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords format_identifier removed
  • Priority changed from normal to wish
  • Version changed from unspecified to git-master

comment:11 Changed 3 months ago by zoolog

Now it is working ok

comment:12 Changed 3 months ago by zoolog

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.