ziqiangao commited on
Commit
106b5c7
·
verified ·
1 Parent(s): 7167e50

make it respect the fps setting

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -283,12 +283,12 @@ def main(file, name, fps=30, res: tuple=(1280,720), oscres=512, sr=11025, lyrics
283
  if haslyrics:
284
  ffmpeg_cmd = [
285
  "ffmpeg",
286
- '-framerate', '30',
287
  '-i', path + f'out/{name}/%d.png', # Input PNG images
288
  '-i', file, # Input MP3 audio
289
  '-i', path + 'out.srt', # Input SRT subtitles
290
  '-c:v', 'libx264',
291
- '-r', '30',
292
  '-pix_fmt', 'yuv420p',
293
  '-c:a', 'aac',
294
  '-c:s', 'mov_text', # Use mov_text codec for subtitles
@@ -298,11 +298,11 @@ def main(file, name, fps=30, res: tuple=(1280,720), oscres=512, sr=11025, lyrics
298
  else:
299
  ffmpeg_cmd = [
300
  "ffmpeg",
301
- '-framerate', '30',
302
  '-i', path + f'out/{name}/%d.png', # Input PNG images
303
  '-i', f'{file}', # Input MP3 audio
304
  '-c:v', 'libx264',
305
- '-r', '30',
306
  '-pix_fmt', 'yuv420p',
307
  '-c:a', 'aac',
308
  '-y',
 
283
  if haslyrics:
284
  ffmpeg_cmd = [
285
  "ffmpeg",
286
+ '-framerate', str(fps),
287
  '-i', path + f'out/{name}/%d.png', # Input PNG images
288
  '-i', file, # Input MP3 audio
289
  '-i', path + 'out.srt', # Input SRT subtitles
290
  '-c:v', 'libx264',
291
+ '-r', str(fps),
292
  '-pix_fmt', 'yuv420p',
293
  '-c:a', 'aac',
294
  '-c:s', 'mov_text', # Use mov_text codec for subtitles
 
298
  else:
299
  ffmpeg_cmd = [
300
  "ffmpeg",
301
+ '-framerate', str(fps),
302
  '-i', path + f'out/{name}/%d.png', # Input PNG images
303
  '-i', f'{file}', # Input MP3 audio
304
  '-c:v', 'libx264',
305
+ '-r', str(fps),
306
  '-pix_fmt', 'yuv420p',
307
  '-c:a', 'aac',
308
  '-y',