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

杨阳 helloyy369 at 163.com
Tue Sep 11 13:05:36 EEST 2018


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" <barsnick at gmx.net> 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
>ffmpeg-user at ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
>To unsubscribe, visit link above, or email
>ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list