LinuxQuestions.org
Help answer threads with 0 replies.
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-08-2014, 12:17 AM   #1
glupa4e
Member
 
Registered: Jan 2011
Posts: 325

Rep: Reputation: 7
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, 05:20 AM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
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 07:01 AM. Reason: Typo
 
Old 02-08-2014, 07:44 AM   #3
glupa4e
Member
 
Registered: Jan 2011
Posts: 325

Original Poster
Rep: Reputation: 7
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, 11:39 AM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,351

Rep: Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382
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 09: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 02:20 AM
LXer: Listening to and recording audio and video streams with MPlayer LXer Syndicated Linux News 0 10-29-2007 01:50 PM
Recording video streams via a proxy Dafydd ab Iago Linux - Desktop 2 02-01-2007 02:42 PM
Recording RealMedia Audio Streams remyfenn Linux - Software 2 10-02-2005 10:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:59 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration