FORUMS: list search recent posts

FFmpeg and x264 in streaming

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
nayan kapadia
FFmpeg and x264 in streaming
on Jun 15, 2010 at 4:53:45 am

Hi,

I am doing live streaming using FFmpeg and libx264. In FFmpeg some parameters of x.264 like RC-lookahead sync-lookahead –tune –intra-refresh are not supported. From internet, I found that there is a way to use ffmpeg and x264 through pipe.Can you guide me in this matter?

Thanks,
NBK


Return to posts index

Michael Rampe
Re: FFmpeg and x264 in streaming
on Jun 15, 2010 at 9:15:03 am

I hadn't heard about this named piping technique but it looks interesting.

After a quick look, this seems both complicated and well documented but I will give you a quick rundown.

Basically:

#FFmpeg --> named pipe (fifo) --> x264


FFmpeg decodes the video stream to raw data and passes it to a named pipe.
x264 inputs this named pipe and exports raw data.

I am assuming (possibly incorrectly) that you then have to pass this raw stream back to FFmpeg to put in a container, for example, mp4.

#FFmpeg --> named pipe --> x264 --> named pipe --> FFmpeg


Of course, you will probably want audio with your video as well and x264 is not an audio encoder;-) Best to split that whilst decompressing the original stream and map back in after the video has been encoded with x264.

#FFmpeg --> named pipe --> x264 --> named pipe --> FFmpeg
#FFmpeg-------------> named pipe (audio)--------------->/


You can always just run the commands concatenated (one by one) instead if you are not too concerned by time.
http://forums.creativecow.net/readpost/291/70

I will look into it further.

Good luck for now.

Michael

"half-way to world domination A.K.A. the belligerent blue bike shed"


Return to posts index

nayan kapadia
Re: FFmpeg and x264 in streaming
on Jun 22, 2010 at 6:20:38 am

Thank you very much. I will try this. Do you have any luck in this matter?

Thank you,
Nayan Kapadia


Return to posts index


Michael Rampe
Re: FFmpeg and x264 in streaming
on Jun 22, 2010 at 8:14:42 am

Haven't looked into this specific use but have been using named pipes for another project so I will look into it now.

Basically what worked for me is:

First create the named pipe with the proper extension:
$ mkfifo fifo.y4m

Then run both processes at once:
$ x264 --quiet --crf 18 -o video.264 fifo.y4m & \
ffmpeg -i funny_bubbles.mov -pix_fmt yuv420p -an \
-f yuv4mpegpipe - > fifo.y4m fifo.y4m < /dev/null

Then remove the fifo:
$ rm fifo.y4m

You could also write a simple *sh script to do them all at once.

Good luck.

Michael

"half-way to world domination A.K.A. the belligerent blue bike shed"


Return to posts index

nayan kapadia
Re: FFmpeg and x264 in streaming
on Jun 22, 2010 at 9:55:18 am

Thanks for your reply and support.I am working on windows and also i need h.264 output format and .ts file container. So i am confused how to make this work for windows.If you have any idea for this?

Thanks
NBK


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]