[FFmpeg-devel] [PATCH 3/3] avformat: add youtube-dl based demuxer
george at nsup.org
Wed Apr 8 21:59:17 CEST 2015
Le nonidi 19 germinal, an CCXXIII, Gilles Chanteperdrix a écrit :
> As I explained, I did it this way for portability. system is ANSI
> not POSIX, redirections work with windows shell too, and av_tempfile
> is implemented by ffmpeg, so I expect it to be portable.
Implementing pipe reading for other systems looks like a better time
> Well, actually, it looks not so hard to me.
Every person who got it wrong thought that too.
> One argument is an URL so, we could url encode it before passing it to
No, you can not, because it is probably already URL-encoded.
> Well, actually, vfork() + exec() is better than fork() + exec(),
> both performance wise and because it works on machines without an
> MMU, and the implementation of posix_spawn() in glibc is too
> conservative and uses fork() + exec() even in situations where
> vfork() could be used, see:
> So, better use vfork() + exec() (that is what system does for
> instance). I did not use it simply because I thought ffmpeg could
> have to be compiled on machines without the POSIX interface.
That was arguments for 20 years ago. Nowadays, vfork() was left to bitrot
for compatibility reasons while fork() was insanely optimized. And in the
meantime, threads were invented, with their own set of problems when it
comes to spawning a child process.
So the short of it: use posix_spawn().
The way it is implemented is at best not your concern, at worst premature
> I did not use it simply because I thought ffmpeg could have to be compiled
> on machines without the POSIX interface.
FFmpeg requires POSIX. posix_spawn() is a POSIX option, yet, so it requires
a configure check. But apart from that, let someone who cares implement for
> > Then I suggest you just endeavour to write a pseudo-demuxer for the output
> > of "youtube-dl -J". No need of a shell or an external command.
Just do that, no need for any fancy system call for that, and it would serve
as a base for a more fully automatic version anyway later.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 819 bytes
Desc: Digital signature
More information about the ffmpeg-devel