ExMP4.Reader.Display (MP4 Reader and Writer v0.10.0)

View Source

Show information about MP4 files and tracks using TableRex.

To use this module, you need to add table_rex to your dependencies.

To show basic information about the whole movie

ExMP4.Reader.Display.movie_info(reader) |> IO.puts()

+--------------------------------------------------------+
|                       Movie Info                       |
+===========================+============================+
| Duration / Timescale      | 2759320/1000 (0:45:59.320) |
| Brands (major/compatible) | mp42,isom,mp42             |
| Progressive               | true                       |
| Fragmented                | false                      |
| Creation Date             | 1904-01-01 00:00:00Z       |
| Modification Date         | 1904-01-01 00:00:00Z       |
+---------------------------+----------------------------+

Or to show a description of the tracks

ExMP4.Reader.Display.tracks_info(reader) |> IO.puts()

+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                     Video track(s) info                                                                     |
+====+=======================+========================+===========+===================+================+=======+=======+========+=============+===============+
| ID | Presentation Duration | Duration               | Timescale | Number of Samples | Bitrate (kbps) | Codec | Width | Height | Sample Rate | Channel Count |
+----+-----------------------+------------------------+-----------+-------------------+----------------+-------+-------+--------+-------------+---------------+
| 1  | 2759320 - 0:45:59.320 | 35319296 - 0:45:59.320 | 12800     | 68983             | 1684           | H264  | 1920  | 816    |             |               |
+----+-----------------------+------------------------+-----------+-------------------+----------------+-------+-------+--------+-------------+---------------+
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                     Audio track(s) info                                                                      |
+====+=======================+=========================+===========+===================+================+=======+=======+========+=============+===============+
| ID | Presentation Duration | Duration                | Timescale | Number of Samples | Bitrate (kbps) | Codec | Width | Height | Sample Rate | Channel Count |
+----+-----------------------+-------------------------+-----------+-------------------+----------------+-------+-------+--------+-------------+---------------+
| 2  | 2759320 - 0:45:59.320 | 121686016 - 0:45:59.320 | 44100     | 118834            | 128            | AAC   |       |        | 44100       | 2             |
+----+-----------------------+-------------------------+-----------+-------------------+----------------+-------+-------+--------+-------------+---------------+

Summary

Functions

Display information about the whole movie.

Display samples from a track.

Display tracks information.

Types

samples_options()

@type samples_options() :: [limit: non_neg_integer(), offset: non_neg_integer()]

Functions

movie_info(reader)

@spec movie_info(ExMP4.Reader.t()) :: String.t()

Display information about the whole movie.

samples(reader, track_id, opts \\ [])

@spec samples(ExMP4.Reader.t(), ExMP4.Track.id(), Keyword.t()) :: String.t()

Display samples from a track.

tracks_info(reader)

@spec tracks_info(ExMP4.Reader.t()) :: String.t()

Display tracks information.