I have 2 webcam streams published (restreamed from local LAN) via https and apache to the web.
in my vhost file I have following setting:
AuthName "Member Only"
AuthType Basic
AuthUserFile /var/www/.htpasswd
require valid-user
When I start the stream via vlc it works fine, VLC and others (Browsers) request the user and password from the user and streaming starts. And it plays fine for infinite time!
vlc -I dummy http://192.168.178.21:8080/ vlc://quit --sout='#std{access=livehttp{seglen=10,delsegs=true,numsegs=5,index=/var/www/https/webcam/dach/stream1.m3u8,index-url='"stream1-########.ts"'},mux=ts{use-key-frames},dst=/var/www/https/webcam/dach/stream1-########.ts}'
When I start it with avconv/ffmpeg:
avconv -re -i http://192.168.178.21:8080 -c copy -flags -global_header -hls_time 10 -hls_list_size 6 -hls_wrap 10 -g 24 /var/www/https/webcam/dach/stream1.m3u8
VLC and Browsers request the Password and it plays for a few seconds.
but then after the first segments and the player requests the new .m3u8 it fails with
401:Unauthorized
When i turn off authentication it works fine again with avconv, so I guess this has something to do with apache?
Here's the generated m3u8 by VLC:
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-MEDIA-SEQUENCE:5
#EXTINF:10.00,
stream1-00000005.ts
#EXTINF:10.00,
stream1-00000006.ts
#EXTINF:10.00,
stream1-00000007.ts
#EXTINF:10.00,
stream1-00000008.ts
#EXTINF:10.00,
stream1-00000009.ts
and the one by avconv:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:5
#EXTINF:10,
stream15.ts
#EXTINF:10,
stream16.ts
#EXTINF:10,
stream17.ts
#EXTINF:10,
stream18.ts
#EXTINF:10,
stream19.ts
#EXTINF:10,
stream10.ts
Can somebody give me a hint?
I need to use avconv since it allows me to map the video stream before the audio stream (video needs to be 0 and Webcam stream is often mixed up)
thanks