1

I'm using the below command in my iOS project and i want to display the camera preview in my UIView.

-f avfoundation -r 30 -video_size 640x480 -pixel_format bgr0 -i \"default:default\" -preset ultrafast -c:v h264_videotoolbox -c:a mp2 -tune zerolatency -b 900k -f tee -map 0:v -map 0:a \"%@|[f=mpegts]udp://127.0.0.1:43000/
  • What container formats are supported by UIView? – llogan Jan 31 '20 at 18:49
  • in case if i'm using AVCaptureSession on my own, I will be using AVCaptureVideoPreviewLayer.. Right.. But in my case, now, I might need to feed my UIView with AVCaptureSampleBuffer data so that it can display the camera preview... Isn't it? – Pushparaj Jayaseelan Feb 03 '20 at 07:41
  • None of that means anything to me: I am not an iOS developer, but I am familiar with ffmpeg. You're using the tee muxer to supposedly create two outputs efficiently. I don't know what the `%@` is supposed to represent, but you need to provide a valid streaming output format that your framework can decode. Can it handle mpegts? Are you looking for a file output or a pipe? – llogan Feb 03 '20 at 20:18
  • Okay.. forget about my above posted code.. I'm fine with the using ffmpeg to access the avfoundation to capture and stream the video content.. but simultaneously i want to show the user what is being streamed.. so to do that, I want to read the camera buffer and display in my UI.. does my point is clear? – Pushparaj Jayaseelan Feb 14 '20 at 19:18
  • `ffmpeg` can output many formats protocols, and containers, but you did not indicate what is required by your UI. H.264 in MP4 file? Pipe, file, stream? Etc. – llogan Feb 18 '20 at 18:16
  • @PushparajJayaseelan did you get the solution for you for your query, since I am stuck at the same place, how can show a preview screen with Camara while recording with ffmpeg command, Thanks in advance – vnaren001 Jan 20 '22 at 06:49

0 Answers0