Linux streaming
When I try to run the code for VLC I get the following errors:
y increased to 181 ms)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 622 ms)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 3627 ms)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 6268 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 9732 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 12839 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 15973 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 16225 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
Any ideas what I am doing wrong?
You may not be doing anything wrong. Google finds a lot of people with this problem, but sadly very little in the way of answers.
Some people say adding this "--clock-jitter=0" switch to the command line solves the problem, some say it doesn't help at all. If you
add this "-vvv" switch it turns on verbose logging , that might give you a clue as to what the problem is. Does it work in spite of the
errors,or crap out compleatly ? You need a fairly fast computer to capture and encode in real time. Check your cpu usage while vlc is
running , if it's high, yours may not be up to the task.
There are some things that can be done to lighten the load.One would be to lower the framerate, downside there is jerkier playback.
Another is to lower the output resolution,downside is fuzzier picture. Another is you don't have to capture the entire screen. For example
the command line below captures only a 1280x720 of my 1920x1080 screen. If you constrain your video to that portion of the screen,
it works reasonably well and cuts my cpu usage in half.
- Code:
vlc screen:// :screen-fps=24 :screen-width=1280 :screen-height=720 :input-slave=alsa://pulse :sout="#transcode{vcodec=mp2v,vb=10000,fps=24,width=1280,acodec=mp3,ab=192,channels=2,samplerate=44100} :http{dst=:8081/desk.ts}" :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
On my computer ffmpeg captures and encodes with significantly lower cpu usage than vlc but I don't know how to send ffmpeg output to the network yet.
So here's some examples a bit of a kludge , pipe ffmpeg output through vlc. In the examples below change the 1920x1080 to the resolution of
your monitor or smaller if you only want a portion of your screen.
- Code:
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 24 -s 1920x1080 -i :0.0 -r 24 -s 1280x720 -vcodec mpeg2video -bf 2 -vb 6000k -g 15 -acodec libmp3lame -ar 44100 -ac 2 -f mpegts vlc - :sout=#http{dst=:8081/desk.ts} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 24 -s 1920x1080 -i :0.0 -r 24 -s 1280x720 -vcodec mpeg4 -vb 6000k -acodec libmp3lame -ar 44100 -ac 2 -f mpegts - | vlc - :sout=#http{dst=:8081/desk.ts} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 24 -s 1920x1080 -i :0.0 -r 24 -s 1280x720 -vcodec libx264 -crf 4 -acodec libfaac -b 192k -ar 44100 -ac 2 -f mpegts - | vlc - :sout=#http{dst=:8081/desk.ts} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
Anybody know why my samsung D opens mpeg2 streams from vlc without a problem ,but doesn't open mpeg2 streams encoded with ffmpeg ?