[FFmpeg-devel] HLS Segmenting/Fragmentation Questions

Jeyapal, Karthick kjeyapal at akamai.com
Fri Apr 20 06:47:18 EEST 2018



On 4/20/18 2:20 AM, Ronak wrote:
> Hi,
>
> I've been testing FFMPEG's HLS fragmented MP4 options with some M4A audio files.
>
> I've noticed that if I ask ffmpeg to fragment an 11 minute file vs a 10 hour file, the byte ranges are different, even if the channel count/sampling rate/bit rate and codec are the same.
>
> Here's an example of what I'm talking about:
>
> #EXTM3U
> #EXT-X-VERSION:6
> #EXT-X-TARGETDURATION:10
> #EXT-X-MEDIA-SEQUENCE:1
> #EXT-X-MAP:URI="someAudio.m4s",BYTERANGE="738 at 0"
> #EXTINF:9.798821,
> #EXT-X-BYTERANGE:38977 at 738
> someAudio.m4s
> #EXTINF:9.798821,
> #EXT-X-BYTERANGE:38735 at 39715
> someAudio.m4s
> #EXTINF:9.798821,
> #EXT-X-BYTERANGE:38650 at 78450
> someAudio.m4s
> #EXTINF:9.798821,
> #EXT-X-BYTERANGE:38688 at 117100
> someAudio.m4s
> #EXTINF:9.798821,
> #EXT-X-BYTERANGE:38820 at 155788
> someAudio.m4s
>
> And 
>
> #EXTM3U
> #EXT-X-VERSION:6
> #EXT-X-TARGETDURATION:10
> #EXT-X-MEDIA-SEQUENCE:1
> #EXT-X-MAP:URI="someOtherAudio.m4s",BYTERANGE="738 at 0"
> #EXTINF:9.798821,
> #EXT-X-BYTERANGE:38724 at 738
> someOtherAudio.m4s
> #EXTINF:9.798821,
> #EXT-X-BYTERANGE:38812 at 39462
> someOtherAudio.m4s
> #EXTINF:9.798821,
> #EXT-X-BYTERANGE:38632 at 78274
> someOtherAudio.m4s
> #EXTINF:9.798821,
> #EXT-X-BYTERANGE:38804 at 116906
> someOtherAudio.m4s
> #EXTINF:9.798821,
> #EXT-X-BYTERANGE:38720 at 155710
> someOtherAudio.m4s
>
> Why would these byte ranges be different? I've been trying to look through the libavformat source code (https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/hlsenc.c <https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/hlsenc.c>) but it looks like this determination is done in whoever calls hls_write_packet.
Yes, you are right. It is determined by the AV encoder(say AAC encoder in your case). HLS segmenter will just cut at the segment boundaries and it doesn't worry about the number of bytes that are present in that segment.
>
> Thanks,
>
> Ronak
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel




More information about the ffmpeg-devel mailing list