LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-07-2014, 11:17 PM   #1
glupa4e
Member
 
Registered: Jan 2011
Posts: 96

Rep: Reputation: 0
VLC - Audio and Video are out of sync when recording streams


Hello,

i have the following problem - i record streams from Onlive TV and then try to edit them. I am doing it using VLC. I upgraded to the version 2.1.3. from Alienbob's repository. I can record the stream, it os OK. When i replay it in VLC, it looks like OK, but when i play it with Mplayer or Kaffeine - i notice that the sound precedes the video and i have to correct it. I decode the audio using ffmpeg. Then i edit the video with OpenShot or Kdenlive and finaly need to edit the video and audio so that they are synchronous. It is not very esy to do it and additional effort for me. I tried out the PlayOnLinux version ov VLC with Wine, but there are no menus there and the problem remains. I know that this is not probably Slackware spceific problem but i would appreciate if you share your experience.
Thank you!
 
Old 02-08-2014, 04:20 AM   #2
Doc CPU
Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 999

Rep: Reputation: 294Reputation: 294Reputation: 294
Hi there,

Quote:
Originally Posted by glupa4e View Post
i have the following problem - i record streams from Onlive TV and then try to edit them. I am doing it using VLC. I upgraded to the version 2.1.3. from Alienbob's repository. I can record the stream, it os OK. When i replay it in VLC, it looks like OK, but when i play it with Mplayer or Kaffeine - i notice that the sound precedes the video and i have to correct it.
this is a common problem with digital videos. Actually, audio and video streams often have some offset in a A+V stream, but each audio and video stream is supposed to have timestamps embedded into them, so that a player can match those up against each other. VLC does honor these timestamps and plays the streams in sync, but many other players do not. I can confirm that flaw for Mplayer, as well as the integrated player of Avidemux.

The typical solution for this is to demux the file into separate video and audio streams, and then re-multiplex them with timestamps adjusted against each other. Until now, I've only had MPEG2 videos from my TV unit, and I demux them with ProjectX (which fixes some errors in the video stream during the process), then remux them with mplex. However, ProjectX can only handle MPEG2, it cannot deal with MPEG4, which is normally used with HD video. I don't know a good and easy-to-use tool for demuxing MPEG4 video yet, let alone a versatile one that can deal with different video types.

I used to do this sync thing during post-processing (strip commercials, convert into MPEG4) with Avidemux - however, Avidemux can only apply a constant offset over the entire file (and the actual offset sometimes changes during the recording); plus, Avidemux can't detect the correct offset automatically - you have to find it out manually by guessing and trying.
I still have to revert to that method for some recordings, though, because some videos make ProjectX crash in mid-operation; or ProjectX detects bogus video resolutions that apparently change every few frames, even though the video plays fine. Luckily, this is rare.

Quote:
Originally Posted by glupa4e View Post
I know that this is not probably Slackware spceific problem
Indeed, it's not. ;-)

[X] Doc CPU

Last edited by Doc CPU; 02-08-2014 at 06:01 AM. Reason: Typo
 
Old 02-08-2014, 06:44 AM   #3
glupa4e
Member
 
Registered: Jan 2011
Posts: 96

Original Poster
Rep: Reputation: 0
Hello Doc CPU,

thank you for your post. As a workaround i found a way to split the video and audio. I extract the audio using ffmpeg. Then i edit the video in OpenShot or Kdenlive. Then i create a new video from the edited audio and video but this manual guessing is sometimes difficult. Unfortunately those offsets exist. Sometimes OpenShot or Kdenlive crashes but that is life.
 
Old 02-08-2014, 10:39 AM   #4
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,665

Rep: Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440
Both MPlayer and VLC can deal with this by delaying the video or audio stream during playback.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which program should I use to recording audio streams...? cbjhawks Linux - Software 1 01-26-2010 08:26 AM
Audio completely out of sync with video playback. (FFmpeg/Xine/VLC) 12.2/2.6.27.7-smp camphor Slackware 9 02-17-2009 01:20 AM
LXer: Listening to and recording audio and video streams with MPlayer LXer Syndicated Linux News 0 10-29-2007 12:50 PM
Recording video streams via a proxy Dafydd ab Iago Linux - Desktop 2 02-01-2007 01:42 PM
Recording RealMedia Audio Streams remyfenn Linux - Software 2 10-02-2005 09:32 AM


All times are GMT -5. The time now is 12:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration