OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

OsgMovie ffmpeg and audio (SDL2) - Audio seems to make video slower. Audio has hiccoughing


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Andrea74
User


Joined: 24 Aug 2009
Posts: 81

PostPosted: Mon Jun 11, 2018 2:36 pm    Post subject:
OsgMovie ffmpeg and audio (SDL2) - Audio seems to make video slower. Audio has hiccoughing
Reply with quote

Hi everyone,
i'm using osg3.5.6 on visual studio 2013 (windows 10), and i'm using ffmpeg plugin combined with SDL2 to play video and audio streaming with osgmovie example.
If i don't use SDL2 (no audio), video streaming works fine.
If i add SDL2 (audio), i get two bad results:
1) video stream get slower
2) Audio has hiccoughing

I tryied with some video examples (with different resolutions) but i get the same result.

Following, i report audio streaming output displayed on the console:

ffmpeg::open(C:\Movie\surfers_360.mp4) size(2048, 1024) aspect ratio 1
Attaching FFmpegAudioStream
AudioStream read []
FFmpegAudioStream::setAudioSink( 00000277C50FEEE0)
Assigning 00000277C50FEEE0
image->s()2048 image-t()=1024 aspectRatio=1
SDLAudioSink()::startPlaying()
audioFrequency()=48000
audioNbChannels()=2
audioSampleFormat()=4
SampleFormat = SAMPLE_FORMAT_F32

I'm wondering if i should continue with ffmpeg and sdl libraries, or i have to look at another one. In this last case, could you suggest me some way to follow? (link, examples, ...)

Thank you!

Cheers,
Andrea
Back to top
View user's profile Send private message
Voerman, L.
Guest





PostPosted: Mon Jun 11, 2018 3:09 pm    Post subject:
OsgMovie ffmpeg and audio (SDL2) - Audio seems to make video slower. Audio has hiccoughing
Reply with quote

Hi Andrea,did you have a look at the load on the cpu cores? The slowdown seems to indicate a cpu core hitting 100% load.
this link might help you further: http://forum.openscenegraph.org/viewtopic.php?p=72124#72124
Regards, Laurens.


On Mon, Jun 11, 2018 at 4:36 PM, Andrea Martini < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi everyone,
i'm using osg3.5.6 on visual studio 2013 (windows 10), and i'm using ffmpeg  plugin combined with SDL2 to play video and audio streaming with osgmovie example.
If i don't use SDL2 (no audio), video streaming works fine.
If i add SDL2 (audio), i get two bad results:
1) video stream get slower
2) Audio has hiccoughing

I tryied with some video examples (with different resolutions) but i get the same result.

Following, i report audio streaming output displayed on the console:

ffmpeg::open(C:Moviesurfers_360.mp4) size(2048, 1024) aspect ratio 1
Attaching FFmpegAudioStream
AudioStream read []
FFmpegAudioStream::setAudioSink( 00000277C50FEEE0)
Assigning 00000277C50FEEE0
image->s()2048 image-t()=1024 aspectRatio=1
SDLAudioSink()::startPlaying()
  audioFrequency()=48000
  audioNbChannels()=2
  audioSampleFormat()=4
  SampleFormat  = SAMPLE_FORMAT_F32

I'm wondering if i should continue with ffmpeg and sdl libraries, or i have to look at another one. In this last case, could you suggest me some way to follow? (link, examples, ...)

Thank you!

Cheers,
Andrea

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74033#74033





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
Andrea74
User


Joined: 24 Aug 2009
Posts: 81

PostPosted: Mon Jun 11, 2018 3:33 pm    Post subject:
OsgMovie ffmpeg and audio (SDL2) - Audio seems to make video slower. Audio has hiccoughing
Reply with quote

Hi Voerman,
thank you for your fast replay.
I looked at post you suggested, and i downloaded (and compiled) the FFmpegDecoderVideo.zip
Unfortunally, i get the same result.
Following i attached some graphical information about stats and CPU usage.

Cheers,
Andrea
Back to top
View user's profile Send private message
Voerman, L.
Guest





PostPosted: Mon Jun 11, 2018 3:42 pm    Post subject:
OsgMovie ffmpeg and audio (SDL2) - Audio seems to make video slower. Audio has hiccoughing
Reply with quote

Hi Andrea,To display the usage of the cpu cores in the task viewer you need to right click the cpu graph, select "Change graph to" and select "Logical Processors".
From "overall usage" we cannot see if that's one core at 100% and the rest near zero or something else.
Laurens.


On Mon, Jun 11, 2018 at 5:33 PM, Andrea Martini < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Voerman,
thank you for your fast replay.
I looked at post you suggested, and i downloaded (and compiled) the      FFmpegDecoderVideo.zip
Unfortunally, i get the same result.
Following i attached some graphical information about stats and CPU usage.

Cheers,
Andrea

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74038#74038




_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
Andrea74
User


Joined: 24 Aug 2009
Posts: 81

PostPosted: Tue Jun 12, 2018 7:04 am    Post subject:
OsgMovie ffmpeg and audio (SDL2) - Audio seems to make video slower. Audio has hiccoughing
Reply with quote

Hi Laurens,
sorry for my mistake. I attached the detailed snapshot of both rendering window (with stats) and CPUs usage.
Frame rate is good (60Hz), but i continue to get a bad audio and to get a video play slower.
I would like to underline that if i play this video with a player like VLC, all works fine.
Another detail about osgmovie example with SDL2 (when i play a video stream .mp4 with audio) is the following: i get a good quality for the first 3 or 4 seconds of video, and then i start to get audio hiccoughing and video slower.
I don't know if problem could be focused on some streaming buffer (audio and video) management.

