Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques FFmpeg and x264 in streaming

  • FFmpeg and x264 in streaming

    Posted by Nayan Kapadia on June 15, 2010 at 4:53 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

    Nayan Kapadia replied 15 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Michael Rampe

    June 15, 2010 at 9:15 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.
    https://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”

  • Nayan Kapadia

    June 22, 2010 at 6:20 am

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

    Thank you,
    Nayan Kapadia

  • Michael Rampe

    June 22, 2010 at 8:14 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"

  • Nayan Kapadia

    June 22, 2010 at 9:55 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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy