correct ffmpeg command
This commit is contained in:
parent
6f75a645b7
commit
9daa45789d
|
|
@ -220,12 +220,17 @@ async def s_api_v1_storage_get(request, file_hash=None):
|
|||
subprocess.run([
|
||||
"ffmpeg",
|
||||
"-y",
|
||||
"-ss", "0", # Set start time if needed
|
||||
"-i", file_path,
|
||||
"-t", str(seconds_limit),
|
||||
"-c:v", "libx264",
|
||||
"-preset", "medium", # Set encoding preset for better compatibility
|
||||
"-profile:v", "main", # Set profile for compatibility
|
||||
"-pix_fmt", "yuv420p", # Set pixel format for compatibility
|
||||
"-c:a", "aac",
|
||||
"-movflags", "+faststart",
|
||||
"-b:a", "192k", # Set audio bitrate
|
||||
"-movflags", "+faststart", # Enable fast start for streaming
|
||||
"-map", "0", # Map all streams from the input
|
||||
tempfile_path
|
||||
], check=True)
|
||||
else:
|
||||
|
|
@ -235,9 +240,13 @@ async def s_api_v1_storage_get(request, file_hash=None):
|
|||
"-y",
|
||||
"-i", file_path,
|
||||
"-c:v", "libx264",
|
||||
"-preset", "medium", # Set encoding preset for better compatibility
|
||||
"-profile:v", "main", # Set profile for compatibility
|
||||
"-pix_fmt", "yuv420p", # Set pixel format for compatibility
|
||||
"-c:a", "aac",
|
||||
"-movflags", "+faststart",
|
||||
"-b:a", "192k", # Set audio bitrate
|
||||
"-movflags", "+faststart", # Enable fast start for streaming
|
||||
"-map", "0", # Map all streams from the input
|
||||
tempfile_path
|
||||
], check=True)
|
||||
except BaseException as e:
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ async def t_inline_query_node_content(query: types.InlineQuery, memory=None, use
|
|||
|
||||
# Check if a preview file_id is cached for audio/video and if not, upload a trimmed preview to cache it.
|
||||
if content_type_declared in ('audio', 'video'):
|
||||
if not encrypted_content.meta.get('telegram_file_cache_preview'):
|
||||
if True or not encrypted_content.meta.get('telegram_file_cache_preview'):
|
||||
try:
|
||||
# Construct URL for trimmed preview (limit to 30 seconds)
|
||||
preview_url = f"{PROJECT_HOST}/api/v1/storage/{content.cid.serialize_v2(include_accept_type=True)}?seconds_limit=30"
|
||||
|
|
|
|||
Loading…
Reference in New Issue