Skip to content

Commit

Permalink
Changes to maybe fix ffmpeg getting stuck remuxing to hls
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaserlang committed Dec 13, 2023
1 parent c5826ea commit 9bd8c3d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions seplis_play_server/transcoders/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,16 @@ async def set_ffmpeg_args(self):
self.ffmpeg_args.append({'-fflags': '+genpts'})
self.set_hardware_decoder()
if self.settings.start_time:
self.ffmpeg_args.append({'-ss': str(self.settings.start_time)})
self.ffmpeg_args.append({'-ss': str(self.settings.start_time.quantize(Decimal('0.000')))})
self.ffmpeg_args.extend([
{'-i': f"file:{self.metadata['format']['filename']}"},
{'-map_metadata': '-1'},
{'-map_chapters': '-1'},
{'-threads': '0'},
{'-max_delay': '5000000'},
{'-max_muxing_queue_size': '2048'},
{'-muxdelay': '0'},
{'-muxpreload': '0'},
])
self.set_video()
self.set_audio()
Expand Down Expand Up @@ -241,11 +243,11 @@ def set_video(self):
# Audio goes out of sync if not used
self.ffmpeg_args.insert(i+1, {'-noaccurate_seek': None})

self.ffmpeg_args.extend([
{'-start_at_zero': None},
{'-avoid_negative_ts': 'disabled'},
#{'-copyts': None},
])
self.ffmpeg_args.extend([
{'-start_at_zero': None},
{'-avoid_negative_ts': 'disabled'},
#{'-copyts': None},
])
else:
if config.ffmpeg_hwaccel_enabled:
codec = f'{self.settings.transcode_video_codec}_{config.ffmpeg_hwaccel}'
Expand Down

0 comments on commit 9bd8c3d

Please sign in to comment.