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
Exported video/audio desync #1290
Comments
|
An issue would be the original framerate. If you shot at 30fps but are editing in 24 or so... these issues can arise... please try finding the original video profile and use it while editing. Hope that helps! :) |
|
It might be an issue with the player you are using too? A dirty solution would be to move audio back 1/4 of a a second. If you can't find solution in openshot. It can be quickly fixed using ffmpeg's itoffset command. https://alien.slackbook.org/blog/fixing-audio-sync-with-ffmpeg/ Cheers, Gary |
|
Closing this question as answered. |
|
Having experienced this exact issue (see eg https://twitter.com/conniptions/status/1006740645363572738) it seems to me that - while the workarounds suggested here (especially the ffmpeg one) are useful and helpful - this remains an OpenShot UI issue and should be reopened. The problem is: users can too easily import a long video that they laboriously edit down (this is surely a common use case) and find audio constantly desyncs without it being in any way obvious why. The solutions is: do not enforce default fps (and possibly other) settings if the first imported video source has different fps / other settings. That seems to me what is leading to the audio desync bug coming out. Instead, set default settings to the first imported video source, perhaps with a dialog box saying 'OpenShot is now setting edit settings to match imported source. Accept or - ONLY if you know what you are doing - Decline'. To be more clear: if you shot in 30fps it should not be possible to edit in 24fps without explicitly saying to OpenShot 'Yes, I intend to do this for reasons which I have and I don't care about any audio desync issues which may arise.' Instead, if I shot in 30fps - and OpenShot will know this, because the first file - and perhaps only file - I import will be 30fps - the edit settings should be changed to match the first video upload, possibly with some kind of dialogue warning (perhaps mythical) Advanced Users who wish, for some reason, to trigger the audio desync bug. |
|
@wgmyers - Yes. However, the audio desync issue seems to happen irrespective of the fps too. So, I have opened another issue over at libopenshot repo, too. But yes, perhaps this thing needs to be worked upon. P. S: I have already notified the devs regarding the issue with your video. Even gave them the link to the YouTube jam video. |
|
I want to second that. I'm a casual user just to clip off stuff before or after a clip, and scale down the data rate. So almost no editing involved, except of splicing and removing left or right. No separation of audio. And yet, the incoming clips (.mts) are always in sync (played with VLC), while the outgoing clips are always out of sync. I find it rather difficult to always play with the VLC settings to recover the synchronization. |
|
Took some time to look into this matter. Can't read code, but know a bit on video and audio encoding, and played with a number of items and clips. To me, the problem is consistently at the beginning of coding of the video track, and results in a delay between 0.7 and 1.1 seconds. This delay is in all cases just constantly carried throughout the export. As I wrote, I can't read the code. But the workaround seems obvious: wait for the first fully established frame, and skip audio encoding until the time stamps match. |
|
@udippel the things is not that simple and each case needs investigation. It may become platform specific, device specific (including device that produces the clip) and so on. If you have file sample that causes desync issues for you, please share it together with the OpenShot log-files it may help developers to improve the application. |
|
@SuslikV, up to you to have your opinion. I agree with you that an example file and a log file are most helpful in individual cases. Though such has been provided from other contributors. Here, and that is why I wrote, I observed some behaviour on a large amount of clips, and could pinpoint all sync faults to the commencement of the video encoding. I did hope that this might help at the search for the processing bug in this otherwise splendid software. |
|
@udippel I'll give you a mp4 file about 1 hour long that was made in Audacity and rendered with OpenShot. It has stereo track in it. It includes 1 kHz sync beats with insignificant perceptional delay of the sound (constant delay for each beat but each first L has no delay). This is 6 blocks of repeating L then R channel signal about 0.1 sec long at each second, that were inserted per each 10 min of video. Each sound has visual confirmation of sign "0" (left channel, first in a sequence) and sing "1" (right channel, second in a sequence) that itself is about 0.1 sec long. You may try to apply similar edits to this file and export it again to see if sync is preserved for you. I recommend mp4 output at 18 crf, 30fps, 48fHz, aac. Test file, about 0.8 MB to download (crc of the zip archive MD5:C4747E69273AD799401C3CC37A20EE43): |
|
Thanks for the file. Alas, we seem to talk different languages, which could be my fault. :-( Your file seems to confirm quite what I assumed: sync is NOT lost over time, and your file proves this assumption. In my observation, sync is always lost within the first few second(s) after some cut/edit point and leaves the incurred delay throughout the rest of the clip constant. I'd be curious on how rendering of a cut is actually dealt with. On the GUI it looks like a continuous stream of data, which it actually isn't. Audio comes in around 50.000 times per second, which is very much okay for the human ear. Video, however, comes only some 50 times per second, and only sparsely with fully available frame data (keyframes). Cutting video is therefore limited to around 50 points in time per second (all frames are reconstructed, if necessary from previous and subsequent frames). How does encoding work, when previous frames (P,B) are unavailable due to the cut? Graceful degradation or skipping? |
|
So, you able to edit the mentioned file without issues? Or you think I made it 1 hour long just for fun? |
|
I need help in this issue as well.... cannot get my file to export without desyncing. tried everything i know so far... |
|
@JustaKing4 try Audacity for audio processing, then save it in uncompressed wav format and import it in OpenShot (don't forget to disable source audio of the clip by either Separate Audio from right-click menu or set Enable Audio = 0 from Properties, manually). No other workaround is available right now. |
|
What do i import into audacity though...? The project was put together and edited in openshot...the sound that desyncs in the video is the sound recorded with the video already, not sound i added to the video. So i dont understand what to do. Thank you for the help, by the way, it is really appreciated.
Get BlueMail for Android
…On Jun 15, 2019, 10:52 PM, at 10:52 PM, SuslikV ***@***.***> wrote:
@JustaKing4 try Audacity for audio processing, then save it in
uncompressed wav format and import it in OpenShot (don't forget to
disable source audio of the clip by either _Separate Audio_ from
right-click menu or set _Enable Audio_ = 0 from _Properties_,
manually). No other workaround is available right now.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1290 (comment)
|
|
@JustaKing4 Audacity (when it stalled with the FFmpeg module) can import audio from video file - just drag-n-drop the file into the Audacity. |
|
My solution is this:
Play back with VLC, and adjust until everything is okay (VLC allows
adjustment of delay video vs audio).
Note the delay. Then use ffmpeg to copy audio with a preset delay to video:
ffmpeg -itsoffset 1.0 -i input_file.mp4 -i input_file.mp4 -map 0:0 -map 1:1
-acodec copy -vcodec copy synced.mp4
The 1.0 in this example is the delay in seconds found by using VLC.
input_file is what the name says, and synced is the output file in sync
form.
Hope this helps.
Uwe
…On Sat, 15 Jun 2019 at 23:42, JustaKing4 ***@***.***> wrote:
I need help in this issue as well.... cannot get my file to export without
desyncing
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1290?email_source=notifications&email_token=AL7P5GG2DR6HTPTSQDIROYDP2VO3RA5CNFSM4ERNIL72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXZATZQ#issuecomment-502401510>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL7P5GGAP2YWEKEC4NR5V33P2VO3RANCNFSM4ERNIL7Q>
.
|
|
I must not have done it right, because it says it cannot process the file when i try to import it into audacity. I did discover that exporting the file as a MOV file does not cause a delay though. Not sure what difference that file has compared to the others, but it seems to work.
Get BlueMail for Android
…On Jun 17, 2019, 4:37 PM, at 4:37 PM, SuslikV ***@***.***> wrote:
@JustaKing4 Audacity (when it stalled with the FFmpeg module) can
import audio from video file - just drag-n-drop the file into the
Audacity.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1290 (comment)
|
|
@JustaKing4 in Audacity (v2.1.3) the corresponding setting for FFmpeg module (.dll) was in the main menu Edit>Preferences>Libraries |
|
I have this issue. I am watching video with openshot and recording commentary in Audacity. I export the commentary from Audacity, import into Openshot, and the sound desynchs over time all the way through. Moderately consistently, at that. In searching for a "fix" for it, I found this: I would call this a temporary workaround until whatever the actual issue is with it gets fixed. Because bitrate is variable it seems, different areas stretch and compact in different ways. No idea how to fix it, but I'm betting it's the bitrate interpretation that's the issue. :( You can reproduce this yourself. Play a video of your own in Openshot and record your commentary with audacity, going for at least 5 minutes. Export from Audacity, import into OS. Figure out and clean up the start of your audio so the timing is right. Re export and do all the shenanigans involved in putting the file back into OS. Then play it through. It will desynchronize by the end of the video. IF it doesn't, I want to know what your export settings are. I'm exporting to ACC/M4U, not MP3, since recompressing it with OS tends to make mp3s crunchier. Hope it helps someone out there! |
|
@TharenaMelishka you chosen the worst way to make voice over. This job is usually done in short fragments. The recording device shouldn't interfere with the video playback device in any way. The best sample (from all tries) goes into production. |
|
@SuslikV I'm confused. Are you saying 5 minutes in a video that's 20-30 minutes isn't a short fragment? I'm doing scene by scene. Do I need to clip audio in sentence by sentence into Openshot? It already has a hard time handling multiple files, sentence by sentence audio would be ridiculous. For the record, I'll record a much longer clip with the same sentence multiple times, or do 3 or 4 takes, then clip out my favourite and use it.. clipped INTO the appropriate space so timing would remain accurate to the original pacing of the recording. But the recording process itself is IRRELEVANT to the issue. I'm still importing a 5 minute audio file that's the compilation of the best bits, and it will STILL have the same desynchronization problem, no matter how I record it. I said reproduce with a straight 5 minutes of recording for simplicity sake of debugging, not because it's the right way to do it when you're doing production. BUT the continuous recording will show you the desync issue with stunning clarity, because you KNOW the audio should line up in a specific way, and instead it balloons and contracts oddly in timing. Having to cycle my audio file after adding or subtracting spacing where appropriate is my most time consuming editing. The audio files clip for clip drop together much faster. Fine editing (breathing, mouth noises, pops and clicks) takes less time. It's why systems like Filmora or Adobe are so good. The inside recording means the program controls the audio, and it always aligns with the video. :/ |
|
@TharenaMelishka I usually export audio from the OpenShot (.mp4 audio container) and then I'm using this audio in Audacity as base for length and everything. Thus, you can line up all things you need. |
|
But OpenShot can't record audio in a voiceover.... I have no choice but to
watch raw footage in OS and record using Audacity. Which is what is the
recommended procedure is currently for doing voiceovers, because OS doesn't
RECORD audio. How do you propose I export audio I record in Audacity via
Openshot? If I import the audio and then re-export it, it's still
desynchronized from the footage, which STILL doesn't solve the
desyncrhonization issue.
…On Sun, 26 Jan 2020 at 03:36, SuslikV ***@***.***> wrote:
@TharenaMelishka <https://github.com/TharenaMelishka> I usually export
audio from the OpenShot (.mp4 audio container) and then I'm using this
audio in Audacity as base for length and everything. Thus, you can line up
all things you need.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1290?email_source=notifications&email_token=ACKZNXY23JMKX4NA4NRVRWLQ7VDP5A5CNFSM4ERNIL72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ5OXBI#issuecomment-578481029>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACKZNX3F2R2NZXTWZLVTX5TQ7VDP5ANCNFSM4ERNIL7Q>
.
|
|
To complete my System specifications: |
This is rounding errors and wrong conversion that where here before the OpenShot/libopenshot@c38c55f . You just need most recent OpenShot (look for daily builds or build yourself). |
|
@MrTrainee What system, application version, files samples to reproduce the issue, OpenShot's log-file maybe? |
|
i was trying to export it as a 60 fps and it de-synced and as a 30 fps video it worked. not sure where to get the logs cause all the logs i see are push and pull logs. It says on OpenShot properties that it's 2.5.1.0. if by system you mean like PC specs then it's: |
|
@MrTrainee look for folder |
|
i ran a search on my installation folder of openshot and was unable to find a folder with that name |
|
@MrTrainee From de user-guide: Cheers! |
|
that explains it |
|
@MrTrainee Nothing special I found in the logs. You may try daily build of OpenShot, if this even helps... |
|
I can confirm that this issue remains on v2.5.1, tried to export with H.265 and H.264 libs, until I choose to export at 30 FPS the problem has gone, the source video is at 59.91 FPS, but variable along the video cause is a gameplay. Is incredible that this issue is 2 yo. |
|
Confirming I get this on Fedora 32 - v2.5.1 as well. Luckily the video I made isn't super dependent on audio sync, but this is super frustrating. Exported to 1080-60. |
|
The sync issue isn't even consistent when I slice multiple clips. They all originate from the same camera, and are al perfectly fine in VLC/mpv/... when played back on their own. In my case: Someone suggested MOV as transport rather than MP4, so now trying that and waiting a few hours on export. I agree with jjguz71 that it is quite incredible that this issue is here for two years. |
|
short follow-up: exporting as MOV works, so it apparently is something in the .mp4 transport / encoder. |
|
Confirming I encoded to MP4 when I had the problem as well. |
|
I can confirm that encoding as MOV is a workaround. I had no success with MP4. |
|
In my case not even MOV worked when I export to HD 1920x1080
If I export to 1280x720 them it is ok no matter whether MOV or MP4
…On 07/08/2020 19:09, Sebastian Graf wrote:
I can confirm that encoding as MOV is a workaround. I had no success
with MP4.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1290 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO6BPYG3JMTK7IXAFPHFY3LR7QYOLANCNFSM4ERNIL7Q>.
|
|
had audio desync with export to mp4.. trying an export to mov now and will report. note: using 720 preset but changing frame rate to 60 so as to match the original recording. edit/update: mov file also had audio desync. edit/update2: changed audio sample rate in obs to match the audio sample rate in the openshot preset and it worked with both mp4 and mov. audio synced. |
|
This is a frustrating issue because as I have come back over the past two years time and continued using OpenShot, and kept thinking this issue was resolved I would use it again and encounter the same issue with different conditions. It seems random, though I know it cant be... I have had the issue exporting to MOV and MP4, it just seems to work sometimes in one and not the other. If I fiddle with the Audio frequency in the export options, sometimes that fixes it but not always. Switching around the resolution output and many other options seems to help sometimes but not other times with the exact same conditions. I dont understand it. The only time I have zero issues with the desync issue is when working on a very small project that I complete within a small timeframe and then, its fine. Maybe it is a file size related issue or something happens over time with the file sitting there. I dont know but Im just trying to help, seeing how many people are experiencing this issue, and thats the only common factor I can find with this issue, ei; working with a file over a long timeframe that becomes quite large itself with many components. |
|
keeping it short, i had the same issues (mp4/mov audio out of sync with longer videos) but seem to have fixed them for my purposes. i am recording using obs, editing/exporting from openshot but in my situation i had to create my own profiles in openshot. drag out a profile close to the one you need, edit it, and make sure your resolution matches that of the source video. frames and audio sample rate of the export also needs to match the original video or at least in my case it does (i've tried other settings but failed). here is an example of one of the profiles i created. description=MOS HDV 1360x768p 60 fps hopefully not breaking any rules here but i'll give a link to 8, 20, and 40 min videos using this method and the audio is in sync and sounds great (the black mesa videos) https://www.youtube.com/channel/UCxvrCjFT8synJOBqTVMLn4Q/videos?view_as=subscriber edit: i forgot to mention that i clipped the front and back of all three videos before exporting for audio sync testing purposes. |
|
I had this issue, similar to what others have described - while watching the preview, audio is perfectly in sync with the video. After exporting, however, there's a noticeable delay: input video: .mov 1920x1080 60fps (I'm not sure if preview profile is relevant, but I set it to 1080p 60fps to match input & output just in case) For me, a consistent fix came from going into advanced settings while exporting and setting the audio sample rate to 44100 under the default aac codec (the default sample rate appears to be 48000 for some reason). My video input was using 44100. |
|
same. i changed obs to 48 and it surely helped. |
|
Sorry this is not going to be a complete bug report but just to add that this issue is still "live" - at least for me. It'd be great to understand what I need to do to avoid this issue. Very keen to see open source stuff thriving. --- info on what I tried before I gave up and used another tool (pressing deadline, hope to return) --- Using latest stable version on Ubuntu 20.04.01 LTS Inputs are well synced. Edit into 11min video with 8 main segments, additional titles and fades results I imported the second of these, split the audio and re-exported. Changing the preview mode changed the amount I had to adjust the offset after each cut, to get the preview to sync ok. After exporting the supposedly re-synced video, the audio was again out of sync, so with a deadline looming, I imported into Davinci Resolve in windows, and did the same process there - and got a result that was consistently synced - using the same export format. Incidentally, I have source video from different providers and probably am not in a position to ask them to all use the same settings because they use a disparate set of recording methods. The advice above appears to suggest that all inputs must be encoded identically, and/or that one should try exporting to different output formats to see which is working, and that cutting causes issues - all of which I tried to do (d'oh). (sorry cannot show videos due to confidential content) |
|
I hadn't considered (or had to deal with) different formats of input sources. I'd be curious though - Have you tried separating the audio (e.g. importing in a program like audacity and exporting to a common format at a common rate before importing into OpenShot)? In that scenario, you may still have to align audio to video and set the video clip volume to 0.00, but you should be able to do that via the preview and the final export syncing should match the preview. This of course would be more of a workaround, but could help confirm the conditions for the issue. |
|
Good shout - happy to give that a whirl when deadlines permit, and see if it helps partition the issue a bit / becomes a useable workaround for this case. |
|
I tried everything I could find here and nothing worked, but shortly after searching through my settings I noticed that my "Default Profile" was set to 720p 30fps, after changing it to "HD 1080p 60fps" and exporting the file again the audio was in sync. P.S.: and now the bad news, you will probably need (I think) to redo the whole project with these new settings |
|
i guess the basic premise here is that with a good video editor, we should be able to change the resolution and fps, file type, etc etc, and have a video of our choosing, in audio sync. |
|
I still face this issue. tried several of the hints here but nothing worked. |
Many thanks to you Tealc1980 - this resolved the same issue I had! A thousand thanks!!! |
scwiba commentedFeb 20, 2018
Operating System / Distro: Windows 7
OpenShot Version: 2.4.1
When previewing videos in OpenShot, the video and audio are perfectly synced. After exporting, the audio always ends up about a quarter of a second ahead of the video, all the way throughout. I've tried exporting with different settings and at different framerates and it doesn't seem to have any effect on the desync. This is probably a stupid oversight on my part since I'm new to video editing, but can anyone help me out here? Thanks!
The text was updated successfully, but these errors were encountered: