Open masterofeye opened 9 years ago
Hello, thx for the fast answer.
This play's a file. But i want to "play" (decode and so on) the receive TCP messages? I miss someone like ..setByteFrame in the player class .. to deliver the received frames or someone else. Can you follow my explanation?
it can play a url. You mean decoding the message to get a video frame?
i try to use the url ... http:\pcname:port... And get "Failed to open media" ... "Error number -5 occurred".
At this point there is a little mistake in the spelling for the debug Output and the window title -> "Invalid meida" in place of "Invalid media"
what about ffplay?
@matsterofeye As url try tcp://localhost:port_number it works for me on current repo. I use RPI as video camera.
@masterofeye , @wang-bin @3electrons did you finally find a solution streaming playing H264 Raw Bytestream from TCP programmatically ?
@bonagin play the url and set a frame rate
@wang-bin
I did this:
QVariantHash fmt_opt; fmt_opt["format_whitelist"] = "rawvideo"; fmt_opt["video_size"] = "1280x720"; fmt_opt["framerate"] = 25; m_player->setOptionsForFormat(fmt_opt); m_player->play("tcp://127.0.0.1:8181");
I get this error : "avformat_open_input: url:'tcp://127.0.0.1:8181' ret:0" Then the program crashes.
Anything i am doing wrong ?
@bonagin That's for raw yuv stream. not h264 stream
@wang-bin Can you please Advice with a piece of code as to how do for a h264 raw stream
@wang-bin I mean Raw h264 encoded packet from a TCP socket.
I have also tried
` QVariantHash avfm_opt; avfm_opt["probesize"] = 512_1024; avfm_opt["fbsprobesize"] = 30; avfm_opt["framerate"] = 25; avfm_opt["rtbufsize"] = 512_1024;
QVariantHash opt;
opt["avformat"] = avfm_opt;
m_player->setOptionsForFormat(opt);
m_player->setIODevice(m_socket);
m_player->play();
`
Still no luck
player.setFrameRate(25) and player.play(url)
Please read the bottom of this wiki https://github.com/wang-bin/QtAV/wiki/Play-Raw-Video-Streams
@3electrons @wang-bin I think you are misunderstanding me, i am receiving video frames via an http payload, my server or socket is already connected to the particular port where the packets are being received. i just need a some sort of a function where i can pass the incoming h264 raw nal units to and it decodes the frame as a continuous video as it is being streamed.
I think the code you gave me only applies when the stream is already being initiated by the client, in my case my Http server initiates the stream, then the client will respond with a HTTP OK string and some parameters followed by a payload which contains raw H264 data.
Currently it's not supported. Maybe I can add an callback to let user process AVPacket before getting the packet from AVDemuxer. What do you think?
@wang-bin I think that would be fantastic. Please let me know as soon as you have that commit.
Hi all, For a research project we were developing an extension on H264 using "free" NAL types. We need to read those packets from the H264 stream before they are discarded as not relevant for video. The server use RTSP/RTP. In order to develop the client we were planing to use QtAV, can we benefit from those callback in order to access the h264 stream before "normal" processing? Thanks
You can play the H264 RAW streams this way:
Create a server on the local port, eg. 1234, and restream h264 beatstream via this local port.
Set 'source' property as 'tcp://localhost:1234'
AVPlayer { id: player; source: 'tcp://localhost:1234'; }
Hello,
i didn't find any possibility to use the player for take a raw bytestream.
My scenario: I get a decoded H264 raw bytestream from a webcam. I send them over TCP to the planned client and this should decode the bytestream and show them in a player.
How could i do this with QTAV?
Best regards MOE