HLS setting NAME in EXT-X-MEDIA

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

HLS setting NAME in EXT-X-MEDIA

alexdjca
Hi Guys,

Does anybody know If there is a way to set a specific value of NAME in EXT-X-MEDIA with the HLS muxer?

My command line is:

/usr/src/ffmpeg-4.2.2/ffmpeg -hwaccel cuvid -c:v h264_cuvid -i INPUT.ts \
-filter_complex "[0]split=5[inter-SD][inter-SDh][inter-FHD][inter-HD][inter-SDq];[inter-SD]hwupload,scale_npp=640:480:format=yuv420p,hwdownload[vout-SD];[inter-SDh]hwupload,scale_npp=480:320:format=yuv420p,hwdownload[vout-SDh];[inter-FHD]hwupload,scale_npp=1920:1080:format=yuv420p,hwdownload[vout-FHD];[inter-HD]hwupload,scale_npp=1280:720:format=yuv420p,hwdownload[vout-HD];[inter-SDq]hwupload,scale_npp=320:240:format=yuv420p,hwdownload[vout-SDq]" \
-c:v h264_nvenc -preset:v fast -g:v 50 -flags +cgop -c:a aac \
-map [vout-SD] -map [vout-SDh] -map [vout-FHD] -map [vout-HD] -map [vout-SDq] \
-b:v:0 800k \
-b:v:1 500k \
-b:v:2 2000k -profile:v:2 high -level:v:2 4.1 \
-b:v:3 1200k -profile:v:3 high -level:v:3 4.1 \
-b:v:4 300k \
-map 0:a:0 -map 0:a:0 -map 0:a:1 -map 0:a:1 \
-b:a:0 128k -b:a:1 64k -b:a:2 128k -b:a:3 64k \
-metadata:s:a:0 language=eng -metadata:s:a:1 language=eng \
-metadata:s:a:2 language=fre -metadata:s:a:3 language=fre \
-var_stream_map "a:0,agroup:HIGH_BR,language:ENG,name:audio_en_hi a:2,agroup:HIGH_BR,language:FRE,name:audio_fr_hi a:1,agroup:LOW_BR,language:ENG,name:audio_en_lo a:3,agroup:LOW_BR,language:FRE,name:audio_fr_lo v:0,agroup:LOW_BR,name:Video_SD v:1,agroup:LOW_BR,name:Video_SDh v:2,agroup:HIGH_BR,name:Video_FHD v:3,agroup:HIGH_BR,name:Video_HD v:4,agroup:LOW_BR,name:Video_SDq" \
-f hls -hls_playlist_type vod -hls_time 10 -hls_list_size 0 -hls_allow_cache 1 -master_pl_name master.m3u8 \
-hls_segment_filename alextest1/%v/chunk-%08d.ts alextest1/%v/playlist.m3u8

The comman more or less does what I need,
but the NAME value is always set as "audio_1, audio_2...." and so on.

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_HIGH_BR",NAME="audio_0",DEFAULT=YES,LANGUAGE="ENG",URI="AEN128/playlist.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_HIGH_BR",NAME="audio_1",DEFAULT=NO,LANGUAGE="FRE",URI="AFR128/playlist.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_LOW_BR",NAME="audio_2",DEFAULT=NO,LANGUAGE="ENG",URI="AEN64/playlist.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_LOW_BR",NAME="audio_3",DEFAULT=NO,LANGUAGE="FRE",URI="AFR64/playlist.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=950400,RESOLUTION=640x480,CODECS="avc1.4d401e,mp4a.40.2",AUDIO="group_LOW_BR"
Video_SD/playlist.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=620400,RESOLUTION=480x320,CODECS="avc1.4d4015,mp4a.40.2",AUDIO="group_LOW_BR"
Video_SDh/playlist.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=2340800,RESOLUTION=1920x1080,CODECS="avc1.640029,mp4a.40.2",AUDIO="group_HIGH_BR"
Video_FHD/playlist.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=1460800,RESOLUTION=1280x720,CODECS="avc1.640029,mp4a.40.2",AUDIO="group_HIGH_BR"
Video_HD/playlist.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=400400,RESOLUTION=320x240,CODECS="avc1.4d400d,mp4a.40.2",AUDIO="group_LOW_BR"
Video_SDq/playlist.m3u8

I would like to be able to set the value with something else, eg. the language (NAME="English" or NAME="French") but I didn't find any information about that.

