Jump to content

MP4 - Stream titles are not shown


Recommended Posts

Sludge Vohaul
Posted

Hi,

 

custom titles for streams/tracks in MKV have been already discussed in

 

https://emby.media/community/index.php?/topic/29047-is-there-a-way-to-display-track-name-if-available/page-1

 

and the feature is working fine for MKV.

 

For MP4 containers custom stream titles are not supported, and the displayed title is the default composition of lang/codec/layout.

 

This is probably due to the fact, that MP4 does not define a title-tag for streams (that's what they say on the internet...).

 

Converting (*1) a MKV having a custom Title for an audio stream to MP4 results in file that somehow contains the title information, as VLC does show it (in "Description") and mediainfo as well (in "Title").

I wasn't able to find it with ffprobe though (but this doesn't say much as I am not good with all these things).

 

Some people seem to be using (*2) the handler_name-tag of a stream for the title. This is obviously visible in ffprobe, but not in VLC (VLC is still showing the value of the original MKV's Title-tag). mediainfo displays both in "Title" (Title: <handler_name-tag value> / <MKV's Title-tag value>).

 

Is it possible to make the MKV's Title-tag value visible with ffprobe in the MP4 container?

 

 

*1:

ffmpeg -i in.mkv -map 0:v -map 0:a -map_metadata 0 -sn -c:v libx264 -preset medium -tune film -profile:v high -level 4.0 -f mp4 out.m4v

 

*2:

ffmpeg -i in.mkv -map 0:v -map 0:a -map_metadata 0 -sn -c:v libx264 -preset medium -tune film -profile:v high -level 4.0 -metadata:s:a:2 handler="asd" -f mp4 out.m4v

 

 

Posted

what is the ffprobe output for this?

Sludge Vohaul
Posted

$ ffprobe out.m4v 

ffprobe version git-2017-02-11-25d9cb4 Copyright © 2007-2017 the FFmpeg developers

  built with Apple LLVM version 8.0.0 (clang-800.0.38)

  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-25d9cb4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --disable-indev=qtkit --enable-libfdk-aac --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-nonfree --enable-vda

  libavutil      55. 46.100 / 55. 46.100

  libavcodec     57. 78.100 / 57. 78.100

  libavformat    57. 66.102 / 57. 66.102

  libavdevice    57.  2.100 / 57.  2.100

  libavfilter     6. 73.100 /  6. 73.100

  libavresample   3.  2.  0 /  3.  2.  0

  libswscale      4.  3.101 /  4.  3.101

  libswresample   2.  4.100 /  2.  4.100

  libpostproc    54.  2.100 / 54.  2.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.m4v':

  Metadata:

    major_brand     : isom

    minor_version   : 512

    compatible_brands: isomiso2avc1mp41

    creation_time   : 2017-03-19T21:49:32.000000Z

    encoder         : Lavf57.66.102

  Duration: 01:40:08.76, start: 0.000000, bitrate: 2 kb/s

    Chapter #0:0: start 0.000000, end 374.920000

    Metadata:

      title           : Chapter 01

    Chapter #0:1: start 374.920000, end 732.160000

    Metadata:

      title           : Chapter 02

    Chapter #0:2: start 732.160000, end 1004.120000

    Metadata:

      title           : Chapter 03

    Chapter #0:3: start 1004.120000, end 1142.960000

    Metadata:

      title           : Chapter 04

    Chapter #0:4: start 1142.960000, end 1436.760000

    Metadata:

      title           : Chapter 05

    Chapter #0:5: start 1436.760000, end 1834.560000

    Metadata:

      title           : Chapter 06

    Chapter #0:6: start 1834.560000, end 2176.720000

    Metadata:

      title           : Chapter 07

    Chapter #0:7: start 2176.720000, end 2565.680000

    Metadata:

      title           : Chapter 08

    Chapter #0:8: start 2565.680000, end 2965.560000

    Metadata:

      title           : Chapter 09

    Chapter #0:9: start 2965.560000, end 3383.120000

    Metadata:

      title           : Chapter 10

    Chapter #0:10: start 3383.120000, end 3723.200000

    Metadata:

      title           : Chapter 11

    Chapter #0:11: start 3723.200000, end 4175.080000

    Metadata:

      title           : Chapter 12

    Chapter #0:12: start 4175.080000, end 4488.120000

    Metadata:

      title           : Chapter 13

    Chapter #0:13: start 4488.120000, end 4796.480000

    Metadata:

      title           : Chapter 14

    Chapter #0:14: start 4796.480000, end 5236.920000

    Metadata:

      title           : Chapter 15

    Chapter #0:15: start 5236.920000, end 6008.760000

    Metadata:

      title           : Chapter 16

    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576 [sAR 64:45 DAR 16:9], 196 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)

    Metadata:

      creation_time   : 2017-03-19T21:49:32.000000Z

      handler_name    : VideoHandler

    Stream #0:1(ger): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 342 kb/s (default)

    Metadata:

      creation_time   : 2017-03-19T21:49:32.000000Z

      handler_name    : SoundHandler

    Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 340 kb/s

    Metadata:

      creation_time   : 2017-03-19T21:49:32.000000Z

      handler_name    : SoundHandler

    Stream #0:3(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 132 kb/s

    Metadata:

      creation_time   : 2017-03-19T21:49:32.000000Z

      handler_name    : asd

    Stream #0:4(eng): Data: bin_data (text / 0x74786574)

    Metadata:

      creation_time   : 2017-03-19T21:49:32.000000Z

      handler_name    : SubtitleHandler

