Skip to content

Commit

Permalink
Fix: [Server] 録画視聴関連の様々な不具合修正
Browse files Browse the repository at this point in the history
セグメントの繋ぎ目がスムーズに行かない以外はある程度それなりに見れるようになった気がする (ただし初回プレイリスト取得時に現状キーフレームの DTS を取得するので30分番組で再生開始準備に1分半くらいかかる)
  • Loading branch information
tsukumijima committed Nov 18, 2023
1 parent 06fc563 commit e2e9821
Show file tree
Hide file tree
Showing 4 changed files with 349 additions and 317 deletions.
10 changes: 5 additions & 5 deletions server/app/routers/VideoStreamsRouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ async def VideoHLSPlaylistAPI(
"""

video_stream = VideoStream(recorded_program, quality)
m3u8_data = await video_stream.getVirtualPlaylist()
return Response(content=m3u8_data, media_type='application/vnd.apple.mpegurl')
virtual_playlist = await video_stream.getVirtualPlaylist()
return Response(content=virtual_playlist, media_type='application/vnd.apple.mpegurl')


@router.get(
Expand Down Expand Up @@ -95,13 +95,13 @@ async def VideoHLSSegmentAPI(
# TODO: 適切な Cache-Control ヘッダーを返す

video_stream = VideoStream(recorded_program, quality)
segment_ts = await video_stream.getSegment(sequence)
if segment_ts is None:
encoded_segment_ts = await video_stream.getSegment(sequence)
if encoded_segment_ts is None:
raise HTTPException(
status_code = status.HTTP_422_UNPROCESSABLE_ENTITY,
detail = 'Specified sequence segment was not found',
)
return Response(content=segment_ts, media_type='video/mp2t')
return Response(content=encoded_segment_ts, media_type='video/mp2t')


@router.put(
Expand Down
1 change: 0 additions & 1 deletion server/app/streams/LiveEncodingTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def buildFFmpegOptions(self,

# ストリームのマッピング
## 音声切り替えのため、主音声・副音声両方をエンコード後の TS に含む
## 副音声が検出できない場合にエラーにならないよう、? をつけておく
options.append('-map 0:v:0 -map 0:a:0 -map 0:a:1 -map 0:d? -ignore_unknown')

# フラグ
Expand Down
Loading

0 comments on commit e2e9821

Please sign in to comment.