Thanks in advance

Alex Molon
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: HLS setting NAME in EXT-X-MEDIA

Moritz Barsnick
On Tue, Jan 21, 2020 at 09:35:57 +0000, Alessandro Molon wrote:
> Does anybody know If there is a way to set a specific value of NAME
> in EXT-X-MEDIA with the HLS muxer?

From looking at the source code, I can tell you that those NAMEs are
basically hardcoded, i.e. determined by ffmpeg.

> I would like to be able to set the value with something else, eg. the
> language (NAME="English" or NAME="French") but I didn't find any
> information about that.

Are there players which show these names? And which don't show you
language information at the same time?

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: HLS setting NAME in EXT-X-MEDIA

alexdjca
Yes, both JWPlayer and VideJS show the content of the NAME value.
And obviously I would prefer to decide what is shown, rather than audio_1, audio_2 and so on.

Alex

-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Moritz Barsnick
Sent: 21 January 2020 10:58
To: FFmpeg user discussions <[hidden email]>
Subject: Re: [FFmpeg-user] HLS setting NAME in EXT-X-MEDIA

On Tue, Jan 21, 2020 at 09:35:57 +0000, Alessandro Molon wrote:
> Does anybody know If there is a way to set a specific value of NAME in
> EXT-X-MEDIA with the HLS muxer?

From looking at the source code, I can tell you that those NAMEs are basically hardcoded, i.e. determined by ffmpeg.

> I would like to be able to set the value with something else, eg. the
> language (NAME="English" or NAME="French") but I didn't find any
> information about that.

Are there players which show these names? And which don't show you language information at the same time?

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: HLS setting NAME in EXT-X-MEDIA

kumowoon1025
> Yes, both JWPlayer and VideJS show the content of the NAME value.
> And obviously I would prefer to decide what is shown, rather than audio_1, audio_2 and so on.
>
> Alex

I think either because you are using the audio group id to map the variants or because you provide name attribute for the video streams too the name is not being handled properly (name isn’t defined for ext-stream-inf). As you say name is supposed to be a human readable description but it is used as a suffix index by hls muxer, you should edit the master playlist after it is written with another tool if you want to add it.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: HLS setting NAME in EXT-X-MEDIA

alexdjca
In reply to this post by Moritz Barsnick
Hi Moritz,

JWPlayer honors the NAME information, and totally ignores the MPEGTS metadata.
So I believe being able to set the NAME field would be quite important.

Alex

-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Moritz Barsnick
Sent: 21 January 2020 10:58
To: FFmpeg user discussions <[hidden email]>
Subject: Re: [FFmpeg-user] HLS setting NAME in EXT-X-MEDIA

On Tue, Jan 21, 2020 at 09:35:57 +0000, Alessandro Molon wrote:
> Does anybody know If there is a way to set a specific value of NAME in
> EXT-X-MEDIA with the HLS muxer?

From looking at the source code, I can tell you that those NAMEs are basically hardcoded, i.e. determined by ffmpeg.

> I would like to be able to set the value with something else, eg. the
> language (NAME="English" or NAME="French") but I didn't find any
> information about that.

Are there players which show these names? And which don't show you language information at the same time?

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: HLS setting NAME in EXT-X-MEDIA

alexdjca
In reply to this post by kumowoon1025
Thanks Ted,

It's exactly what I'm doing. I'm rewriting the master playlist on the fly with NGINX.

The strange thing is that audio_1 and so on are arbitrary names set by ffmpeg by itself so I really don't understand if this is a expected behaviour or some flaw in the muxer design or a bug.

It would be nice if this feature was properly implemented in ffmpeg

Alex

-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Ted Park
Sent: 21 January 2020 13:15
To: FFmpeg user questions <[hidden email]>
Subject: Re: [FFmpeg-user] HLS setting NAME in EXT-X-MEDIA

> Yes, both JWPlayer and VideJS show the content of the NAME value.
> And obviously I would prefer to decide what is shown, rather than audio_1, audio_2 and so on.
>
> Alex

I think either because you are using the audio group id to map the variants or because you provide name attribute for the video streams too the name is not being handled properly (name isn’t defined for ext-stream-inf). As you say name is supposed to be a human readable description but it is used as a suffix index by hls muxer, you should edit the master playlist after it is written with another tool if you want to add it.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".