Luca Abeni wrote:
Hi Ricardo,
Ricardo Pinto wrote:
Can someone what's the problem of executing this comand line?
Command line:
ffmpeg -i teste.avi -f rtp rtp://localhost?localport=1234
Two (or three) issues with this command line:
1) Since you are sending video, you must specify the destination
port, while you are specifying the source port (this is causing
the "av_interleaved_write_frame():..." error)
2) The command line you gave is actually trying to send audio,
not video. Add "-an -vcodec copy" (or your favourite video
codec) for sending video
3) You must stream the video at the correct rate, but the command
line you gave is trying to stream as fast as possible. Try to
add "-re" (but be warned that this option does not work very
well with some avi files, or when streaming audio only)
Summing up, try:
ffmpeg -re -i test.avi -an -vcodec copy -f rtp rtp://localhost:1234
where teste.avi is my video. I'm trying to send a video via rtp, or rstp
(would be better) but i just can see what would be command line.
Note that if you want rtsp you must use ffserver (there is an entry in the
sample configuration file, which is currently commented out. Try it, and
it should work).
Luca
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Thank you, no i have everything i need.
How about something like this for the ffmpeg_doc.texi, in the final
section of tips.
I just don't know how you built those kind of help guides so i followed
a bit the small
example that is in ffmpeg_doc.texi
@itemize
@item For streaming a video with RTP in ffmpeg is a bit tricky. It's
needed two streams,
one for video and the other for audio.
An example is:
@example
ffmpeg -re -i test.avi -vcodec copy -an -f rtp rtp://127.0.0.1:10000 -vn
-acodec copy -f rtp rtp://127.0.0.1:20000 -newaudio
@end example
@item The parameter '-re' outputs the input file with the same rate.
But be warned that this option does not work very
well with some avi files, or when streaming audio only.
@item The parameter '-vcodec' its used to specify the codec to use to
encode the video stream,
in this case is copy, so it copies intput file video codec. Use ffmpeg
-formats
to see the list of available enconders and decoders.
@item The parameter '-an' disables the audio, because it will be sent
in a separated stream.
@item The parameter '-f' forces the output format. In this case we are
streaming
via rtp.
@item The address for the rtp stream should be
rtp://<ip_adress>:<output_port>. Because your streaming
not reading from a stream. If you were reading from a rtp stream it
should be
rtp://<ip_adress>?localport=<port_number>, were <port_number> its the
port that ffmpeg should listen to.
@item The parameter '-vn' disables the video, because it was sent in
the other stream.
@item The parameter '-acodec' its used to specify the codec to use to
encode the audio stream,
in this case is copy, so it copies intput file audio codec. Use ffmpeg
-formats
to see the list of available enconders and decoders.
@item The parameter '-newaudio' adds a new audio stream to the current
stream.
@item Now to make it all work. Run ffmpeg as shown in the example
command above.
After this ffmpeg will print an SDP (Session Description Protocol).
You should get something like:
@example
v=0
o=- 0 0 IN IPV4 127.0.0.1
t=0 0
s=No Name
a=tool:libavformat
m=video 10000 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=1
m=audio 20000 RTP/AVP 14
c=IN IP4 127.0.0.1
@end example
@item Get the SDP printed by ffmpeg (not the one pasted above), and
copy it in
a text file called "test.sdp", or whatever name you want to call it, but
finishing with ".sdp".
@item Now you can play the streams by using the SDP file. Using for
example videolan client,
you can do "vlc test.sdp". If you try to use ffplay or ffmpeg to receive
the streams, you can
have troubles unless you use a multicast destination address,
getting a "setsockopt(IP_ADD_MEMBERSHIP): Invalid argument" error.
This is due to a bug in libavformat.
@end itemize
begin:vcard
fn:Ricardo Pinto
n:Pinto;Ricardo
email;internet:[EMAIL PROTECTED]
tel;work:00351916505229 (Portugal)
tel;cell:0034626325434 (Espanha)
version:2.1
end:vcard
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user