Opened 6 years ago

Closed 6 years ago

Last modified 5 years 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 Carl Eugen Hoyos)

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 (14)

comment:1 by zoolog, 6 years ago

Last edited 6 years ago by Carl Eugen Hoyos (previous) (diff)

comment:2 by Carl Eugen Hoyos, 6 years ago

Version: 4.1unspecified

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 by zoolog, 6 years ago

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 by Carl Eugen Hoyos, 6 years ago

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 by zoolog, 6 years ago

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?

in reply to:  5 comment:6 by Carl Eugen Hoyos, 6 years ago

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 by zoolog, 6 years ago

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

Version 1, edited 6 years ago by zoolog (previous) (next) (diff)

comment:8 by zoolog, 6 years ago

Keywords: format_identifier added; vtag removed
Status: newopen
Summary: ffmpeg doesn't force vtag to MPEGTSadding format_identifier via -tag[:specifier] to MPEGTS
Type: defecttask

comment:9 by zoolog, 6 years ago

Type: taskenhancement

comment:10 by Carl Eugen Hoyos, 6 years ago

Component: undeterminedavformat
Keywords: format_identifier removed
Priority: normalwish
Version: unspecifiedgit-master

comment:11 by zoolog, 6 years ago

Now it is working ok

comment:12 by zoolog, 6 years ago

Resolution: fixed
Status: openclosed

comment:13 by Samuel, 5 years ago

@zoolog Well done +1

It seem similar to the issues #2162 and #5837 except that they are about AC-3 descriptor in MPEG-TS.

Do you think that you could fix it the same way?
Regards,

comment:14 by Carl Eugen Hoyos, 5 years ago

The patch was committed as 837f2c97984a259f8fef8be13569f937fa3513f1

Note: See TracTickets for help on using tickets.