VLC transcoding RTMP with 12 second delay - ffmpeg

I am using VLC player to receive a RTMP stream from Unreal Media Server and transcode it with ogg/theora for html5 video element. Here is command line code
I use:
vlc.exe -I dummy rtmp://XX.XX.XX.XX:5119/live/LRFront :network-caching=0 :sout=#transcode{vcodec=theo,vb=200,scale=1,deinterlace=0,acodec=none}:http{mux=ogg,dst=:8181/stream.ogg}
But this produces 10-12 second delay when viewing and even freezes quite often.
When played directly in flash player (rtmp stream) there is 50ms delay at most. So it has to be something with transcoding.
Could anyone point me in the right direction?
My PC specs:
CPU: Core i7
RAM: 16 GB
GPU: Nvidia Gefore GTX660

Related

FFMPEG handling h264 stream that does not send a frame consistently

I am working with a raw h264 stream, this is a live stream coming from a device, however when the device is streaming a menu page that is static, it doesn’t send out a frame. I am feeding the stream back into a v4l2 loop back instance and then consuming this on a webpage via getUserMedia. The issue I have is that ffmpeg does not send frames to v4l2 when the hardware device is not sending frames. I have tried to set the output of ffmpeg to cfr and 60fps. However this doesn’t make it send out duplicates of the last frame. Is there anyway to achieve this?
Thanks in advance

MoviePy : Slow down the rendering of videos

I actually try to display a video with Python and MoviePy, but when the script run the video, it is playing with my_clip.preview() but seem like at 1FPS.
When I check inside my code the FPS of my video, they said me 30/sec. For more details, the script running on a Raspberry Pi 4 Model B+ (2GB RAM / 1.5GHZ).
I have check the processor and it's good, also when I try to run the video from VLC or OMXPlayer everything is okay. The video hasn't any lag or bad FPS. So, I don't know why MoviePy, which normally use the default player(VLC here), slow down my video render if with VLC player it doesn't happen.
I can provide some code if needed, but it's a classic moviePy program.
I have tried my code on my Mac OS and moviePy doesn't slow down the video. On my code, with my_clip.fps, the FPS are the same than when I execute the code on my Mac.
Probably the mistake come from to Raspberry ?
I would know what happen and how to solve, if possible, this problem. Thanks
The raspberry pi probably doesn't have enough speed to render 30fps every second so it only manages to make 1 frame per seconds and that is what you are seeing.

FFmpeg Generate Thumbnail Efficiently

I am using FFmpeg for generating timeline thumbnail preview (image preview when your hover over seekbar in video player , like youtube player)
I need generating thumbnail for every 20s .
Here is code i use :
ffmpeg -i vide.mp4 -vf "fps=4/60 ,scale=260:150,tile=10*10" -qscale:v 10 thumbnail_%d.jpg
Code Work's Fine , only problem i have it's slow , for a movie with 3 hour long it's take more than 6 minute to generate thumbnail.
My System spec : Max os x 10.12 , Core i5 6600 , 16GB Ram.
I want's know there's a better way to do this ?
I think you might be looking for this:
https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video
And more spefically -vframes parameter.

Encode uncompressed avi from webcam

I have to record videos for a project I'm doing. Two of these are USB cameras and another is a n IP overhead camera.All three are connected to a laptop computer. After recording the videos I need to be able to open them in an editor (not for editing particularly but for modeling stuff in them for which I need a timeline). I have chosen Sony Vegas Pro for my editor. I have been able to record the uncompressed avi using gstreamer with this command:
gst-launch v4l2src device=/dev/video0 ! 'video/x-rawyuv,width=640,height=480,framerate=10/1' ! mux. avimux name=mux ! filesink location=temp.avi
I had to set the framerate to 10 because I was using two USB cameras and a framerate of 30 on both could not be accomodated in the bandwidth of the USB controller. I do not care about audio in my file so I don't grab audio. Similary, while encoding I wouldn't care about audio as well. This is raw uncompressed avi. I was not able to open this in Sony Vegas Pro. I believe I need to encode this uncompressed avi using a codec that will be opened by Sony Vegas Pro (I don't know which codecs Sony likes, so I'll probably try different ones until one of them opens).
For encoding this video, I have several options: mencoder, ffmpeg, gstreamer. But I am not able to figure out how to use these tools to get what I want. Ideally, I would like just to sort of "insert" a codec with other settings remaining the same. I don't really care about the how much space the resulting video takes since the length of the videos are not going to be more than 3 minutes and I have space available, so lossless codecs also work. I believe Sony reads mpeg avi's so if I can get that, it'll be great.
Thanks for reading and I appreciate all the help.
I was able to figure this out after some searching. It is based on the information here. I found that Sony Vegas pro seems to open avi videos encoded with the xvid codec.

VLC RTP network-caching

I am streaming from my android phone's camera to my computer using RTP. I am using VLC to receive the stream. I am also using a hand written .sdp file to view the stream in VLC. When I was doing this over RTSP I could uses the command line -> vlc "rtsp://224.1.1.1:8086" --network-caching=0 to remove the 1000ms caching that would remove the delay. So now I am using -> myTest.sdp --network-caching=0 but it seems to have no affect. I have tried increasing it to 10 seconds, still no affect. It also seems that if I lower the quality of the video it will have more of a delay. What do I need to do to remove any kind of caching / buffering and always just show the latest frame as it comes in?
I couldn't make VLC to have a delay less than 1 ms. So switching to ffplay with this parameters solved the problem:
ffplay.exe rtsp://224.1.1.1:8086 -fflags nobuffer -flags low_delay -avioflags direct -fflags discardcorrupt

Resources