13

The line

ffmpeg -f h264 -i pipe111.fifo -c:v copy -f mp4 -

gives the error:

Input #0, h264, from 'pipe111.fifo':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 480x270, 6 fps, 6 tbr, 1200k tbn, 12 tbc
[mp4 @ 0x1562130] muxer does not support non seekable output
Output #0, mp4, to 'pipe:':
Metadata:
encoder         : Lavf56.9.100
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 480x270, q=2-31, 6 fps, 1200k tbn, 1200k tbc
Stream #0:0 -> #0:0 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

But the

ffmpeg -f h264 -i pipe111.fifo -c:v copy -f mp4 /some/file/in/fs.mp4

works correctly. Why? NO ERROR.

Vyacheslav
  • 26,359
  • 19
  • 112
  • 194
  • 1
    Please explain why you are piping the `ffmpeg` output. As the console output states, `muxer does not support non seekable output`, so use something else other than `-f mp4`. I doubt the second command actually works. I'd expect an error: `At least one output file must be specified`. – llogan Jan 13 '15 at 18:04
  • @LordNeckbeard The application catches the output and manage it to the other parts of the app. Anyway I've found the explaination of this "bug" . A usual, this is not a bug this is a feature:) Here http://superuser.com/questions/760056/receiving-ffmpeg-error-22-when-piping-data-to-stdout – Vyacheslav Jan 14 '15 at 18:09

1 Answers1

5

Due to this question is still popular I want to write a quick answer from here https://superuser.com/questions/760056/receiving-ffmpeg-error-22-when-piping-data-to-stdout

the mp4 container requires the ability to seek within the file. A pipe is a stream, and impossible to seek inside of. Try using a streaming container like ts, or flv.

Community
  • 1
  • 1
Vyacheslav
  • 26,359
  • 19
  • 112
  • 194