fffiloni commited on
Commit
c8d3747
·
1 Parent(s): 1fee911

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -36,7 +36,13 @@ def convert_video(input_file, output_file, codec='mp4v'):
36
  # Process and write audio stream using ffmpeg
37
  stream = ffmpeg.input(input_path)
38
  stream = ffmpeg.output(stream, output_path, acodec='aac', vcodec=codec, strict='experimental', loglevel='error')
39
- ffmpeg.run(stream)
 
 
 
 
 
 
40
 
41
  print(f"Video converted successfully: {output_path}")
42
 
 
36
  # Process and write audio stream using ffmpeg
37
  stream = ffmpeg.input(input_path)
38
  stream = ffmpeg.output(stream, output_path, acodec='aac', vcodec=codec, strict='experimental', loglevel='error')
39
+ # Run FFmpeg command and capture stderr output
40
+ try:
41
+ ffmpeg.run(stream, capture_stderr=True)
42
+ except subprocess.CalledProcessError as e:
43
+ # Print stderr output if an error occurs
44
+ print(f"FFmpeg error: {e.stderr.decode()}")
45
+ raise e
46
 
47
  print(f"Video converted successfully: {output_path}")
48