FORUMS: list search recent posts

stop/restart transcoding

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
nayan kapadia
stop/restart transcoding
on Jul 2, 2010 at 5:32:19 am

Hi,

I am transcoding Live MPEG4 stream from IP camera to H.264 stream using ffmpeg on windows. But in one camera stream after some time, transcoding stops eventhough Live camera stream comes continously.If i restart transcoding manually then it starts to work.Is there any other way to solve this problem?

THANKS,
NBK


Return to posts index

Michael Rampe
Re: stop/restart transcoding
on Jul 2, 2010 at 6:21:04 am

[nayan kapadia] "Is there any other way to solve this problem?"

Possibly with a bit more info....

[nayan kapadia] "after some time"

How much time? Is it regular or irregular?

Are you getting any reported errors? Please paste the command line you are using as well as the text output from FFmpeg.

Michael



"half-way to world domination A.K.A. the belligerent blue bike shed"


Return to posts index

nayan kapadia
Re: stop/restart transcoding
on Jul 2, 2010 at 11:28:35 am

Thanks for your reply.
I am using below command:

ffmpeg.exe -i rtsp://192.168.0.17/main.mp4 -f mpegts -vcodec libx264 -r 30 -an -b 100k -s 320x240 -keyint_min 10
-i_qfactor 0.71 -bt 10k -maxrate 100k -bufsize 1435k -qcomp 0.6 -qmin 10 -qmax 30 -qdiff 4 -re -shortest -me_method zero -sameq -pass 1 -isync -b_strategy 0 -flags2 fast -dct fastint -g 15 oo.ts

output on command line after stream stops:

frame=222902 fps= 6 q=30.0 size= 241576kB time=7428.70 bitrate= 266.4kbits/s d
frame=222902 fps= 6 q=30.0 size= 241576kB time=7428.70 bitrate= 266.4kbits/s d
frame=222902 fps= 6 q=30.0 size= 241576kB time=7428.70 bitrate= 266.4kbits/s d
frame=222902 fps= 6 q=30.0 size= 241576kB time=7428.70 bitrate= 266.4kbits/s
dup=163163 drop=525170

Here, duplicate frame nos are stopped while drop frames are increasing continously. And I am not receiving any error while it stops.

Stop Time is not fixed , it varies. I have played Live stream from camera in vlc but in that also stream stops after irregular time.

Waiting for your reply.

THANKS,
NBK


Return to posts index


Michael Rampe
Re: stop/restart transcoding
on Jul 7, 2010 at 10:13:37 am

Sorry for the delay.

I would try a process of elimination to work out why it is stopping. I do not entirely understand the commandline you are using.

You are setting the frame rate to 30fps but only getting 6fps encode. What is the frame rate of the source? Can you live with 15fps?

You seem to be setting all of the x264 flags manually. Libx264 presets are excellent and should be your first thing to try instead of manually setting all of the libx264 flags. There are many to choose from and some do work in realtime. Start with ultrafast and keep upping the quality until it stops being realtime. This should get rid of the dropped frames. (ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo)

Take out the -sameq flag. This is a rate control method that may be overriding the other rate control methods you are employing. also setting -bufsize and -maxrate will give you a CBR file which is not desirable as it is the lowest quality. (VBR is highest quality) Maybe try just -b 100k and -bt 100k and leave out the rest except change -qmax to 51. Your encode is maxing out at q=30 and still not giving you the desired 100k. libx264 has a q range of 1-51 unlike other codecs which have a range of 1-31.

Take out -pass 1. This is only needed for two pass encoding and writes a log file. This log file will become very large over time and may be causing your problem.

Finally, you are encoding an x264 stream to a transport stream container. I think you need the -vbsf h264_mp4toannexb for this. Not entirely sure if it is needed for a streaming source but I have had to use it when repacking h264 into a transport stream container to make it play properly.

Anyway, try some of these things and see if your problem persists.

Michael


"half-way to world domination A.K.A. the belligerent blue bike shed"


Return to posts index

nayan kapadia
Re: stop/restart transcoding
on Jul 12, 2010 at 12:22:29 pm

Hi Rampe,

I have modified my command arguments and used presets files as per your suggestion. I have used below command:

ffmpeg.exe -y -i -f mpegts -an -vcodec libx264 -r 30 -an -b 100k -s 320x240 -bt 100k -qmax 51 -crf 22 -vpre "C:\ffmpeg\ffpreset\libx264-lossless_ultrafast.ffpreset" op.ts

But in this case also,transcoding stops after some time.Do you have any further suggestion? Please advice.

Thanks
NBK


Return to posts index

Michael Rampe
Re: stop/restart transcoding
on Jul 12, 2010 at 8:01:24 pm

Where did -crf 22 come from? That wasn't in your previous command line. This is another rate control method. Try to remove it as you are already using -b and -bt as a rate control method.

Michael

"half-way to world domination A.K.A. the belligerent blue bike shed"


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]