vlc h264 http-stream to ogg raspivid - stream

I'm trying to take a video with a camera module on the raspberry pi and stream it over http in ogg format. The standard of raspivid is h264.
What's working is to stream it in h264, but most browser with HTML5 do not support this.
raspivid -o - -t 9999999 -w 800 -h 600 --hflip | cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8082}' :demux=h264
What's not working is to transcode it.
raspivid -o - -t 9999999 -w 800 -h 600 --hflip | cvlc -vvv stream:///dev/stdin --sout '#transcode{vcodec=h264,vb=100}:standard{access=http,mux=ts{use-key-frames},dst=:8082}'
It always tells me:
Buffering: 0%
Why is it? I'd appreciate help!

Related

FFMpeg - PhantomJS to Youtube Live

I'm trying to stream a webpage captured with PhantomJS to Youtube using FMMpeg.
This is the command I use:
xvfb-run phantomjs --web-security=no render.js | ffmpeg -threads 0 -y -v verbose -c:v png -r 30 -f image2pipe -i - -f lavfi -i anullsrc -strict -2 -acodec aac -ac 1 -ar 44100 -b:a 128k -c:v libx264 -s 1280x720 -pix_fmt yuv420p -f flv "rtmp://a.rtmp.youtube.com/live2/key";
And the render.js code:
http://pastebin.com/raw/X9gv8iGH
It looks like it's streaming, but no feed is received by YouTube, and I can't see where the problem is.
Outpout from my console
Try this:
phantomjs --web-security=no render.js | ffmpeg -threads 0 -y -v verbose -c:v png -framerate 33 -f image2pipe -i - -f lavfi -i anullsrc -strict -2 -acodec aac -ac 1 -ar 44100 -b:a 128k -c:v libx264 -s 1280x720 -pix_fmt yuv420p -g 60 -r 30 -f flv "rtmp://a.rtmp.youtube.com/live2/key";
Parameter -framerate:
You can specify two frame rates: input and output.
Set input frame rate with the -framerate input option (before -i). The default for reading inputs is -framerate 25 which will be set if
no -framerate is specified.
The output frame rate for the video stream by setting -r after -i or by using the fps filter.
So in your case framerate should be 1/period_from_phantomjs which is 1000/30 = 33.33
As for the -g 60, that will add a key frame every 2 seconds, which is probably a requirement for the youtube streaming api (I know that for facebook it is).

Anybody know what this avconv line does?

avconv -y -i input.avi -b 915k -an -f mp4 -ar 44100 -f s16le -ac 2 -i /dev/zero -acodec libfaac -ab 128k -strict experimental -shortest -vcodec libx264 output.mp4 -loglevel fatal
First of all, this seems to be an old version of avconv, since the command line has changed since then (but not too much).
So, let's break it down:
-y
This answers 'yes' to questions like "do you want to overwrite the output file".
-i input.avi
This gives the program the file input.avi as an input
-b 915k
This asks to change the bitrate to 915 Kibibytes per second
-an
This removes all the audio from the output.
-f mp4
Sets up MP4 as the format of the output file
-ar 44100
This sets audio sampling rate of the following input file.
-f s16le
This sets the format of the audio of the following input file.
-ac 2
This sets number of channels of audio to two.
-i /dev/zero
This adds another input file that consists entirely of zero input
-acodec libfaac
This reencodes the audio (silence most likely) with libfaac
-ab 128k
Setting the audio bitrate to 128 Kbps
-strict experimental
Allows avconv to use nonstandard approaches while encoding.
-shortest
Ends encoding when the shortest of the inputs has ended. This is needed because /dev/zero will never end.
-vcodec libx264
This sets the library to do the video encoding. The codec will be (unfortunately) h264
output.mp4
This is the name of the output file
-loglevel fatal
Fatal messages will be written as the log, and that's it.
In the future you may find man avconv to be your friend.

How can I save the RAW rtp output file by ffmpeg

I have a problem that to save Output RTP as a file.
(Is that a possible? Am I Right?)
Trans-coding goal as below:
1. Save the RTP stream to file in local storage using FFMPEG.
2. Input is file.
3. Output is RTP stream file.
I`m using that.
./ffmpeg -re -i ../Video_Sample/03.Fashion_DivX720p_ASP_87s_1000k_720p.mp4 -c:v libx264 -b:v 1000k -preset superfast -an -f rtp -y test.rtp
But I got a message like that :
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
How can I fix it?
RTP is the Real-time Transport Protocol and not a file.
If you want to stream your mp4 file you could do it as followed:
ffmpeg -re -f mp4 -i ../Video_Sample/03.Fashion_DivX720p_ASP_87s_1000k_720p.mp4 -vcodec libx264 -b 1000k -preset superfast -an -f rtp rtp://hostadress:port
Did you mean rpt (Report File) file?

av_interleaved_write_frame(): Connection reset by peer youtube.

i want to live stream to youtube with ffmpeg but i take error " av_interleaved_write_frame(): Connection reset by peer". i send stream with FMLE its works nice.
ffmpeg -re -i /mnt/windows/21.mpg -r 30 -s 854x480 -c:v libx264 -c:a libfdk_aac -f mpegts "rtmp://a.rtmp.youtube.com/live2/hasanbagcaci.3s3v-pkwx-g64b-5zgz" -force_key_frames "expr:gte(t,n_forced*1)"
thanks for helping
I found a way to send a livestream to YouTube:
ffmpeg -re -i /mnt/windows/21.mpg -r 30 -s 854x480 -c:v libx264 -c:a libfdk_aac -force_key_frames "expr:gte(t,n_forced*4)" -f flv "rtmp://a.rtmp.youtube.com/live2/hasanbagcaci.3s3v-pkwx-g64b-5zgz"

Http Live Streaming Delay on iPhone

With this code I see the stream of my desktop in a iPhone:
vlc -I dummy screen:// vlc://quit --sout='#transcode{threads=300,width=554,height=367,fps=30,vcodec=h264,vb=500000,venc=x264{aud,profile=baseline,level=30,keyint=30,bframes=0,ref=1}}:duplicate{dst=std{access=livehttp{seglen=10,delsegs=true,numsegs=100,index=/var/www/streaming/mystream.m3u8,index-url=http://localhost/streaming/mystream-########.ts},mux=ts{use-key-frames},dst=/var/www/streaming/mystream-########.ts}};
but I have a big delay, like 30-40 second... Do you know how to reduce this delay?
All I want is:
• Stream clearly the desktop for a 600x400 window in a iPhone
• No audio
• MAX delay of 1-2 second
Do you know how to do a stream?
The Best stream I get is from ffmpeg, but there is always 7-8 seconds of delay.
This is the string:
ffmpeg -f x11grab -s `xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -r 25 -i :0.0 -pix_fmt yuv420p -vcodec libx264 -acodec libfaac -r 25 -profile:v baseline -b:v 1500k -x264opts keyint=25 -s 640x360 -map 0 -flags -global_header -f segment -segment_list index_1500.m3u8 -segment_time 1 -segment_format mpeg_ts -segment_list_type m3u8 -segment_list_flags +live -segment_list_size 1 segment%05d.ts

Resources