Skip to content

Commit

Permalink
Merge pull request #72 from adalava/nostdin
Browse files Browse the repository at this point in the history
GenerateTimelapse: Add -nostdin option to ffmpeg
  • Loading branch information
dvida authored May 13, 2021
2 parents 97616e8 + 8d2742c commit 2b198ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .config
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ enable_fireball_detection: true
; Subsample to 16x16 squares (default 16)
subsampling_size: 16
; Weight for stddev in thresholding for fireball extraction
k1: 4.5
k1: 7.0
; Absolute offset in thresholding for fireball extraction
j1: 5
j1: 10
; Maximum time in seconds for which line finding algorithm can run (seconds)
max_time: 6
; Average frame level at which the image will not be processed, as it will be deemed too white
Expand Down
7 changes: 5 additions & 2 deletions Utils/GenerateTimelapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,20 @@ def generateTimelapse(dir_path, nodel) :
# If running on Linux, use avconv
if platform.system() == 'Linux':

# If avconv is not found, try using ffmpeg
# If avconv is not found, try using ffmpeg. In case of using ffmpeg,
# use parameter -nostdin to avoid it being stuck waiting for user input
software_name = "avconv"
nostdin = ""
print("Checking if avconv is available...")
if os.system(software_name + " --help > /dev/null"):
software_name = "ffmpeg"
nostdin = " -nostdin "

# Construct the command for avconv
mp4_path = os.path.join(dir_path, os.path.basename(dir_path) + ".mp4")
temp_img_path = os.path.basename(dir_tmp_path) + os.sep + "temp_%04d.jpg"
com = "cd " + dir_path + ";" \
+ software_name + " -v quiet -r "+ str(fps) +" -y -i " + temp_img_path \
+ software_name + nostdin + " -v quiet -r "+ str(fps) +" -y -i " + temp_img_path \
+ " -vcodec libx264 -pix_fmt yuv420p -crf 25 -movflags faststart -g 15 -vf \"hqdn3d=4:3:6:4.5,lutyuv=y=gammaval(0.77)\" " \
+ mp4_path

Expand Down

0 comments on commit 2b198ec

Please sign in to comment.