tanersener / mobile-ffmpeg

FFmpeg for Android, iOS and tvOS. Not maintained anymore. Superseded by FFmpegKit.
https://tanersener.github.io/mobile-ffmpeg
GNU General Public License v3.0
3.86k stars 788 forks source link

ffmpeg -i udp://0.0.0.0:11111 -f sdl/h264 "Tello" failed on iOS 13 test app #280

Closed liuxuan30 closed 4 years ago

liuxuan30 commented 4 years ago

Hi there, I'm very new to ffmpeg,

I'm trying to use this library to display DJI Tello drone camera output, following guide https://tellopilots.com/threads/tello-video-web-streaming.455/

in that post

ffmpeg -i udp://0.0.0.0:11111 -f sdl "Tello"

or

ffplay -probesize 32 -i udp://0.0.0.0:11111 -framerate 30

works well on my macbook, 10.15 with ffmpeg 4.2.1.

When I am trying the ios test app, if I paste the command

-i udp://0.0.0.0:11111 -f sdl "Tello"

it gives

...
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
Input #0, h264, from 'udp://0.0.0.0:11111':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264, yuv420p(progressive), 960x720, 25 fps, 25 tbr, 1200k tbn, 50 tbc
Requested output format 'sdl' is not a suitable output format
Tello: Invalid argument
Conversion failed!

or

-i udp://0.0.0.0:11111 -f h264 "Tello"

...
no frame!
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
Input #0, h264, from 'udp://0.0.0.0:11111':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264, yuv420p(progressive), 960x720, 25 fps, 25 tbr, 1200k tbn, 50 tbc
Tello: Read-only file system
Conversion failed!

can you help clarify if mobile-ffmpeg is fully compatabile?

tanersener commented 4 years ago

sdl library is not included in mobile-ffmpeg binaries. So you won't be able to use -f sdl in your commands. If you need it, you need to build your own mobile-ffmpeg version.

You can use -f h264, but in your case you need to decide what to do with the input stream. You can save it to a file by specifying full file path -i udp://0.0.0.0:11111 -f h264 <full file path.mp4>.

liuxuan30 commented 4 years ago

Hi @tanersener thanks for replying. What is sdl here?

I tried -f h264 however it says "At least one output file must be specified",

But my goal is not saving to a file, just want to play it on the screen directly, can we skip the output file? If not, does mobile-ffmpeg itself supports directly streaming it in memory(I guess)?

tanersener commented 4 years ago

Hi @tanersener thanks for replying. What is sdl here?

You can find more information about sdl device here. It allows you to show a video stream in an SDL window.

I tried -f h264 however it says "At least one output file must be specified",

But my goal is not saving to a file, just want to play it on the screen directly, can we skip the output file? If not, does mobile-ffmpeg itself supports directly streaming it in memory(I guess)?

Yeah, -f h264 requires an output file.

Unfortunately, mobile-ffmpeg does not support playing a video on the screen. Because mobile-ffmpeg does not know what a screen is. A library like SDL is needed to define a screen for ffmpeg. But as I said in my previous post, sdl is not enabled in mobile-ffmpeg. You can build it, it is supported by the scripts. But parts that define a screen is not implemented in mobile-ffmpeg.

liuxuan30 commented 4 years ago

Thanks for answering!