Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-17-2005, 03:04 PM   #1
Jeon, Chang-Min
LQ Newbie
Registered: Jul 2005
Location: South Korea
Posts: 9

Rep: Reputation: 0
i want to sync my video using ffmpeg

I create my program which play multimedia files using ffmpeg library.

I'm trying to sync video and audio.

my decode source following line.

if(av_read_frame(m_pFormatCtx, &packet) >= 0)

if(packet.stream_index == m_nAudioStream)
audioDecoded = avcodec_decode_audio(m_pAudioCtx, m_outbuf, &m_count,, packet.size);

if(packet.stream_index == m_nVideoStream)

bytesDecoded = avcodec_decode_video(m_pCodecCtx, m_pFrame, &frameFinished,, packet.size);


ImgReSampleContext *s;
s = img_resample_full_init( m_width, m_height, m_pCodecCtx->width, m_pCodecCtx->height, 0, 0, 0, 0 ,0 ,0, 0 ,0);
img_resample(s, (AVPicture *)m_pic, (AVPicture *)m_pFrame);

img_convert((AVPicture *)m_pFrameRGB, PIX_FMT_RGB24, (AVPicture *)m_pic, PIX_FMT_YUV420P, m_width, m_height);


anyway sync is correct because play_sound function.

but i can't use play_sound to sync audio and video

anyone who use ffmpeg libaray to decode video files ?

Last edited by Jeon, Chang-Min; 11-17-2005 at 03:07 PM.


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
MPlayer Audio/Video out of sync koyi Slackware 3 09-24-2005 06:23 PM
Sound and Video out of Sync in KDE RAMMS+EIN Linux - Software 2 06-17-2005 05:25 PM
Sound and Video are Out of Sync in SuSE 9.3 RAMMS+EIN Linux - Hardware 0 06-04-2005 11:00 AM
Transcode - Video and Audio not in sync davecs Linux - Software 1 06-01-2004 02:52 PM
Sound out of sync with Video for movies Relativity Linux - Software 2 04-23-2004 05:44 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:22 AM.

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