Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Transcoding live stream

  • Transcoding live stream

    Posted by Yair Ben on September 27, 2011 at 11:17 pm

    Hello,

    We have a 360 panoramic camera video stream input, and we need to crop the stream and output the cropped live-stream.
    For example, consider having a 1000px wide stream, and you want to output only from pixels 1 to 200, then 400 to 600, and 800 to 1000 as a solid single stream (600px wide).

    How can this be achieved ?

    Yair.

    Michael Rampe replied 14 years, 10 months ago 2 Members · 3 Replies
  • 3 Replies
  • Michael Rampe

    September 29, 2011 at 1:55 am

    [Yair Ben] “For example, consider having a 1000px wide stream, and you want to output only from pixels 1 to 200, then 400 to 600, and 800 to 1000 as a solid single stream (600px wide).”

    OK. The best thing for this is to use the avfiltering pipeline. I did some work and got this to give your result (one way out of several):

    $ ffmpeg -i 1000wide.mpg -sameq -vf
    “movie=1000wide.mpg,setpts=PTS-STARTPTS,crop=200:in_h:400:0[T1];
    movie=1000wide.mpg,setpts=PTS-STARTPTS,crop=200:in_h:800:0[T2];
    [in]setpts=PTS-STARTPTS,crop=200:in_h:0:0,pad=600:in_h:0:0,
    [T1]overlay=200:0,[T2]overlay=400:0[out]”
    output.mpg

    Basically,
    1. create an duplicate input and crop to the centre 200 pixels
    2. create a second duplicate input and crop to the right 200 pixels
    3. Take the input, crop to the left 200 pixels, pad 400 pixels of black to the right, overlay the two duplicates.

    [Yair Ben] “We have a 360 panoramic camera video stream input, and we need to crop the stream and output the cropped live-stream.”

    Not sure how this will perform for a live stream…..;-) (probably have issues with the PTS settings above and might be slower than realtime which will also cause headaches)

    Let me know.

    Michael

  • Yair Ben

    September 29, 2011 at 11:23 pm

    (admin: please ignore the previous post)

    Thanks Michael,

    But my input is a stream, not a video file.
    I don’t mind a small delay in the output stream, but its a constant streaming input/output.

  • Michael Rampe

    September 30, 2011 at 2:12 am

    [Yair Ben] “(admin: please ignore the previous post)”

    Not sure what this means… You want me to ignore my own post? 😉

    [Yair Ben] “But my input is a stream, not a video file.”

    This is well documented.

    Try to remove the startpts filters or investigate the split filter if the filter chain I suggested does not work for a live stream.

    Michael

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