Thank you!

Cheers,
Andrea

PS:

i downloaded SDL2 from: https://www.libsdl.org/download-2.0.php
SDL2-devel-2.0.8-VC.zip (Visual C++ 32/64-bit) I'm using 64bit version

About ffmpeg, i downloaded from: https://ffmpeg.zeranoe.com/builds/
version 4.0
Windows 64bit
Back to top
View user's profile Send private message
Voerman, L.
Guest





PostPosted: Tue Jun 12, 2018 1:28 pm    Post subject:
OsgMovie ffmpeg and audio (SDL2) - Audio seems to make video slower. Audio has hiccoughing
Reply with quote

Hi Andrea,The ffmpeg version I was using did not have this problem, (ffmpeg-20160517-git-af3e944-win64-shared)
but after updating to ffmpeg-4.0 I could hear and see the problem as well.
I've tried ffmpeg versions 3.4.2 and 3.2 as well - still problems,
found a binary version of 3.0 here (build 2016-02-0Cool - that works.
I don't have a build setup for ffmpeg yet, so I can't dig down to the actual problem, but I hope finding a working version helps you along.


Laurens.




On Tue, Jun 12, 2018 at 9:04 AM, Andrea Martini < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Laurens,
sorry for my mistake. I attached the detailed snapshot of both rendering window (with stats) and CPUs usage.
Frame rate is good (60Hz), but i continue to get a bad audio and to get a video play slower.
I would like to underline that if i play this video with a player like VLC, all works fine.
Another detail about osgmovie example with SDL2 (when i play a video stream .mp4 with audio) is the following:  i get a good quality for the first 3 or 4 seconds of video, and then i start to get audio hiccoughing and video slower.
I don't know if problem could be focused on some streaming buffer (audio and video) management.

Thank you!

Cheers,
Andrea

PS:

i downloaded SDL2 from:  https://www.libsdl.org/download-2.0.php   
SDL2-devel-2.0.8-VC.zip (Visual C++ 32/64-bit)   I'm using 64bit version

About ffmpeg, i downloaded from: https://ffmpeg.zeranoe.com/builds/
version 4.0
Windows 64bit

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74043#74043




_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
Andrea74
User


Joined: 24 Aug 2009
Posts: 81

PostPosted: Tue Jun 12, 2018 2:31 pm    Post subject:
Post subject: OsgMovie ffmpeg and audio (SDL2) - Audio seems to make video slower. Audio has hiccoughing
Reply with quote

Hi Lauren,
GREAT!!! It's works!
Using the 3.0 version of ffmepg, i can play both video and audio correctly.
Thank you a lot!

Cheers,
Andrea
Back to top
View user's profile Send private message
Javier Taibo
Guest





PostPosted: Tue Jun 12, 2018 6:26 pm    Post subject:
OsgMovie ffmpeg and audio (SDL2) - Audio seems to make video slower. Audio has hiccoughing
Reply with quote

  Hi,

  Try replacing m_context->time_base by m_stream->time_base in FFmpegDecoderVideo::decodeLoop() (FFmpegDecoderVideo.cpp)


  This should solve your problem with FFMPEG versions after 3.0




  Cheers!




On Mon, Jun 11, 2018 at 4:36 PM, Andrea Martini < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi everyone,
i'm using osg3.5.6 on visual studio 2013 (windows 10), and i'm using ffmpeg  plugin combined with SDL2 to play video and audio streaming with osgmovie example.
If i don't use SDL2 (no audio), video streaming works fine.
If i add SDL2 (audio), i get two bad results:
1) video stream get slower
2) Audio has hiccoughing

I tryied with some video examples (with different resolutions) but i get the same result.

Following, i report audio streaming output displayed on the console:

ffmpeg::open(C:Moviesurfers_360.mp4) size(2048, 1024) aspect ratio 1
Attaching FFmpegAudioStream
AudioStream read []
FFmpegAudioStream::setAudioSink( 00000277C50FEEE0)
Assigning 00000277C50FEEE0
image->s()2048 image-t()=1024 aspectRatio=1
SDLAudioSink()::startPlaying()
  audioFrequency()=48000
  audioNbChannels()=2
  audioSampleFormat()=4
  SampleFormat  = SAMPLE_FORMAT_F32

I'm wondering if i should continue with ffmpeg and sdl libraries, or i have to look at another one. In this last case, could you suggest me some way to follow? (link, examples, ...)

Thank you!

Cheers,
Andrea

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74033#74033





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
Javier Taibo

------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts How make my app to load plugins marco.beninca General 1 Thu Dec 06, 2018 2:34 pm View latest post
No new posts playing videos with audio channels wi... Trajce Nikolov NICK General 7 Wed Nov 21, 2018 9:17 pm View latest post
No new posts Synchronize FFMPEG Video with Clock MaFa18 Plugins [osgPlugins] 0 Tue Aug 07, 2018 7:45 am View latest post
No new posts osgmovie - ffmpeg or Gstreamer Andrea74 General 7 Fri Jun 22, 2018 3:26 pm View latest post
No new posts How to make isometric view jgarneau General [forum] 3 Thu Mar 08, 2018 4:33 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP