[FFmpeg-user] Demux stream with ffmpeg - but decode with HW instead

Moritz Barsnick barsnick at gmx.net
Thu Jan 14 11:30:24 CET 2016


On Thu, Jan 14, 2016 at 12:04:34 +0200, Ran Shalit wrote:
> ffmpeg -f mpegts udp://192.168.1.10:48550  -vcodec copy -an -f h264 temp_file.h264 &
> temp_file > hw_decoder     (hw_decoder is executable which can take
> raw h.264 and convert it to yuv)

$ temp_file(.h264) > hw_decoder
is not valid shell syntax.

$ < temp_file.h264 hw_decoder
or
$ hw_decoder < temp_file.h264
should work to provide the file temp_file to hw_decoder's standard
input.

> The only thing I will need to take care of is that this file temp_file
> will get larger and larger. Is there a way to deal with it ?

Do I understand correctly that you are worried about the intermediate
file, and not so much about having to use "hw_decoder"?

Unix provides you with pipes or "fifos" for this:
$ mkfifo tmp_pipe
$ ffmpeg -f mpegts udp://192.168.1.10:48550 -vcodec copy -an -f h264 tmp_pipe &
$ hw_decoder < tmp_pipe
$ rm tmp_pipe

Moritz


More information about the ffmpeg-user mailing list