diff mbox

[FFmpeg-devel,2/2] movenc: Add support for writing language codes into ISML manifests

Message ID 1474927822-6802-3-git-send-email-jeebjp@gmail.com
State Accepted
Headers show

Commit Message

Jan Ekström Sept. 26, 2016, 10:10 p.m. UTC
Streaming servers appear to ignore all other language metadata.

Signed-off-by: Jan Ekström <jeebjp@gmail.com>
---
 libavformat/movenc.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Josh Dekker Sept. 28, 2016, 11:20 p.m. UTC | #1
On 26/09/2016 23:10, Jan Ekström wrote:
> Streaming servers appear to ignore all other language metadata.
>
> Signed-off-by: Jan Ekström <jeebjp@gmail.com>
> ---
>  libavformat/movenc.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index d5ed1dd..28edb18 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -3611,6 +3611,9 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
>          const char *type;
>          int track_id = track->track_id;
>
> +        AVStream *st = track->st;
> +        AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL,0);
> +
>          if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
>              type = "video";
>          } else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) {
> @@ -3630,6 +3633,7 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
>                      (int64_t)manifest_bit_rate);
>          param_write_int(pb, "systemBitrate", manifest_bit_rate);
>          param_write_int(pb, "trackID", track_id);
> +        param_write_string(pb, "systemLanguage", lang ? lang->value : "und");
>          if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
>              if (track->par->codec_id == AV_CODEC_ID_H264) {
>                  uint8_t *ptr;
>

LGTM. Will push tomorrow if no further comments.

--
Josh
Josh Dekker Sept. 29, 2016, 9:33 a.m. UTC | #2
On 26/09/2016 23:10, Jan Ekström wrote:
> Streaming servers appear to ignore all other language metadata.
>
> Signed-off-by: Jan Ekström <jeebjp@gmail.com>
> ---
>  libavformat/movenc.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index d5ed1dd..28edb18 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -3611,6 +3611,9 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
>          const char *type;
>          int track_id = track->track_id;
>
> +        AVStream *st = track->st;
> +        AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL,0);
> +
>          if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
>              type = "video";
>          } else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) {
> @@ -3630,6 +3633,7 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
>                      (int64_t)manifest_bit_rate);
>          param_write_int(pb, "systemBitrate", manifest_bit_rate);
>          param_write_int(pb, "trackID", track_id);
> +        param_write_string(pb, "systemLanguage", lang ? lang->value : "und");
>          if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
>              if (track->par->codec_id == AV_CODEC_ID_H264) {
>                  uint8_t *ptr;
>

Thanks, applied.

--
Josh
diff mbox

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index d5ed1dd..28edb18 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3611,6 +3611,9 @@  static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
         const char *type;
         int track_id = track->track_id;
 
+        AVStream *st = track->st;
+        AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL,0);
+
         if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
             type = "video";
         } else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) {
@@ -3630,6 +3633,7 @@  static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
                     (int64_t)manifest_bit_rate);
         param_write_int(pb, "systemBitrate", manifest_bit_rate);
         param_write_int(pb, "trackID", track_id);
+        param_write_string(pb, "systemLanguage", lang ? lang->value : "und");
         if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
             if (track->par->codec_id == AV_CODEC_ID_H264) {
                 uint8_t *ptr;