[ffmpeg] how to merge two slices from independent two video TS

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[ffmpeg] how to merge two slices from independent two video TS

杨阳
Hi,


I have a requirement about 2 udp videos(H264 TS) merge into 1 (HEVC TS). Two videos show in left & right side screen at the same time.
But I don't want to do decoder. Because it costs too much cpu. I would like to parse 2 videos slices, and merge slices into one.
I need the requirement applied in multiview.


I have found a post in https://lists.ffmpeg.org/pipermail/ffmpeg-user/2012-August/009220.html, but i can't get the point from that.


Thanks
B.R
yiyi
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] how to merge two slices from independent two video TS

Moritz Barsnick
Hi yiyi,

On Tue, Sep 11, 2018 at 12:36:45 +0800, 杨阳 wrote:
> I have a requirement about 2 udp videos(H264 TS) merge into 1 (HEVC
> TS). Two videos show in left & right side screen at the same time.

When you write "show", you mean to display with ffplay?

> But I don't want to do decoder.

Well, to display *any* video at all, you need to decode it. That's just
how video encoding and decoding works by concept. If you mean you don't
want to *re-encode*, then you can't create a new video (because a new
video needs to be encoded, if the streams are to be displayed side by
side).

> Because it costs too much cpu.

Decoding shouldn't cost too much CPU, unless you are on a really weak
device. And see above: You must decode at some point.

Assuming you mean to display side by side, without recoding, you can
use ffplay. In general, ffplay only supports one input, but using a
complex filter chain with the "movie" filter, you can combine various
inputs, even streams.

To put video streams side-by-side, you use the hstack filter.

In total, a command line would look something like this. Note that the
quoting was done for Windows, but might work for Unix al well:

$ ffplay -f lavfi "movie='udp\://localhost\:9011'[a]; movie='udp\://localhost\:9012'[b]; [a][b]hstack"

(This works for me (TM).)

> I have found a post in
> https://lists.ffmpeg.org/pipermail/ffmpeg-user/2012-August/009220.html,
> but i can't get the point from that.

Totally unrelated.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] how to merge two slices from independent two video TS

杨阳
Hi Moritz,


Thanks for your replay.
I want to explain my idea clearly.
> I have a requirement about 2 udp videos(H264 TS) merge into 1 (HEVC
> TS). Two videos show in left & right side screen at the same time.

When you write "show", you mean to display with ffplay?
>>I want to devide the process into 2 steps.
1. merge 2 videos into 1 TS, I can do encoding if necessary, but before encoding, how can i merge 2 videos TS without decode.[I don't know how to complete]
2. the final merged TS should use hw decode for showing video [I can support]

> But I don't want to do decoder.

Well, to display *any* video at all, you need to decode it. That's just
how video encoding and decoding works by concept. If you mean you don't
want to *re-encode*, then you can't create a new video (because a new
video needs to be encoded, if the streams are to be displayed side by
side).

> Because it costs too much cpu.

Decoding shouldn't cost too much CPU, unless you are on a really weak
device. And see above: You must decode at some point.
>> I have caculated that system needs decode 25-30 frames per second for smoothly video playing.But decode two UDP TS using ffmpeg interfaces cost too much time. After 2 ts merged ok, I will add another two ts[totally 4 ts] merge. I have no idea to improve performance with my embedded device.
>>So I think about a method that do not need decode, just change base layer slice header, and conbine a new Multiview TS. Do you have some suggestions to fullfill the feature?


Assuming you mean to display side by side, without recoding, you can
use ffplay. In general, ffplay only supports one input, but using a
complex filter chain with the "movie" filter, you can combine various
inputs, even streams.
>> As above, ffplay may be not useful.


Thanks
B.R
yiyi





At 2018-09-11 17:09:57, "Moritz Barsnick" <[hidden email]> wrote:

>Hi yiyi,
>
>On Tue, Sep 11, 2018 at 12:36:45 +0800, 杨阳 wrote:
>> I have a requirement about 2 udp videos(H264 TS) merge into 1 (HEVC
>> TS). Two videos show in left & right side screen at the same time.
>
>When you write "show", you mean to display with ffplay?
>
>> But I don't want to do decoder.
>
>Well, to display *any* video at all, you need to decode it. That's just
>how video encoding and decoding works by concept. If you mean you don't
>want to *re-encode*, then you can't create a new video (because a new
>video needs to be encoded, if the streams are to be displayed side by
>side).
>
>> Because it costs too much cpu.
>
>Decoding shouldn't cost too much CPU, unless you are on a really weak
>device. And see above: You must decode at some point.
>
>Assuming you mean to display side by side, without recoding, you can
>use ffplay. In general, ffplay only supports one input, but using a
>complex filter chain with the "movie" filter, you can combine various
>inputs, even streams.
>
>To put video streams side-by-side, you use the hstack filter.
>
>In total, a command line would look something like this. Note that the
>quoting was done for Windows, but might work for Unix al well:
>
>$ ffplay -f lavfi "movie='udp\://localhost\:9011'[a]; movie='udp\://localhost\:9012'[b]; [a][b]hstack"
>
>(This works for me (TM).)
>
>> I have found a post in
>> https://lists.ffmpeg.org/pipermail/ffmpeg-user/2012-August/009220.html,
>> but i can't get the point from that.
>
>Totally unrelated.
>
>Cheers,
>Moritz
>_______________________________________________
>ffmpeg-user mailing list
>[hidden email]
>http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
>To unsubscribe, visit link above, or email
>[hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] how to merge two slices from independent two video TS

Carl Eugen Hoyos-2
2018-09-11 12:05 GMT+02:00, 杨阳 <[hidden email]>:

> 1. merge 2 videos into 1 TS, I can do encoding if necessary, but
> before encoding, how can i merge 2 videos TS without decode.

This is not possible with FFmpeg, I doubt that it is possible at all.

Please learn about quoting in emails and do it correctly.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".