Error Encoding AAC to HLS Using ffmpeg

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

Error Encoding AAC to HLS Using ffmpeg

Ashish Jha
I want to encode an AAC formatted audio file into multi bitrate HLS using ffmpeg:


fmpeg -re -i input.aac -b:a:0 128k -af volume=6dB -ar 48000 -hls_time 20 -vn -hls_list_size 0 -b:a:1 256k -af volume=6dB -ar 48000  -hls_time 20 -vn -hls_list_size 0     -map 0:a -map 0:a -f hls -var_stream_map "a:0,agroup:aud_low a:1,agroup:aud_high" -master_pl_name index.m3u8 index_%v.m3u8

This lets me get 1 master manifest and 2 child manifests, which are playable on android. However, this does not play on desktop using chrome. I found these 2 lines in master manifest that seem to cause the issue. When manually removed, it plays perfectly.


#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_low",NAME="audio_0",DEFAULT=YES,URI="master0.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_high",NAME="audio_1",DEFAULT=YES,URI="master1.m3u8"

Is there a way to encode audio in multibitrate that avoids this issue?


_______________________________________________
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: Error Encoding AAC to HLS Using ffmpeg

andrei ka
you don't need groups here, just make a master index.m3u8 with :

index.m3u8 :
#================
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=128000
index_low.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH= 256000
index_high.m3u8
#================

and

ffmpeg -re  -i aac_file -vn  -filter_complex
"[0:a]volume=6dB,asetrate=sample_rate=48000,split=2[src1][src2] \
-map [src1] -c:a fdk_aac -b:a:0 128k \
-flags -global_header  -hls_segment_filename index_ld_%05d.ts  -timeout 2
-reconnect_delay_max 1 -f hls -hls_time 4 -hls_list_size 8 -hls_flags
delete_segments+append_list+omit_endlist+discont_start+split_by_time
-hls_allow_cache 0 -start_number 1 'index_low.m3u8'  \
  -map [src2] -c:a fdk_aac -b:a:1 256k   \
-flags -global_header   -hls_segment_filename index_sd_%05d.ts  -timeout 2
-reconnect_delay_max 1 -f hls -hls_time 4 -hls_list_size 8 -hls_flags
delete_segments+append_list+omit_endlist+discont_start+split_by_time
-hls_allow_cache 0 -start_number 1 'index_high.m3u8'

i didn't try it, but i do video transcoding in this way, so you may need to
edit this cmdline a bit....

&rei

>ffmpeg -re -i input.aac -b:a:0 128k -af volume=6dB -ar 48000 -hls_time 20
-vn -hls_list_size 0 -b:a:1 256k -af volume=6dB -ar 48000  -hls_time 20 -vn
>-hls_list_size 0     -map 0:a -map 0:a -f hls -var_stream_map
"a:0,agroup:aud_low a:1,agroup:aud_high" -master_pl_name index.m3u8
index_%v.m3u8

On Mon, Dec 2, 2019 at 1:37 PM Ashish Jha <[hidden email]> wrote:

> I want to encode an AAC formatted audio file into multi bitrate HLS using
> ffmpeg:
>
>
> fmpeg -re -i input.aac -b:a:0 128k -af volume=6dB -ar 48000 -hls_time 20
> -vn -hls_list_size 0 -b:a:1 256k -af volume=6dB -ar 48000  -hls_time 20 -vn
> -hls_list_size 0     -map 0:a -map 0:a -f hls -var_stream_map
> "a:0,agroup:aud_low a:1,agroup:aud_high" -master_pl_name index.m3u8
> index_%v.m3u8
>
> This lets me get 1 master manifest and 2 child manifests, which are
> playable on android. However, this does not play on desktop using chrome. I
> found these 2 lines in master manifest that seem to cause the issue. When
> manually removed, it plays perfectly.
>
>
>
> #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_low",NAME="audio_0",DEFAULT=YES,URI="master0.m3u8"
>
> #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_aud_high",NAME="audio_1",DEFAULT=YES,URI="master1.m3u8"
>
> Is there a way to encode audio in multibitrate that avoids this issue?
>
>
> _______________________________________________
> 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".