Unsupported codec with id 100359 for input stream 4

Posted

how about with the options -show_streams -show_format -print_format json

Sludge Vohaul
Posted (edited)

$ ffprobe -show_streams -select_streams a:2 -show_format -show_entries format_tags=: -hide_banner -print_format json out.m4v


 


    "streams": [


        {


            "index": 3,


            "codec_name": "aac",


            "codec_long_name": "AAC (Advanced Audio Coding)",


            "profile": "LC",


            "codec_type": "audio",


            "codec_time_base": "1/48000",


            "codec_tag_string": "mp4a",


            "codec_tag": "0x6134706d",


            "sample_fmt": "fltp",


            "sample_rate": "48000",


            "channels": 2,


            "channel_layout": "stereo",


            "bits_per_sample": 0,


            "r_frame_rate": "0/0",


            "avg_frame_rate": "0/0",


            "time_base": "1/48000",


            "start_pts": 0,


            "start_time": "0.000000",


            "duration_ts": 586752,


            "duration": "12.224000",


            "bit_rate": "132333",


            "max_bit_rate": "132333",


            "nb_frames": "574",


            "disposition": {


                "default": 0,


                "dub": 0,


                "original": 0,


                "comment": 0,


                "lyrics": 0,


                "karaoke": 0,


                "forced": 0,


                "hearing_impaired": 0,


                "visual_impaired": 0,


                "clean_effects": 0,


                "attached_pic": 0,


                "timed_thumbnails": 0


            },


            "tags": {


                "creation_time": "2017-03-19T21:49:32.000000Z",


                "language": "eng",


                "handler_name": "asd"


            }


        }


    ],


    "format": {


        "filename": "out.m4v",


        "nb_streams": 5,


        "nb_programs": 0,


        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",


        "format_long_name": "QuickTime / MOV",


        "start_time": "0.000000",


        "duration": "6008.760000",


        "size": "1566257",


        "bit_rate": "2085",


        "probe_score": 100


    }


 


$ mediainfo out.m4v


...


Audio #3


ID                                       : 4


Format                                   : AAC


Format/Info                              : Advanced Audio Codec


Format profile                           : LC


Codec ID                                 : 40


Duration                                 : 12 s 246 ms


Bit rate mode                            : Constant


Bit rate                                 : 132 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                              : 198 KiB (13%)


Title                                    : asd / Regiekommentar


Language                                 : English


Default                                  : No


Alternate group                          : 1


Encoded date                             : UTC 2017-03-19 21:49:32


Tagged date                              : UTC 2017-03-19 21:49:32


Menus                                    : 5

Edited by Sludge Vohaul
Posted

is the title you want in this output?

Sludge Vohaul
Posted

Yes, the MKVs Title-tag for the 3rd audio stream is "Regiekommentar".

 

mediainfo displays it in the "Title" together with the handler_name tag set with ffmpeg's -metadata:s:a:2 handler="asd"

Sludge Vohaul
Posted

Just for completeness' sake here the metadata from the MKV stream.

ffprobe -show_streams -select_streams a:2 -show_entries stream=tags -hide_banner -print_format json in.mkv

    "streams": [

        {

            "disposition": {

                "default": 0,

                "dub": 0,

                "original": 0,

                "comment": 0,

                "lyrics": 0,

                "karaoke": 0,

                "forced": 0,

                "hearing_impaired": 0,

                "visual_impaired": 0,

                "clean_effects": 0,

                "attached_pic": 0,

                "timed_thumbnails": 0

            },

            "tags": {

                "language": "eng",

                "title": "Regiekommentar",

                "BPS": "192000",

                "BPS-eng": "192000",

                "DURATION": "01:40:08.736000000",

                "DURATION-eng": "01:40:08.736000000",

                "NUMBER_OF_FRAMES": "187773",

                "NUMBER_OF_FRAMES-eng": "187773",

                "NUMBER_OF_BYTES": "144209664",

                "NUMBER_OF_BYTES-eng": "144209664",

                "_STATISTICS_WRITING_APP": "mkvmerge v9.9.0 ('Pick Up') 64bit",

                "_STATISTICS_WRITING_APP-eng": "mkvmerge v9.9.0 ('Pick Up') 64bit",

                "_STATISTICS_WRITING_DATE_UTC": "2017-03-19 21:49:32",

                "_STATISTICS_WRITING_DATE_UTC-eng": "2017-03-19 21:49:32",

                "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",

                "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES"

            }

        }

    ]

Posted

the "title" tag is the one we already use.

Sludge Vohaul
Posted

Yes, the title-tag is displayed correctly for MKVs but MP4s show the default (lang/codec/layout), though the information is somewhere inside the file.

 

I thought it should be easy to extract it with ffprobe, but maybe it is not. In case I find it out, I'll post it here...

 

Thanks for your time anyway :) 

Posted

I thought we were looking at example ffprobe data from the mp4 in question?

Sludge Vohaul
Posted

Yes we were.

In #5 is the ffprobe output from the MP4 and in #8 the output of the source MKV.

 

The source MKV has in an audio stream the title-tag "Regiekommentar".

I am not able to make this tag visible in the MP4 file with ffprobe, though it must be there as mediainfo does show it (see #5)

Posted

Ok, I think this might be a question for ffprobe then. If we can get it into their output somehow, then certainly Emby can utilize it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...