Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
play video files to udp stream
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
dachris
n00b
n00b


Joined: 17 Aug 2006
Posts: 62

PostPosted: Tue Mar 12, 2013 7:23 am    Post subject: play video files to udp stream Reply with quote

hi...

after days of messing around, i hope to get some tips here :)

I have some mpeg files, want to play them in sequence from console and create a udp stream.

1) tried vlc
Code:
vlc playlist.m3u --sout '#std{access=udp,mux=ts,dst=192.168.0.11}'

problem: plays not smoothly, between files I get "late packet for UDP input" errors

2) play with mplayer and output with vlc
problem: mplayer can't play to stdout and vlc can't read from named pipe

3) use mplayer to write to named pipe, read with ffmpeg to stdout and grab with vlc
Code:
mplayer -vo mpegpes:file mpg1.mpg mpeg2.mpeg mpeg3.mpeg

Code:
ffmpeg -i file -sameq -aspect 16:9 -f mpegts pipe:1 | vlc - --intf dummy --sout '#std{access=udp,mux=ts,dst=192.168.0.11}'

runs smooth, no interruptions between files, but I loose the sound

maybe there is an easier way to do this...
thanks

EDIT:
after posting here I tried my next idea
Code:
cat mpg1.mpg mpeg2.mpeg mpeg3.mpeg > file

Code:
ffmpeg -i file -sameq -aspect 16:9 -f mpegts pipe:1 | vlc - --intf dummy --sout '#std{access=udp,mux=ts,dst=192.168.0.11}'

works, but still looking for a better solution
Back to top
View user's profile Send private message
syn0ptik
Apprentice
Apprentice


Joined: 09 Jan 2013
Posts: 208

PostPosted: Tue Mar 12, 2013 9:26 am    Post subject: Reply with quote

Code:
cat mpg1.mpg mpeg2.mpeg mpeg3.mpeg > file

you wrong here, but you can make it with ffmpeg concat
Code:
ffmpeg -i concat:"a.mpg|b.mpg" -vcodec copy out.mpg

with ffserver you can make rtsp stream only.
Back to top
View user's profile Send private message
dachris
n00b
n00b


Joined: 17 Aug 2006
Posts: 62

PostPosted: Tue Mar 12, 2013 9:41 am    Post subject: Reply with quote

yeah thanks for this!!

this is my code
Code:
ffmpeg -i concat:"file1.mpg|file2.mpeg|file3.mpeg" -vcodec copy -f mpegts pipe:1 | vlc - --intf dummy --sout '#std{access=udp,mux=ts,dst=192.168.0.11}'
Back to top
View user's profile Send private message
dachris
n00b
n00b


Joined: 17 Aug 2006
Posts: 62

PostPosted: Tue Mar 12, 2013 9:57 am    Post subject: Reply with quote

why so complicated "dachris" :D

prepare a single file
Code:
ffmpeg -i concat:"file1.mpg|file2.mpeg|file3.mpeg" -vcodec copy out.mpg


then play
Code:
cvlc -vvv out.mpg --sout '#std{access=udp,mux=ts,dst=192.168.0.11}'
Back to top
View user's profile Send private message
syn0ptik
Apprentice
Apprentice


Joined: 09 Jan 2013
Posts: 208

PostPosted: Tue Mar 12, 2013 10:22 am    Post subject: Reply with quote

yes, but how do you want playing from client side this stream?
also it should support audio or you want video only?
Back to top
View user's profile Send private message
dachris
n00b
n00b


Joined: 17 Aug 2006
Posts: 62

PostPosted: Tue Mar 12, 2013 10:40 am    Post subject: Reply with quote

this is for a regional tv station and to get our program in the local cable network i need this udp stream.

tested the client side on my windows vlc and it seems to work
Back to top
View user's profile Send private message
syn0ptik
Apprentice
Apprentice


Joined: 09 Jan 2013
Posts: 208

PostPosted: Tue Mar 26, 2013 5:44 am    Post subject: Reply with quote

also you can stream it with ffmpeg over udp
ffmpeg -i <input> -f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535
Back to top
View user's profile Send private message
dachris
n00b
n00b


Joined: 17 Aug 2006
Posts: 62

PostPosted: Tue Mar 26, 2013 7:32 am    Post subject: Reply with quote

I always get the message, this protocol is not implemented. maybe there is a use flag to set, but which one? ;)
Back to top
View user's profile Send private message
syn0ptik
Apprentice
Apprentice


Joined: 09 Jan 2013
Posts: 208

PostPosted: Wed Mar 27, 2013 6:22 am    Post subject: Reply with quote

no that works for me.
Back to top
View user's profile Send private message
dachris
n00b
n00b


Joined: 17 Aug 2006
Posts: 62

PostPosted: Wed Mar 27, 2013 8:03 am    Post subject: Reply with quote

i always tried without buffer size
Code:
udp://230.1.0.1:5000?pkt_size=188: Protocol not found


with "pkt_size=188&buffer_size=65535" it works

thanks!
Back to top
View user's profile Send private message
dachris
n00b
n00b


Joined: 17 Aug 2006
Posts: 62

PostPosted: Wed Mar 27, 2013 10:31 am    Post subject: Reply with quote

oh no I'm wrong, it doesnt work, it goes into the background because auf the & ;)

Code:
ffmpeg -i out22.ts -f mpegts "udp://230.1.0.1:5000?pkt_size=188&buffer_size=65535"


Code:
ffmpeg -i out22.ts -f mpegts udp://230.1.0.1:5000?pkt_size=188\&buffer_size=65535"


Code:
udp://230.1.0.1:5000?pkt_size=188&buffer_size=65535: Protocol not found
Back to top
View user's profile Send private message
dachris
n00b
n00b


Joined: 17 Aug 2006
Posts: 62

PostPosted: Wed Mar 27, 2013 4:04 pm    Post subject: Reply with quote

finally i found it, set the "network" use flag
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum