4

I want to pipe uncompressed audio+video from one process to another.

It means it should be packed into some container. Which one is the best suited for the task?

I tried ffmpeg -i ... -vcodec rawvideo -acodec pcm_s16le -f ... -y test, but it mostly fails. Resulting Matroska files are playable only thought ffmpeg (not with mplayer) and AVI doesn't play well from pipe.

Update:

Looks like

ffmpeg -i ...  -vcodec rawvideo -acodec pcm_s16le -f avi  -y - | mplayer -cache 200000 -noconsolecontrols -

works more or less stable. -f matroska also works for gstreamer/ffplay, but not for mplayer/vlc.

Vi.
  • 16,755
  • 32
  • 111
  • 189
  • I would figure out why AVI isn't working well. That has always been my choice for uncompressed video. – ubiquibacon Jul 12 '13 at 12:31
  • For example, 1. how to also store uncompressed audio into AVI? 2. Is AVI suited for pipes (to pass into another program without storing)? – Vi. Jul 12 '13 at 12:36
  • You can easily store uncompressed audio in AVI, at least PCM should definitely not be a problem. Where exactly do you want to pipe to? – slhck Jul 12 '13 at 12:51
  • Looks like pcm_u16be is not a best way, pcms16le works better... – Vi. Jul 12 '13 at 13:11

1 Answers1

2

I didn't realize when you said "one process to another" that the video didn't already exist on disc. With that being said it would probably be best to use some variant of the .ts format. I have never tried to stream any video directly from one process to another without the video first existing on disc, but I have wrote a .ts file to disc and while the file is still being written to disc read it via another process. There is probably a way around the disc write, but I don't know what it is.

ubiquibacon
  • 8,098
  • 3
  • 29
  • 36
  • 1
    I'm not sure MPEG-2 Transport Streams allow every kind of codec, even within private streams. Have you tried this with raw video / audio? – slhck Jul 12 '13 at 13:02
  • I was dealing with my HDHomeRunPrime which saves video in the `.ts` format. My co-worker has an HDHomeRun (not Prime) which also saves in the `.ts` format. He made some PVR software to interface with his unit and smart TVs and he told me the streams saved by the HDHomeRun were raw. I can try to confirm this later tonight on my system. – ubiquibacon Jul 12 '13 at 13:12
  • Files written with `ffmpeg -i ... -vcodec rawvideo -acodec pcm_s16le -f mpegts -y a.ts` are not readable even by ffmpeg itself (also mplayer, vlc and gstreamer). – Vi. Jul 12 '13 at 15:09