[FFmpeg-devel] [PATCH 0/2] Routine to read into buf up to EOF

Andrey Utkin andrey.krieger.utkin at gmail.com
Tue Jun 24 15:27:26 CEST 2014


I have discussed this in IRC today.
I want to be able to pass lavfi indev with parameter graph_file=/dev/stdin,
this enables me to pass in large complex filtergraphs without creating temporary
files.
(BTW lavfi input device's graph_file parameter seems to be my only way now, because global "filter_complex_script" option gives me strange errors 'Output pad "default" with type audio of the filter instance "Parsed_amix_20" of amix not connected to any destination', while it is surely connected. I hope i will investigate this issue later and report it.)

But currently lavfi indev uses file mapping into RAM for this file, and that
fails for /dev/stdin by design.
With this patchset, this works:
echo testsrc | ffmpeg -f lavfi -graph_file /dev/stdin -i nullsrc -f null -y /dev/null
echo testsrc | ffplay -f lavfi -graph_file /dev/stdin -i nullsrc

Andrey Utkin (2):
  Add av_fd_dump(): read from fd into buffer up to EOF
  lavfi indev: use av_fd_dump() instead of av_file_map() for graph_file

 libavdevice/lavfi.c | 31 ++++++++++++++-----------------
 libavutil/file.c    | 32 ++++++++++++++++++++++++++++++++
 libavutil/file.h    | 30 ++++++++++++++++++++++++++++++
 3 files changed, 76 insertions(+), 17 deletions(-)

-- 
1.8.3.2



More information about the ffmpeg-devel mailing list