Robbsen
Robbsen

Reputation: 153

ffmpeg can play video but not a stream containing the same data

This is my first time encountering video codecs/video streaming.

I am receiving raw h.264 packets over TCP. When I connect to the socket, listen to it and simply save the received data to a file, I am able to play it back using

ffplay data.h264

However, when I try to directly play it from the stream without saving it, using

ffplay tcp://addr:port

all I get is the error

Invalid data found when processing input

Why is that?

Upvotes: 0

Views: 2587

Answers (2)

Robbsen
Robbsen

Reputation: 153

Alright I found another way to display the video stream.

ffplay -f h264 -codec:v h264 tcp://addr:port?listen

The ?listen parameter makes it so ffplay creates its own tcp server. All I do now is send the data to the specified address.

Upvotes: 1

Gyan
Gyan

Reputation: 92928

Specify the format: ffplay -f h264 tcp://addr:port

Upvotes: 1

Related Questions