mirror of
https://github.com/RekuNote/Hatenatools3.git
synced 2026-10-30 08:19:12 +00:00
Fixed exporting flipnotes that have no background music.
This commit is contained in:
1 parent
ba9b9ccc4c
commit
15a006cc5b
1 file changed
+5
-4
@@ -859,11 +859,12 @@ if __name__ == '__main__':
|
|||||||
print "Exporting video with ffmpeg..."
|
print "Exporting video with ffmpeg..."
|
||||||
export_command = ["ffmpeg","-framerate",str(fps),"-start_number","1","-i","{path}/frame %03d.png".format(path=tempdir),"-i","{path}/sounds/BGM.wav".format(path=tempdir),"-c:v","libx264","-shortest","-y",out_file]
|
export_command = ["ffmpeg","-framerate",str(fps),"-start_number","1","-i","{path}/frame %03d.png".format(path=tempdir),"-i","{path}/sounds/BGM.wav".format(path=tempdir),"-c:v","libx264","-shortest","-y",out_file]
|
||||||
if not os.path.isfile(tempdir+"/sounds/BGM.wav"):
|
if not os.path.isfile(tempdir+"/sounds/BGM.wav"):
|
||||||
has_bgm = False
|
print "No background music. Adding silent track..."
|
||||||
export_command.pop(7)
|
#has_bgm = False
|
||||||
export_command.pop(8)
|
export_command = ["ffmpeg","-framerate",str(fps),"-start_number","1","-i","{path}/frame %03d.png".format(path=tempdir),"-f","lavfi","-i","anullsrc=r=8192:cl=mono","-c:v","libx264","-shortest","-y",out_file]
|
||||||
else:
|
else:
|
||||||
has_bgm = True
|
#has_bgm = True
|
||||||
|
pass
|
||||||
with open(os.devnull) as null:
|
with open(os.devnull) as null:
|
||||||
subprocess.call(export_command,stdout=null,stderr=null)
|
subprocess.call(export_command,stdout=null,stderr=null)
|
||||||
print "Done!"
|
print "Done!"
|
||||||
|
|||||||
Reference in new issue
Block a user
