Can not generate multiple bit-rate HLS LIVE stream #899
Unanswered
thusinh1969
asked this question in
1. Help
Replies: 1 comment
-
I also developing an adaptive hls service and already tried to open couple of output containers, but it doesn seem to be a solution because workload on processor rises 4x due reformatting. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Overview
I have been able to generate single bit rate (default) with PyAV. My options dict is as follows:
HLS_MANIFEST = "/home/www/whatever/whatever.m3u8"
HLS_OPTS = {'hls_playlist_type': 'vod', 'hls_list_size': '3', 'hls_time': '2', 'hls_segment_type': 'mpegts', 'hls_flags': 'delete_segments+discont_start', 'hls_start_number_source': 'datetime', 'strftime': '1', 'use_localtime': '1', 'hls_segment_filename': '/home/www/whatever/data%02d.ts'}
self.__container = av.open(HLS_MANIFEST,
options=HLS_OPTS,
mode='w',
format='hls')
...by providing 2 add_stream one for video and one for audio with threading. It generated nicely .m3u8 file and bunch of segments and VLC client can stream just fine.
Expected behavior
It should work with multi bit rate I could hope ! But it did not.
Actual behavior
But with multi bit rate no file (nothing actually) were generated. My option dict is as follows:
HLS_MANIFEST = "/home/www/whatever/whatever.m3u8"
HLS_OPTS ={'filter_complex': '[0:v]split=3[v1][v2][v3]; [v1]copy[v1out]; [v2]scale=w=1280:h=720[v2out]; [v3]scale=w=640:h=360[v3out] -preset veryfast -g 25 -sc_threshold 0 -map [v1out] -c:v:0 libx264 -x264-params “nal-hrd=cbr:force-cfr=1” -b:v:0 5M -maxrate:v:0 5M -minrate:v:0 5M -bufsize:v:0 10M -preset slow -g 48 -sc_threshold 0 -keyint_min 48 -map [v2out] -c:v:1 libx264 -x264-params “nal-hrd=cbr:force-cfr=1” -b:v:1 3M -maxrate:v:1 3M -minrate:v:1 3M -bufsize:v:1 3M -preset slow -g 48 -sc_threshold 0 -keyint_min 48 -map [v3out] -c:v:2 libx264 -x264-params “nal-hrd=cbr:force-cfr=1” -b:v:2 1M -maxrate:v:2 1M -minrate:v:2 1M -bufsize:v:2 1M -preset slow -g 48\n -map a:0 -c:a:0 aac -b:a:0 96k -ac 2 -map a:0 -c:a:1 aac -b:a:1 128k -ac 2 -map a:0 -c:a:2 aac -b:a:2 48k -ac 2 ', 'hls_time': '4', 'hls_playlist_type': 'vod', 'hls_flags': 'independent_segments', 'f': 'hls', 'use_localtime_mkdir': '1', 'hls_segment_filename': '/home/www/whatever/stream_%v/data%06d.ts', 'master_pl_name': '/home/www/whatever/whatever.m3u8', 'var_stream_map': '"v:0,a:0 v:1,a:1 v:2,a:2" /home/www/whatever/stream_%v/stream.m3u8'}
I have tried hls_playlist_type as vod - live event without success.
Investigation
I could not see any file generated when started!
Reproduction
It can always be reproduced.
Versions
Research
I have done the following:
Additional context
Looking towards for any help possible.
Thanks,
Steve
Beta Was this translation helpful? Give feedback.
All reactions