Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg order error and no reencoding options #2

Merged
merged 3 commits into from
Jan 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ffmpeg order error and no reencoding options
I get this error when extracting clips:
```
Option to (record or transcode stop time) cannot be applied to input url VID_20190124_124206.mp4 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file VID_20190124_124206.mp4.
Error opening input files: Invalid argument
```
Time options need to be after input file.

Also, added `copy` arg to `-vcodec` and `-acodec` to avoid reencoding the extracted clips.
  • Loading branch information
javimixet authored Jan 28, 2019
commit 46c94bd9556d6fda03c1830080e8fd3ce01ea68d
4 changes: 2 additions & 2 deletions bipcut.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def ffmpeg_extract_clip(ffmpeg_path, original_file, output_file, start, stop):
#ffmpeg -ss 4.63482993197 -to 14.8733106576 -i "D:\\Dropbox\\Caricamenti da fotocamera\\rec.wav" output.mp3

# Execute ffmpeg to extract the clip
p = subprocess.Popen([ffmpeg_path, "-y", "-ss", str(start), "-to", str(stop), "-i", original_file, output_file])
p = subprocess.Popen([ffmpeg_path, "-y", "-i", original_file, "-vcodec", "copy", "-acodec", "copy", "-ss", str(start), "-to", str(stop), output_file])
return_code = p.wait()

# Make sure the ffmpeg executed correctly by checking the exit code
Expand Down Expand Up @@ -270,4 +270,4 @@ def ffmpeg_extract_clip(ffmpeg_path, original_file, output_file, start, stop):
os.remove(audio_track_file)

# Quit python
sys.exit(0)
sys.exit(0)