[FFmpeg-user] How to specify duration for an input with pipe protocol

Taner Sener tanersener at gmail.com
Thu Feb 7 16:57:42 EET 2019


Hello,

I'm trying to specify duration for an input with pipe protocol. I tried
adding -t <duration> before input but that doesn't work. Do you know
another way to specify time?

This is the command I use. I expect a 3 second video as output, but output
video has only 1 frame. I tried setting vf, filter_complex, framerate but
none of them worked.

cat input.jpg | ffmpeg -loop 1 -i pipe:0 -c:v mpeg4 -t 3 video.mp4


The following info is printed about the input pipe when I execute the
command.


Input #0, jpeg_pipe, from 'pipe:0':

  Duration: N/A, bitrate: N/A

    Stream #0:0: Video: mjpeg (Progressive), yuvj444p(pc,
bt470bg/unknown/unknown), 992x660 [SAR 72:72 DAR 248:165], 25 tbr, 25 tbn,
25 tbc

I can achieve the same output with the following command without using pipe
protocol.

ffmpeg -loop 1 -i input.jpg -c:v mpeg4 -t 3 video.mp4


This time input has this output. Any ideas?


Input #0, image2, from 'input.jpg':

  Duration: 00:00:00.04, start: 0.000000, bitrate: 20769 kb/s

    Stream #0:0: Video: mjpeg (Progressive), yuvj444p(pc,
bt470bg/unknown/unknown), 992x660 [SAR 72:72 DAR 248:165], 25 fps, 25 tbr,
25 tbn, 25 tbc


Thanks


More information about the ffmpeg-user mailing list