nICEnnnnnnnLee / BilibiliLiveRecorder

pure-java B站/Acfun/斗鱼/虎牙/快手/抖音/YY/战旗/花椒 直播视频录制。仅需Java环境即可运行【维护模式,不主动新增Feature】
Other
790 stars 108 forks source link

[Bug] Stopped recording after a period of time #37

Closed s-kk closed 4 years ago

s-kk commented 4 years ago

Hello! When I was testing, I encountered a bug (or probably not a bug).
The recording mode is bili, and quality is set to highest. I've checked the network and it was all good. When the recording time reaches one hour, the recorder stopped and started timeline checking process. The output flv video however, is fine.

The live did not stop, but the recorder stopped. Is it because bilibili will refresh the stream (m3u8) some time after the live starts?

Thanks for helping!

nICEnnnnnnnLee commented 4 years ago

I've nerver met such condition before... Normally, the recorder will not stop the HTTP connection itself if configuration is correct. Once the record was stopped on good network condition, either bilibili server or the manual operator did it.

If the bilibili Server closes the long period connection, I guess the HTTP CONNECTION of record is stopped the same way as the live offline since there will be 5 re-connection attempts if any Network Exception is thrown in app.

Here, I think the main point is to auto restart the record once such thing happens.

If you're quite sure that the connection will close when the recording time reaches one hour, try to set the configuration filePeriod=50.

If filePeriod is set to an Integer bigger than 0, the app will stop itself and restart record immediately when the recording time hits filePeriod minutes.

PS: Do not worry about loss of information since there will be always some caches in server. The time cost of re-connection is definitely less than time caches.

s-kk commented 4 years ago

Thanks for replying! This only happened once during my testing. I will try the option you mentioned.
Thanks a lot for helping!