From Wang Rui, "additional FFmpegParameters class in the ffmpeg plugin for setting parameters before opening the video file, which benefits from getPluginStringData() as shown in the ReaderWriter implementation.
Now we can use ffmpeg to render webcam video (using the vfwcap device) under Windows: osgmovie 0 -e ffmpeg -O "format=vfwcap frame_rate=25" The number 0 just indicates a default device number in ffmpeg. I think this can work under Linux, too, and should be a bit better than comparing the filename with a '/dev/' string. Just type: ./osgmovie /dev/yourcam -e ffmpeg -O "format=video4linux2 frame_rate=30 size=320x240""
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
#include "FFmpegImageStream.hpp"
|
||||
#include "FFmpegAudioStream.hpp"
|
||||
#include "FFmpegParameters.hpp"
|
||||
|
||||
#include <OpenThreads/ScopedLock>
|
||||
#include <osg/Notify>
|
||||
@@ -60,11 +61,11 @@ FFmpegImageStream::~FFmpegImageStream()
|
||||
|
||||
|
||||
|
||||
bool FFmpegImageStream::open(const std::string & filename)
|
||||
bool FFmpegImageStream::open(const std::string & filename, FFmpegParameters* parameters)
|
||||
{
|
||||
setFileName(filename);
|
||||
|
||||
if (! m_decoder->open(filename))
|
||||
if (! m_decoder->open(filename, parameters))
|
||||
return false;
|
||||
|
||||
setImage(
|
||||
|
||||
Reference in New Issue
Block a user