1

I have a TCP stream with raw 8-bit image data (1280x720) that I receive and display with FFPLAY without problems, but it´s not possible to process the same input with FFMPEG.

This works:

ffplay -i tcp://127.0.0.1:8485\?listen -f rawvideo -pixel_format gray -video_size 1280x720

But when I try to process the same stream with FFMPEG, it always immediatly returns after the first frame with:

tcp://127.0.0.1:8485\?listen: Invalid data found when processing input

I tried the following commands:

ffmpeg -i tcp://127.0.0.1:8485\?listen -f rawvideo -pixel_format gray -video_size 1280x720 ffmpeg -i tcp://127.0.0.1:8485\?listen -f rawvideo -pixel_format gray -video_size 1280x720 -c:v mjpeg -f mjpeg -qscale 6 test.avi

Same behavior under Windows and Ubuntu. FFMPEG and FFPLAY are from the same set of prebuilt binaries. Version command returns N-107067-g5d5a014199-20220609. Unfortunately I have no access to the code of the stream origin. Any idea about a potential root-cause and what I could try ?

SoerenS
  • 21
  • 2
  • In FFplay all arguments applies the input, and the order doesn't matter. In FFmpeg the arguments before the `-i` applies the input, and the arguments after the `-i` applies the output. Try: `ffmpeg -f rawvideo -pixel_format gray -video_size 1280x720 -i tcp://127.0.0.1:8485\?listen -c:v mjpeg -f mjpeg -qscale 6 test.avi` – Rotem Jan 20 '23 at 09:13
  • Yes, that was a silly mistake. Should get more familiar with ffmpeg. Now it works, thanks! – SoerenS Jan 21 '23 at 10:05

0 Answers0