-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Merging two .mp4 files results in a file the same duration as the first file. #1680
Comments
that's odd. how does your merge options look like? also, can you provide some more info? see https://github.com/mifi/lossless-cut/issues/new?assignees=&labels=&projects=&template=file-issue.yml |
did you try to open each file separately, then for each file: disable all tracks except video, then export? and then merge the resulting two exported files? |
I just tried exporting each half separately through LosslessCut after disabling the audio tracks (the only track that the files had other than the video) and trying to merge those, but the same error occurs. This is the error report from Help->Report an Error:
This is the log from the Javascript console: This is a GDrive link to the two files I'm trying to merge: I hope this covers everything you're looking for, but if not, let me know. |
Thanks for sharing. I found the problem: When running this ffmpeg command (copy from "last ffmpeg commands") echo -e "file 'file:TEST-001.mp4'\nfile 'file:TEST2-002.mp4'" | ffmpeg -hide_banner -f concat -safe 0 -protocol_whitelist 'file,pipe,fd' -i - -map 0 -c copy -f mp4 -y 'TEST-001-merged-1692298808211.mp4' I get this output:
however ffmpeg exits with exit code If I run the command again but append I believe this is a bug in ffmpeg. We could add
I think the problematic file is TEST-001.mp4. If I run this ffmpeg -i TEST-001.mp4 -c copy -bsf:v h264_mp4toannexb TEST-001-annexb.mp4 it gives an error:
however the export succeeds. Probably there's a problematic/corrupt frame/packet in your file. If I take the exported TEST-001-annexb.mp4 file and merge it with TEST2-002.mp4, then it works. I think we should add an advanced expoort option in losslesscut to add |
You have to install ffmpeg and run it from cmd |
#1680 (comment) also refactor per stream params
not sure why you need to run that command. instead run this command:
then merge the resulting file with test2 using losslesscut |
Thank you, this worked for me. You've been a huge help. |
nice! for future reference: in latest llc version people can add |
I have a lot of issues to go through, so in order to make it easier for me to help you, I ask that you please try these things first
Operating System
Windows 10
Steps to reproduce
I have 2 .mp4 files, one 3.67gb and one 2.90gb, which I'm trying to merge. I import them and hit merge, but the software gives me this error showing that the output file is much shorter than the sum of the two input files.
![image](https://private-user-images.githubusercontent.com/46661228/260301449-5bc45895-4ba2-403c-98ef-9f7f94abb547.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0ODA4MTgsIm5iZiI6MTczOTQ4MDUxOCwicGF0aCI6Ii80NjY2MTIyOC8yNjAzMDE0NDktNWJjNDU4OTUtNGJhMi00MDNjLTk4ZWYtOWY3Zjk0YWJiNTQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDIxMDE1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5MWZiYTM3ZTU0YjE1NWJjMDY4Zjc0NmJhNzhhZDFhOWFjZWIwZWM5YTQxOTk1YmMyYjk4MDIxZWQyMjg2ODkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.qPRHmYAG-TzsR3tltxlqk9lOFNRXXkeBbwt_2mJFbWo)
I tried disabling all tracks except for the video tracks (though it seemed like going to disable the audio track of the second clip re-enabled the audio track of the first clip and vice-versa?), I tried every setting of avoid_negative_ts in the export settings, and I've tried exporting both videos and merging those instead. Nothing has worked.
Expected behavior
The two files should merge into one single file instead of not doing that.
Actual behavior
Final file is just a copy of the first file with the same duration.
Share log
No response
The text was updated successfully, but these errors were encountered: