--imem-get=... suyddenly became an invalid option
Posted: 07 May 2015 11:57
Hi all
This is my first post on this forum.
I'm working on building a client/server software that needs to stream videos from the server to the client.
I am very new to video streaming and more generally codecs compression image format and so on. You can calassify me as noob.. ^^ I won't be offensed.
Ok, so here is my problem.
We've been abble to set up a mechanisme to stream our video from the server to the client. It was working (not yet wroking find but working). Suddenly and for no apparent reason, it stopped working. Same code executed in the same way brings us to a new error message that was not there before.
:
And of course we ve changed nothing that could explain this.
vlc version 2.2.0
Here is the piece of code to init the streaming:
and the vlcWriterGetCallback
Thanks in advance for any help or information you can provide
Please let me know if you need more details or want me to perform some tests.
Zaluum
This is my first post on this forum.
I'm working on building a client/server software that needs to stream videos from the server to the client.
I am very new to video streaming and more generally codecs compression image format and so on. You can calassify me as noob.. ^^ I won't be offensed.
Ok, so here is my problem.
We've been abble to set up a mechanisme to stream our video from the server to the client. It was working (not yet wroking find but working). Suddenly and for no apparent reason, it stopped working. Same code executed in the same way brings us to a new error message that was not there before.
:
vlc: unknown option or missing mandotry argument '--imem-get=SOMENUMBERS', Try 'vlc --help' for more inforamtion?.
And of course we ve changed nothing that could explain this.
vlc version 2.2.0
Here is the piece of code to init the streaming:
Code: Select all
if (!vlcWriterData){
vlcWriterData = new VlcWriterData();
}
std::vector<const char*> args;
char imemGetCb[256];
sprintf(imemGetCb, "--imem-get=%lld", vlcWriterGetCallback);
args.push_back(imemGetCb);
char imemReleaseCb[256];
sprintf(imemReleaseCb, "--imem-release=%lld", vlcWriterReleaseCallback);
args.push_back(imemReleaseCb);
char data[256];
sprintf(data, "--imem-data=%lld", vlcWriterData);
args.push_back(data);
char imemWidth[128];
sprintf(imemWidth, "--imem-width=%d", size.width);
args.push_back(imemWidth);
char imemHeight[128];
sprintf(imemHeight, "--imem-height=%d", size.height);
args.push_back(imemHeight);
args.push_back("--imem-fps=30");
args.push_back("--imem-id=1");
args.push_back("--imem-group=1");
args.push_back("--imem-cat=2");
args.push_back("--imem-codec=RV24");
char imemSOut[512];
//sprintf(imemSOut, "--sout=#transcode{venc=ffmpeg{keyint=1},vcodec=mp4v,vb=800}:rtp{access=udp{caching=10},mux=ts{use-key-frames},dst=%s,port=%d,sdp=sap://,name=\"%s\"}", ip.c_str(), (int)port, (filename.empty()) ? "default" : filename.c_str());
sprintf(imemSOut, "--sout=#transcode{venc=ffmpeg{strict=1},vcodec=mjpg,vb=0}:standard{access=http{mime=image/jpeg},mux=mpjpeg,dst=:%d/%s.mjpg}", (int)port, name.c_str());
args.push_back(imemSOut);
args.push_back("--no-sout-rtp-sap");
args.push_back("--no-sout-standard-sap");
args.push_back("--ttl=1");
args.push_back("--sout-keep");
args.push_back("-I");
args.push_back("dummy"); // Don't use any interface
args.push_back("--ignore-config"); // Don't use VLC's config
args.push_back("--verbose=0"); // minimal verbose
args.push_back("--no-audio");
args.push_back("--no-osd");
args.push_back("--clock-jitter=0");
vlcWriter = libvlc_new(int(args.size()), args.data());
if (!vlcWriter) return false;
// stream video
libvlc_media_t *vlcWriterMedia = libvlc_media_new_location(vlcWriter, "imem://");
vlcWriterMediaPlayer = libvlc_media_player_new_from_media(vlcWriterMedia);
libvlc_media_release(vlcWriterMedia);
vlcWriterData->size = size;
// start reading
libvlc_media_player_play(vlcWriterMediaPlayer);
writing = true;
Code: Select all
int vlcWriterGetCallback(void *data,
const char *cookie,
int64_t *dts,
int64_t *pts,
unsigned *flags,
size_t * bufferSize,
void ** buffer)
{
SHTSDK::VlcWriterData* imem = (SHTSDK::VlcWriterData*)data;
if (imem == NULL || imem->image.empty()){
return 1;
}
imem->mutex.lock();
*bufferSize = imem->image.rows*imem->image.cols*imem->image.channels();
*buffer = imem->image.data;
*dts = -1;
*pts = libvlc_clock();
//*dts = *pts = libvlc_clock();
//*dts = *pts = imem->mPts = imem->mPts + 33333;
//*dts = *pts = 33333;
return SHTSDK_OK;
}
Please let me know if you need more details or want me to perform some tests.
Zaluum