Home > other >  X. 264 multithreaded parallel encoding, the output of how much NALU encapsulated in the MP4
X. 264 multithreaded parallel encoding, the output of how much NALU encapsulated in the MP4

Time:10-01

X. 264 multi-thread parallel encoding, output multiple nalu package, 264 flow sequence is as follows: SPS PPS SEI IDR IDR IDR IDR P_Slice P_Slice P_Slice P_Slice.. Each frame P frame I produced four nalu, reoccupy mp4v2 encapsulated into mp4 format, if each nalu encapsulation, the video four times slower, and some players put no, excuse me 4 thread, each frame of four nalu how to package?

CodePudding user response:


I'm just the main thread x264_encoder_encode useless threads

CodePudding user response:

reference 1st floor smwhotjay response:

I'm just the main thread x264_encoder_encode useless multithreaded

Multithreaded here refers to the slice parallel mode, pParam - & gt; I_threads=4, param. B_sliced_threads=1

CodePudding user response:

See online say int b_sliced_threads;//if false, a slice only encoded into a NALU, otherwise there are several threads, are encoded into several NALU,
Here after I changed to 0 (coded as a NALU and what parameters need to be configured?) When coding the first frame will be an error lookahead thread is already stopped
Is the source of x264_encoder_encode () the following code typed
If (h - & gt; Lookahead - & gt; B_exit_thread)
{
X264_log (h, X264_LOG_ERROR, "lookahead thread is already stopped \ n");
return -1;
}

CodePudding user response:

A rigorous idea, because FFmpeg + x264 can output the correct mp4, and tube packaging format is FFmpeg (may call the mp4v2 or other), the consult FFmpeg how to encapsulate multiple concurrent nalu is a way of thinking,
In addition, if in quadruplicate, then I only take a can be solved?

CodePudding user response:

references to guangzhou, 4/f, leijiacha etc response:
a rigorous idea, because FFmpeg + x264 can output the correct mp4, and there is no FFmpeg tube packaging format (may call the mp4v2 or other), the consult FFmpeg how to encapsulate multiple concurrent nalu is a way of thinking,
In addition, if in quadruplicate, then I only take a can be solved?


264 data is encapsulated with mp4v2 encoded, corresponding to the I frame P frame nalu use function is MP4WriteSample (); Should not specifically for the encapsulation of parallel code after much nalu function (I didn't find, so far,), in addition, the parallel code is not in quadruplicate, otherwise such parallel would be meaningless

CodePudding user response:

Put more nalu packages of a frame, reoccupy mp4v2 encapsulated into a mp4

CodePudding user response:

refer to 6th floor rightorwrong response:
multiple nalu first package of a frame, reoccupy mp4v2 encapsulated into mp4

Thank you for your reply, "take more nalu packages of a frame", could you tell me what is the document? Really don't understand how the multiple nalu combined into a frame, give advice or comments please, thank you

CodePudding user response:

Nalu concept is the concept of frame, if too much a nalu will be divided into multiple slice, if you are directly to nalu you don't have to do to deal with, if take a slice of the demand for group package
When saving files SPS PPS SEI IDR group together as a frame to save

CodePudding user response:

refer to the eighth floor rightorwrong response:
nalu concept is the concept of frame, if too much a nalu will be divided into multiple slice, if you are directly to nalu you don't have to do to deal with, if take a slice of the demand for group package
When saving files SPS PPS SEI IDR group together as a frame to save

Similar to a post before, in more detail, https://bbs.csdn.net/topics/390404342? Page=1
Param. I_threads set to 1, code flow is SPS PPS SEI IDR P, param. I_threads set into 4 time became a SPS PPS SEI IDR IDR IDR IDR P P P P, each I and P frame into four, want to change this situation how to encapsulate excuse me?

CodePudding user response:

Divided into slice is mainly used for network transmission, standard, see nalu header definition and ffmpeg rtpdec code/no, put the package together can directly

CodePudding user response:

references to the tenth floor rightorwrong response:
into slice is mainly used to transport network, see nalu header definition and ffmpeg rtpdec part code/standard, the package together, you can directly to the

Rtpdec didn't tell me the situation inside the group package method,,
With 4 threads reason is found that the encoding speed faster, compared to 1 and 4 threads the H264 data encoded, 1 thread: SPS PPS SEI I P... 4 threads: SPS PPS SEI I1 I2 I3 I4 P1 P2 P3 P4...
4 thread I1 (hereinafter is referred to as "I1, 4 threads in the same way as other I2 I3 I2) : AD 6 b 5 a B7 (according to the data and I the same before the??? )
1 thread corresponding to the location of the I frame (the following abbreviation I) data for: AD 6 b 5 a B6 B5 AD 6 b
Question 1: why only last a different? When set package for one how to deal with this?
Picture, more intuitive
I2 starting: 00 00 00 01 65 01 E2 22 10 E8 91 40
My understanding is the I1 I2 I3 I4 slice_data composition, and I, parsing I2 below

Question 2: I2 slice_data I1 slice_data on cohesion should be here and I the same data, namely for B5 AD 6 b... , actually I parse out is 24 50 00 12...
Excuse me, how should splicing I1 I2 I3 I4 slice_data of I, also give advice or comments please, thank you very much

CodePudding user response:

Data not all didn't see

Just remember a frame of the first slice is 2 for Mosaic 1 byte, if is not directly behind the first byte

CodePudding user response:

The
refer to 12 floor rightorwrong reply:
data not all didn't see

Only remember a frame of the first slice is 2 for Mosaic 1 byte, if is not directly behind the first byte

What you have said about this not too see
1 thread I frame data is: 00 00 00 01, 65, 88, 84 3 a 43 E0 00 24 April 08 b 2 c... 59 F5 6 b 5 D6 B5 AD 6 b a B6 B5 AD 6 b 55 55 ...
4 thread I1 data is: 00 00 00 01, 65, 88, 84 3 a 43 E0 00 24 April 08 b 2 c... 59 F5 6 b 5 D6 B5 AD 6 b a B7
I2 data is: 00 00 00 01 65 E2 22 10 E8 01 91 40 48 7 e 4 c 99 32 64 00 A9 2 a
The appended drawings

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related