John, Pardon the late answer to your question. I'm just getting back to Cinelerra after a hiatus.
Generally, I keep video captures or imports to any type of MPEG file (MPEG-TS, MPEG1, etc) short..less than nine minutes if possible. I do this because I noticed that there was some audio drift over time in MPEG files longer than nine minutes. I did not go further into investigating causes of the drift. MPEG SOURCE FILES to MPEG RENDERED OUTPUT After much study and pain, I've found that when working with MPEG-TS HDV files as my source (and MPEG formats in general), the best pipe to render from Cinelerra in order to alleviate sync headaches is mpeg2enc. I'm not five channel yet, so I just export my 48.1Khz stereo audio as MPEG Layer II audio MP3s @ 384kbps. I then use mplex to combine my audio and video streams into a program stream. Further on, I use VLC to convert that PS into MPEG-TS (HDV) and then use FFMPEG to convert the HDV into DVD and iPod/iPhone compatible formats. QUICKTIME (QT) SOURCE FILES to QT RENDERED OUTPUT If my source video format is Quicktime for Linux (like from a screen capture), then I have no sync problems rendering out to QT for Linux. MPEG SOURCE FILES to QT RENDERED OUTPUT If I render my MPEG-TS, HDV projects using Quicktime for Linux as an output format (MPEG4 or JPEG video w/twos complement or MP4 audio compression), then I will get sync problems in the rendered output. I then follow the following best practices to alleviate the problem: It is a good idea to calibrate your audio-video synchronization before you start a large project. Calibration involves two steps: 1) You need to calibrate the audio you see being played back in the compositor. Do this by setting Audio Offset in the Preferences -> Playback -> Audio Out so that your playback audio is in sync with the video. For reference, my offset is .1 seconds. 2) You'll need to calibrate the audio and video once it is rendered out of Cinelerra. This doesn't have to be the absolute final format of the file. Just an intermediate file format to determine that audio is not drifting and in sync. You'll do this by setting Nudge on your audio tracks so that your rendered audio and video are in sync. Let me give you an example. My projects usually run about an hour on the timeline. So what I do is when I start a project, I will concatenate a bunch of clips or raw videos on the timeline. I will then render a short segment of video, about 15 seconds long, from about 45 minutes into the timeline. The segment I take should have key features like someone speaking or someone hitting a drum that I can use to determine audio synchronization. I then render the file to a format that works well in the various Linux media players: -Quicktime for Linux using MPEG4 video compression and MP4 or twos complement (pcm) audio compression -Quicktime for Linux container using JPEG video compression and MP4 or twos complement The side benefit of using MPEG4 video compression is that it renders damn fast. The good thing about these steps is that if you work with the same format of video over and over, you won't need to change #1, the Audio Offset. TEST YOUR OUTPUT In Fedora, I've found that the best media players to test final output are mplayer, vlc and ffmpeg. Hope this helps, scott ----- Original Message ----- From: "John Detwiler" <[email protected]> To: [email protected] Sent: Monday, December 14, 2009 8:05:41 PM GMT -05:00 US/Canada Eastern Subject: [CinCV] losing sync Hi, Trying to isolate the source of a 'sync' problem, I tried re-importing my rendered project back into Cinelerra, and founc significant timing changes. This is distressing, and I don't know what to make of it or how to fix it. Here are my steps: 1. Render the multi-track project (say, 'project.xml ') in Cinelerra, in the 'documented' way: audio to 'project.ac3' (448 kbps) video to 'project.m2v' (piped to ' ffmpeg -f yuv4mpegpipe -i - -y -target ntsc-dvd -f mpeg2video %') 2. Mux in ffmpeg: $ffmpeg -i project.ac3 -i project.m2v -target ntsc-dvd project.mpg Upon viewing 'project.mpg', I find noticeable loss of sync between sound and picture. 3. So, I imported my rendered files back into the Cinelerra project on new tracks as... (V1) project.m2v (V2) project.mpg (A1) project.ac3 (A2) project.mpg and compared the timing of these tracks to the edits in the original audio & video tracks. 4. I find that the audio-only track (.ac3) appears 'perfectly' in-sync, but ALL the video versions are shifted with respect to the original edits. In the worst case, at 3 minutes on the timeline, 'project.m2v' seems to have dropped more than 2 seconds (60 frames). Surprisingly, the .mpg file -- which was made FROM the .m2v -- has 'only' dropped about 10 frames. By the end of this 13-minute project, the .m2v has lost 3 seconds of video and the .mpg is off by about 10-15 frames. So, it looks as if - even when I've carefully fixed sync in Cinelerra - my final .mpg is likely not to be in sync. Any suggestions on what I should do differently? Thanks! For what it's worth, my Cinelerra is .... Cinelerra 2.1CV Build date: Sat Mar 28 08:14:39 EDT 2009 Quicktime version 2.2.0 (Internal ffmpeg) Libmpeg3 version 1.7.0 _______________________________________________ Cinelerra mailing list [email protected] https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra
