Menu

#1079 Wrong stream ID in m4v files

Incorrect_result
pending
None
5
2018-01-15
2018-01-13
No

In some m4v files, MediaInfo returns incorrect Id
This is information about the file received by MediaInfo 17.12:
General
Complete name : X:\Work\Recode\Friends\6\09 The One Where Ross Got High (HD).m4v
Format : MPEG-4
Codec ID : M4V (M4V /M4A /mp42/isom)
File size : 1.15 GiB
Duration : 22 min 38 s
Overall bit rate mode : Variable
Overall bit rate : 7 242 kb/s
Collection : Friends
Season : 6
Album : Friends, Season 6
Album/Sorted by : Friends, Season 6
Album/Performer : Friends
Part : 9
Part/Position : 1
Part/Total : 1
Track name : The One Where Ross Got High
Track name/Position : 9
Performer : Friends
Genre : Comedy
ContentType : TV Show
Description : On Thanksgiving, Chandler tries to gain favor with Monica's parents--but an old secret involving Ross causes problems.
Recorded date : UTC 1999-11-25 08:00:00
Encoded date : UTC 2014-12-25 13:00:11
Tagged date : UTC 2014-12-26 14:39:40
Copyright : FRIENDS and all related characters and elements are trademarks of and © Warner Bros. Entertainment Inc.
Cover : Yes
Rating : None
TVNetworkName : NBC
Part_ID : 9
Title/Sort : One Where Ross Got High / Friends
LongDescription : On Thanksgiving, Chandler tries to gain favor with Monica's parents--but an old secret involving Ross causes problems. Undomestic Rachel's dessert proves intriguing.
HDVideo : Yes
AppleStoreCatalogID : 293626700
Vendor : Apple:vendor-id:1999-77044-609

Video #1
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings : 3 Ref Frames
Format settings, CABAC : No
Format settings, RefFrames : 3 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 22 min 37 s
Bit rate : 6 000 kb/s
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 23.976 (23976/1000) FPS
Minimum frame rate : 23.974 FPS
Maximum frame rate : 90 000.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.272
Stream size : 971 MiB (83%)
Title : Main Program
Writing library : x264 core 130 r2273 b3065e6
Encoding settings : cabac=0 / ref=3 / deblock=1:-3:-2 / analyse=0x3:0x113 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.25 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=18 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=1 / weightb=0 / open_gop=0 / weightp=0 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=6000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=9500 / vbv_bufsize=9500 / nal_hrd=none / ip_ratio=1.40 / aq=1:0.80
Language : English
Encoded date : UTC 2014-12-25 13:00:11
Tagged date : UTC 2014-12-25 13:01:17
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Menus : 9,10

Video #2
ID : 10
Format : JPEG
Codec ID : jpeg
Duration : 22 min 37 s
Bit rate mode : Variable
Bit rate : 926 b/s
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 0.003 FPS
Minimum frame rate : 0.002 FPS
Maximum frame rate : 0.030 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Compression mode : Lossy
Bits/(Pixel*Frame) : 1.340
Stream size : 151 KiB (0%)
Title : Chapter Images
Language : English
Default : No
Encoded date : UTC 2014-12-26 14:37:02
Tagged date : UTC 2014-12-26 14:37:02
Menu For : 1

Audio #1
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : mp4a-40-2
Duration : 22 min 38 s
Bit rate mode : Variable
Bit rate : 136 kb/s
Maximum bit rate : 157 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 22.1 MiB (2%)
Title : Russian MVO Stereo
Language : Russian
Default : Yes
Alternate group : 1
Encoded date : UTC 2014-12-25 13:00:11
Tagged date : UTC 2014-12-25 13:01:22
Menus : 9

Audio #2
ID : 3
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : mp4a-40-2
Duration : 22 min 30 s
Bit rate mode : Variable
Bit rate : 132 kb/s
Maximum bit rate : 139 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 21.0 MiB (2%)
Title : Ukrainian MVO Stereo
Language : Ukrainian
Default : No
Alternate group : 1
Encoded date : UTC 2014-12-25 13:00:11
Tagged date : UTC 2014-12-25 13:01:22

Audio #3
ID : 4
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : mp4a-40-2
Duration : 22 min 38 s
Bit rate mode : Variable
Bit rate : 164 kb/s
Maximum bit rate : 225 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 26.6 MiB (2%)
Title : French Stereo
Language : French
Default : No
Alternate group : 1
Encoded date : UTC 2014-12-25 13:00:11
Tagged date : UTC 2014-12-25 13:01:22

Audio #4
ID : 5
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : mp4a-40-2
Duration : 22 min 38 s
Bit rate mode : Variable
Bit rate : 165 kb/s
Maximum bit rate : 246 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 26.7 MiB (2%)
Title : English Stereo
Language : English
Default : No
Alternate group : 1
Encoded date : UTC 2014-12-25 13:00:11
Tagged date : UTC 2014-12-25 13:01:22
Fallback From : 6

Audio #5
ID : 6
Format : AC-3
Format/Info : Audio Coding 3
Codec ID : ac-3
Duration : 22 min 38 s
Bit rate mode : Constant
Bit rate : 640 kb/s
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 104 MiB (9%)
Title : English DD 5.1
Language : English
Service kind : Complete Main
Default : No
Alternate group : 1
Encoded date : UTC 2014-12-25 13:00:11
Tagged date : UTC 2014-12-25 13:00:36
Fallback To : 5

Text #1
ID : 7
Format : Timed Text
Muxing mode : sbtl
Codec ID : tx3g
Duration : 22 min 26 s
Bit rate mode : Variable
Bit rate : 142 b/s
Stream size : 23.4 KiB (0%)
Title : Russian Subtitle
Language : Russian
Default : Yes
Forced : No
Alternate group : 2
Encoded date : UTC 2014-12-25 13:00:11
Tagged date : UTC 2014-12-25 13:00:12

Text #2
ID : 8
Format : Timed Text
Muxing mode : sbtl
Codec ID : tx3g
Duration : 22 min 26 s
Bit rate mode : Variable
Bit rate : 93 b/s
Stream size : 15.3 KiB (0%)
Title : English SDH Subtitle
Language : English
Default : No
Forced : No
Alternate group : 2
Encoded date : UTC 2014-12-26 14:36:44
Tagged date : UTC 2014-12-26 14:36:44

Menu #1
00:00:00.000 : 1
00:02:06.835 : 2
00:11:07.083 : 3
00:22:04.114 : 4

Menu #2
ID : 9
Codec ID : text
Duration : 22 min 37 s
Title : Chapter Titles
Language : English
Encoded date : UTC 2014-12-26 14:37:00
Tagged date : UTC 2014-12-26 14:37:00
Bit rate mode : CBR
Menu For : 2,1
00:00:00.000 : 1
00:02:06.835 : 2
00:11:07.083 : 3
00:22:04.114 : 4

And this information is obtained through ffmpeg:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'x:\Work\Recode\Friends\6\09 The One Where Ross Got High (HD).m4v':
Metadata:
major_brand : M4V
minor_version : 0
compatible_brands: M4V M4A mp42isom
creation_time : 2014-12-25T13:00:11.000000Z
title : The One Where Ross Got High
artist : Friends
album_artist : Friends
album : Friends, Season 6
genre : Comedy
date : 1999-11-25T08:00:00Z
track : 9
disc : 1/1
show : Friends
network : NBC
episode_id : 9
season_number : 6
episode_sort : 9
sort_name : One Where Ross Got High
sort_album : Friends, Season 6
sort_show : Friends
description : On Thanksgiving, Chandler tries to gain favor with Monica's parents--but an old secret involving Ross causes problems.
synopsis : On Thanksgiving, Chandler tries to gain favor with Monica's parents--but an old secret involving Ross causes problems. Undomestic Rachel's dessert proves intriguing.
copyright : FRIENDS and all related characters and elements are trademarks of and ┬й Warner Bros. Entertainment Inc.
hd_video : 1
media_type : 10
rating : 0
Duration: 00:22:38.87, start: 0.000000, bitrate: 7241 kb/s
Chapter #0:0: start 0.000000, end 126.835000
Metadata:
title : 1
Chapter #0:1: start 126.835000, end 667.083000
Metadata:
title : 2
Chapter #0:2: start 667.083000, end 1324.114000
Metadata:
title : 3
Chapter #0:3: start 1324.114000, end 1357.814000
Metadata:
title : 4
Stream #0:0(rus): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 136 kb/s (default)
Metadata:
creation_time : 2014-12-25T13:00:11.000000Z
Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 5996 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2014-12-25T13:00:11.000000Z
encoder : H.264
Stream #0:2(ukr): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 130 kb/s
Metadata:
creation_time : 2014-12-25T13:00:11.000000Z
Stream #0:3(fra): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 164 kb/s
Metadata:
creation_time : 2014-12-25T13:00:11.000000Z
Stream #0:4(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 164 kb/s
Metadata:
creation_time : 2014-12-25T13:00:11.000000Z
Stream #0:5(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 640 kb/s
Metadata:
creation_time : 2014-12-25T13:00:11.000000Z
Side data:
audio service type: main
Stream #0:6(rus): Subtitle: mov_text (tx3g / 0x67337874), 1280x108, 0 kb/s (default)
Metadata:
rotate : 0
creation_time : 2014-12-25T13:00:11.000000Z
Stream #0:7: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 600x600 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
Stream #0:8(eng): Subtitle: mov_text (tx3g / 0x67337874), 1280x108, 0 kb/s
Metadata:
rotate : 0
creation_time : 2014-12-26T14:36:44.000000Z
Stream #0:9(eng): Data: bin_data (text / 0x74786574)
Metadata:
creation_time : 2014-12-26T14:37:00.000000Z
Stream #0:10(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj420p(pc, bt470bg/unknown/unknown), 640x360 [SAR 72:72 DAR 16:9], 0 kb/s, 0.0029 fps, 8.08 tbr, 1k tbn, 1k tbc
Metadata:
creation_time : 2014-12-26T14:37:02.000000Z

Discussion

  • Jerome Martinez

    Jerome Martinez - 2018-01-13

    incorrect Id

    What are the expected IDs and how do you know they are incorrect?

    And this information is obtained through ffmpeg:

    How is it helpful for the issue? (as far as I know, FFmpeg does not display IDs)

     
  • Jerome Martinez

    Jerome Martinez - 2018-01-13
    • status: open --> pending-works-for-me
    • assigned_to: Jerome Martinez
     
  • Rovshan Gasanov

    Rovshan Gasanov - 2018-01-13

    Maybe I'm wrong, but is not the stream 0:1 supposed to be equal to ID 1?
    In the example, MediaInfo Id 1 is a video, and in ffmpeg is audio (rus).
    Rus sub - MediaInfo ID7, ffmpeg 0: 6
    Eng sub - MediaInfo ID8, ffpmeg 0: 9

    I get information about the streams, and then I search, for example, subtitles in English to extract them. To do this, i need to know the number of the specific stream, for this I needed Id.
    I repeat, I can be mistaken if this is so in advance I apologize.

     
  • Jerome Martinez

    Jerome Martinez - 2018-01-13

    Maybe I'm wrong, but is not the stream 0:1 supposed to be equal to ID 1?

    No.
    You are trying to find a match between 2 totally different things.
    - MediaInfo "ID" field displays the stream/track identifier ("track_ID" in MP4 specficiations), can be any random number
    - FFmpeg line displays the stream/track order (how streams/tracks are ordered in the file), starting from 0.

    I get information about the streams, and then I search, for example, subtitles in English to extract them.

    For getting the track order in MediaInfo, check "debug" menu, "advanced monde" (or " -f" with command line, "StreamOrder" with library API), there is a line "Stream Order" which shoud match the second number in FFmpeg.

     
  • Rovshan Gasanov

    Rovshan Gasanov - 2018-01-13

    Oh, thanks for taking the time. It's my fault, I did not fully understand it and hurried to write to you. Once again I'm sorry.

     
    • Jerome Martinez

      Jerome Martinez - 2018-01-13

      No problem

       
  • Jerome Martinez

    Jerome Martinez - 2018-01-13
    • status: pending-works-for-me --> closed-invalid
     
  • Rovshan Gasanov

    Rovshan Gasanov - 2018-01-13

    I'm very sorry, but on output to xml StreamOrder is displayed for everything except subtitles. When output to text or html everything is fine.
    Checked in GUI, CLI, and API

     
  • Rovshan Gasanov

    Rovshan Gasanov - 2018-01-14

    And in some cases, StreamOrder does not match the order that ffpeg returns.
    Here is a comparison of the order of stream:

    Ffmpeg MediaInfo SteamOrder
    0:0 Audio (rus) 0 Audio (rus)
    0:1 Video (h264)l 1 Video
    0:2 Audio (ukr) 2 Audio (ukr)
    0:3 Audio (fra) 3 Audio (fra)
    0:4 Audio (eng) 4 Audio (eng)
    0:5 Audio (eng) 5 Audio (eng)
    0:6 Subtitle (rus) 6 Text (rus)
    0:7 Video (jpg 600x600) 7 Text (eng)
    0:8 Subtitle (eng) 8 Menu (eng)
    0:9 Menu (eng) Video (jpg 640x360)
    0:10 Video (jpg 640x360)

    As you can see from the seventh position, there are discrepancies in the stream numbers. MediaInfo does not show Video (jpg 600x600) outputting the eighth stream Text (eng)
    In the attachment, the output of ffmpeg and MediaInfo is one of these files.

     
    • Jerome Martinez

      Jerome Martinez - 2018-01-14

      Please provide the file (if private content, I don't need the content, just the header)

       
  • Jerome Martinez

    Jerome Martinez - 2018-01-14
    • status: closed-invalid --> pending
     

Log in to post a comment.