PDA

View Full Version : Play RTMP in libvlc (video in QWidget)



braders2
3rd January 2014, 22:40
Hi guys,
I write program (QT 5.1) which will be play RTMP in libvlc. I don't know how i can to do. I always used rtmpdump for example (rtmpdump -r rtmp://94.102.63.23:443/share/gc-h2kmq -f WIN 11,9,900,152 -p http://www.sharecast.to ). But how I can play this link in libvlc? Can u help me? I read about librtmp, but I dont know where I can download this library for Windows. Video from hard disk is normally played in QWidget.

braders2
4th January 2014, 18:49
Any idea? :(

wysota
4th January 2014, 21:29
Why are you asking here and not on some libvlc forum?

braders2
4th January 2014, 23:57
I asked but unanswered. Ok can u help with rtmpdump? I found source code http://pigeonsnest.co.uk/stuff/rtmp/rtmpdump/index.html but when i compile rtmpdump.cpp in QT 5.1 show me 131 problems for example "D:\Qt\Qt5.1.1\Tools\QtCreator\bin\nienazwany4\main .cpp:123: błąd:undefined reference to `RTMP_LIB::RTMPPacket::RTMPPacket()'" or "D:\Qt\Qt5.1.1\Tools\QtCreator\bin\nienazwany4\main .cpp:138: błąd:undefined reference to `Log(int, char const*, ...)'"
Can u help me compile rtmpdump.cpp ?

wysota
5th January 2014, 11:20
I suggest that you try to tell us what exactly you are trying to do as I think you are trying to pry open doors that are already open.

braders2
5th January 2014, 12:25
What you mean?

wysota
5th January 2014, 15:28
I mean tell us why you want to use rtmpdump.

braders2
5th January 2014, 19:48
I want use rtmpdump to playbacks stream in my program (exactly in QWidget). RTMPdump.exe is separate program. I run it from my program:

QProcess* process = new QProcess();
QString program = "rtmpdump -r rtmp://94.102.63.23:443/share/gc-h2kmq -f WIN 11,9,900,152 -p http://www.sharecast.to -o stream.flv";
process->setProcessChannelMode(QProcess::MergedChannels);
process->start(program);
It works but rtmpdump.exe output directs the stream to file "stream.flv". I wanna use RTMPdump.exe output directs to my program, but i don't know Can I do that. My program is run when i open RTMPdump.exe by QProcess... How I can direct rtmpdump.exe output to running my program?
Maybe u know how compile rtmpdump.cpp then will be easier...

wysota
5th January 2014, 22:02
If you have a tool that doesn't do what you want then why use it? Wikipedia claims you should rather use librtmp (http://rtmpdump.mplayerhq.hu/librtmp.3.html)

braders2
5th January 2014, 22:17
Where Can I get librtmp which will be work and compile in QT 5.1? I had 3 version and none compile in QT :/

wysota
5th January 2014, 22:25
Where Can I get librtmp which will be work and compile in QT 5.1? I had 3 version and none compile in QT :/

You don't compile it "in QT", you compile it like any other C library with your compiler.

braders2
5th January 2014, 22:48
Can u tell me where I can download correctly LIBRTMP and how compile it (MinGW)? And next how use compiled LIBRTMP in QT?

wysota
6th January 2014, 00:04
Can u tell me where I can download correctly LIBRTMP and how compile it (MinGW)? And next how use compiled LIBRTMP in QT?

librtmp is part of rtmpdump. The archive has a README file which contains information how to build the package. This has nothing to do with Qt.

braders2
6th January 2014, 02:20
It is QT project use librtmp library made by Vladimir Lushpenko when I Debug and Build show me a lot of errors, I can't Build this project. Can u tell me step by step how Build this project?
https://bitbucket.org/vladimir_lushpenko/qt-librtmp/get/969f7f744ff7.zip

ChrisW67
6th January 2014, 07:57
Unzip archive
Open PRO file in Qt Creator
Build
Find the first error (not warning) message and think about it.
I guess your first error is related to OpenSSL (I have to guess you haven't told us). It is fairly obvious that librtmp requires OpenSSL headers and libraries to build.
Download and install OpenSSL for Windows: http://slproweb.com/products/Win32OpenSSL.html
Adapt the PRO file INCLUDEPATH and LIBS variables so the compiler can find the includes and libs respectively: Declaring Other Libraries
Go to step 3


Search here before you come back and ask about step 7.

braders2
6th January 2014, 20:59
Thank u very much for advice :) i builded this project