need an example unix domain sockets usage
12 May
2017
12 May
'17
2:11 p.m.
Hi All, can any one help me with a working example using UNIX domain socket. *I am trying to ffmpeg and ffplay commands on ubuntu as below.the ffplay <command > gives a permission denied. ffmpeg exits immediatly * >>>>* ./ffplay -f mpegts unix:///tmp/ff.socket& *>>>>* sleep 2&& ./ffmpeg_g -re -i something -vcodec copy -acodec copy -f *>> * mpegts unix://tmp/ff.socket * *I am not able to make any progress for some time,please let me know if I am missing anything.* *Thanks,* *RS*
12 May
12 May
7:37 p.m.
On Fri, May 12, 2017 at 19:41:10 +0530, Ratheendran R wrote: > *I am trying to ffmpeg and ffplay commands on ubuntu as below.the ffplay > <command > gives a permission denied. ffmpeg exits immediatly * > > >>>>* ./ffplay -f mpegts unix:///tmp/ff.socket& > *>>>>* sleep 2&& ./ffmpeg_g -re -i something -vcodec copy -acodec copy -f > *>> > * mpegts unix://tmp/ff.socket > * > > *I am not able to make any progress for some time,please let me know > if I am missing anything.* First of all, your paths to the socket are different: unix:///tmp/ff.socket unix://tmp/ff.socket Secondly, unlike what the ffmpeg documentation says, it looks like you need to add *no* extra slashes, so the correct URI is unix:/tmp/ff.socket (It shouldn't matter in this case, the OS ignores the extra slashes.) Thirdly, with your commands, both commands should give "no such file or directory", because ffmpeg needs to feed (and create) the socket first, before ffplay can access it. Fourthly, to create a socket, you need to add the "-listen 1" option to the ffmpeg command line. Fifthly, if you launch ffmpeg first and try to put it to the background, you need to disable its interaction with the terminal, by adding "-nostdin" (otherwise, it stalls in my attempts). I succeeded with this: $ ffmpeg -nostdin -f lavfi -i testsrc -f mpegts -listen 1 unix:/tmp/ffmpeg.socket & ffplay unix:/tmp/ffmpeg.socket (ffplay doesn't need "-f mpegts" in this scenario.) Moritz
16 May
16 May
5:26 p.m.
Thanks Moritz, You explanation was helpful. On Sat, May 13, 2017 at 1:07 AM, Moritz Barsnick <barsnick@gmx.net> wrote: > On Fri, May 12, 2017 at 19:41:10 +0530, Ratheendran R wrote: > > *I am trying to ffmpeg and ffplay commands on ubuntu as below.the ffplay > > <command > gives a permission denied. ffmpeg exits immediatly * > > > > >>>>* ./ffplay -f mpegts unix:///tmp/ff.socket& > > *>>>>* sleep 2&& ./ffmpeg_g -re -i something -vcodec copy -acodec copy > -f > > *>> > > * mpegts unix://tmp/ff.socket > > * > > > > *I am not able to make any progress for some time,please let me know > > if I am missing anything.* > > First of all, your paths to the socket are different: > unix:///tmp/ff.socket > unix://tmp/ff.socket > > Secondly, unlike what the ffmpeg documentation says, it looks like you > need to add *no* extra slashes, so the correct URI is > unix:/tmp/ff.socket > (It shouldn't matter in this case, the OS ignores the extra slashes.) > > Thirdly, with your commands, both commands should give "no such > file or directory", because ffmpeg needs to feed (and create) the > socket first, before ffplay can access it. > > Fourthly, to create a socket, you need to add the "-listen 1" option > to the ffmpeg command line. > > Fifthly, if you launch ffmpeg first and try to put it to the > background, you need to disable its interaction with the terminal, by > adding "-nostdin" (otherwise, it stalls in my attempts). > > I succeeded with this: > > $ ffmpeg -nostdin -f lavfi -i testsrc -f mpegts -listen 1 > unix:/tmp/ffmpeg.socket & ffplay unix:/tmp/ffmpeg.socket > > (ffplay doesn't need "-f mpegts" in this scenario.) > > Moritz > _______________________________________________ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
3436
Age (days ago)
3440
Last active (days ago)
2 comments
2 participants
participants (2)
-
Moritz Barsnick -
Ratheendran R