How to specify duration for an input with pipe protocol

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to specify duration for an input with pipe protocol

Taner Sener
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
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How to specify duration for an input with pipe protocol

Carl Eugen Hoyos-2
2019-02-07 15:57 GMT+01:00, Taner Sener <[hidden email]>:

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

(Complete, uncut console output missing.)
The option loop cannot work for pipe input afaict (at least it never
has worked, it is probably a bug that the option is accepted).

I wanted to suggest the loop filter but it does not work here, not
sure why.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How to specify duration for an input with pipe protocol

Taner Sener
On Thu, 7 Feb 2019 at 15:18, Carl Eugen Hoyos <[hidden email]> wrote:
> (Complete, uncut console output missing.)

Below you can see console output. I replaced "loop 1" with "-t 3" since I
expect "-t 3" to work.

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

ffmpeg version N-93087-g2b8458fcc5 Copyright (c) 2000-2019 the FFmpeg
developers

  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)

  configuration: --enable-gpl --enable-libx264 --enable-libfreetype
--enable-fontconfig --enable-gnutls

  libavutil      56. 26.100 / 56. 26.100

  libavcodec     58. 46.100 / 58. 46.100

  libavformat    58. 26.100 / 58. 26.100

  libavdevice    58.  6.101 / 58.  6.101

  libavfilter     7. 48.100 /  7. 48.100

  libswscale      5.  4.100 /  5.  4.100

  libswresample   3.  4.100 /  3.  4.100

  libpostproc    55.  4.100 / 55.  4.100

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

Stream mapping:

  Stream #0:0 -> #0:0 (mjpeg (native) -> mpeg4 (native))

[swscaler @ 0x7f90ca800600] deprecated pixel format used, make sure you did
set range correctly

Output #0, mp4, to 'video.mp4':

  Metadata:

    encoder         : Lavf58.26.100

    Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 992x660 [SAR
1:1 DAR 248:165], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc

    Metadata:

      encoder         : Lavc58.46.100 mpeg4

    Side data:

      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1

frame=    1 fps=0.0 q=4.6 Lsize=      24kB time=00:00:00.00
bitrate=2526461.5kbits/s speed=0.00336x

video:23kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 3.604475%
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How to specify duration for an input with pipe protocol

kumowoon1025
Some strange things happened when I tried to unlimited loop filter this, not entirely sure why. Using the # of loops to control duration seems to work, though I’m not sure if it’s masking a problem that might resurface if the loop count got too high (i.e. duration got too long)

ffmpeg -i pipe:3 -filter:v loop=loop=25*3:size=1 -c:v mpeg4 -r 25 video.mp4 3<input.jpg
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How to specify duration for an input with pipe protocol

Taner Sener
On Fri, 8 Feb 2019 at 02:46, Ted Park <[hidden email]> wrote:
> ffmpeg -i pipe:3 -filter:v loop=loop=25*3:size=1 -c:v mpeg4 -r 25
video.mp4 3<input.jpg

It works, thanks. Using "loop=loop=-1:size=1" to loop infinitely also
worked for me.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".