Dear Sir,
Despite changing a CBR bitrate value, the output file size and the quality is not change.
Do you have any idea why it is happened on DM365 MPEG2 Encoder?
Regards,
Takeshi
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Dear Sir,
Despite changing a CBR bitrate value, the output file size and the quality is not change.
Do you have any idea why it is happened on DM365 MPEG2 Encoder?
Regards,
Takeshi
Hi Takeshi-san,
Can you send the full parameter of the encoder ? By any chance you have set rateCOntrolPreset = IVIDEO_NONE ?
regards
Yashwant
Dear Yashwant
Thank you so much for your quick reply. The parameters we set are below.
Please advice us if you have any ideas the bitrate of CBR does not effect the quality.
VIDENC1_Params
maxHeight : 720
maxWidth : 480(NTSC) or 576(PAL)
maxFrameRate : 3000(NTSC) or 2500(PAL)
maxBitRate : *the video bitrate as we specified
maxInterFrameInterval: 1
inputChromaFormat : XDM_YUV_420SP
inputContentType : IVIDEO_PROGRESSIVE
inputChromaFormat : XDM_YUV_420SP
reconChromaFormat : XDM_YUV_420SP
encodingPreset : XDM_HIGH_SPEED
rateControlPreset : IVIDEO_LOW_DELAY
IMP2VENC_Params
aspectRatio : IMP2VENC_AR_3_4
timerResolution : 30(NTSC) or 25(PAL)
VIDENC1_DynamicParams
inputHeight : 720
inputWidth : 480(NTSC) or 576(PAL)
refFrameRate : 3000(NTSC) or 2500(PAL)
targetFrameRate : 3000(NTSC) or 2500(PAL)
intraFrameInterval: *the GOP_N value as we specified;
interFrameInterval: 0
targetBitRate : *the video bitrate as we specified
Takeshi
Dear Yashwant-san,
Did you find any cause of the problem from my parameter settings?
Takeshi
Dear Sir,
The followings are the additional information about this problem.
With the above parameters setting and the following condition, the result of encoded sound and the video is missing apart.0844.XO=0 YO=0 XS=720 YS=576 XD=720 YD=576 VT=1 BR=1 BM=1024 BV=4300 GM=3 GN=15 AM=0 AR=0.mpg
Video standard : PAL Bitrate algorithm: CBR Bitrate (Max) : 1024000bps Bitrate (VBR) : -1bps GOP (N:M) : 15:3 Quant Param Max : 1 Quant Param Min : 1 Quant Param Init : 1 Quant Param Intra: 1 Quant param Inter: 1 (* since we do not use advanced parameter, above Quant Param xxx will be ignored.)
If we set higher than 1Mbps bitrate, this problem won't be occurred.
Takeshi
Dear Takeshi-san,
Uploaded video has met the bitrate of 1 Mbps. Can you send encoded files for other bitrates which you have tried and faced issue.
Regards,
Neelakanth
Thank you for the reply Neelakanth-san.
However, over the 1Mbps bitrate, we could not see any problem. Only with the bitrate of 1Mbps, we could see the problem.
Do you still need the encoded video which is over 1Mbps bitrate?
Regards,
Takeshi
Dear Takeshi-san,
Your answer is not complete and I am not understanding what issues you are facing. You say for bitrate more than 1Mbps bitrate is met.
I am seeing at 1 Mbps also bitrate is met (after analyzing mpg clip you uploaded).
Did you try lesser than 1 Mbps? If so what bitrates did you try? I need bitstreams that are failing to meet the set bitrate.
Regards,
Neelakanth
Dear Neelakanth-san
Thank you for your reply.
The problem we're facing is when we MPEG2 encode with CBR, despite changing a CBR bitrate value, the output file size and the quality is not change.
So we doubted some of the DM365 parameters settings and I described the whole parameters to get some help.
Addionally if we set 1Mbps bitrate with the condition as follows, the output data size of encoder will be returned as "0". If we set the CBR bitrate more than 1Mbps this problem
will be gone. At that time of encoding result, some of the frames and audio data are missing as the clip I uploaded. We do not try lesser than 1Mbps. Maybe happened
same problem.
-Video standard : PAL
-Bitrate algorithm: CBR
-Bitrate (Max) : 1024000bps
-Bitrate (VBR) : -1bps
-GOP (N:M) : 15:3
PS) Furthermore, we tried to set encodingPreset to XDM_HIGH_QUALITY other than XDM_HIGH_SPEED, the problem still exists.
Is my explanation clear? Sorry for confusing.
Regards,
Takeshi
Dear Takeshi-san,
I think you are trying to say that output bytes generated (frame size) in process call is 0. Is this correct ?
If so this is expected at low bitrate scenario in CBR mode (especially when GOP size is as low as 15)
The encoder has strict buffer compliance in CBR mode resulting in frame skips at low bitrates.
1mbps for 720x576 is a low bitrate scenario which can result in frame drops.
As far as the uploaded clip is concerned, I have extracted the raw m2v file from mpg and here are the observations :
1. All 375 Frames are encoded in 15 seconds (No frame drop)
2. Most of the frames are static from frame 14 - frame 130 (timer embedded in recorded clip jumps to 2:57 from 2:51).
Do you mean to say that video and audio data missing from frames 14 - 130 is due to 0 output size ?
If so, How is that all 375 frames are available in the mpg file ?
Did you by chance transcode the original dm365 bitstream to generate the mpg file ?
Please share us the raw stream(m2v) generated by the dm365 encoder so that I am not confused with how you generated the mpg file ?
Regards,
Neelakanth
Dear Neelakanth-san,
I apologized for my awkward and misleading explanation.
We're now facing three different problems with CBR encoding.
1) The output file size and its quality is not changed despite of CBR setting.
2) Some audio is missing. Recording is terminated before specified time period. (i.e. wanted 15s but terminated at 7s)
3) Some time the output bytes generated in process call is 0 in case of low bitrate encoding.
The uploaded clip is #2 of the above problem and we do not know whether the process call is 0 or not.
Would you please give me some idea how #2 problem could be occurred? (as you might understand we don't put any static intentionally.)
About #3 problem, we could see same problem when we set GOP=18, too. Could you please advice us the recommended setting at low bitrate
and please also advice us how we increase the internal Buffer size if there is any way. Or if you can give us the concrete buffer name we may
find by ourselves.
The uploaded clip today is #2 problem. We specified the timeframe = 15s but it terminated at the time "0" was returned.
8625.image2.1_mpeg2lib_F123_OFFSET19.mpg
Regards,
Takeshi
Neekakanth-san,
#2 of the above problem is fixed because of our fault. Sorry for confusing!
Just the input source video was freezing.
I apologize again for our insufficient exam.
Please advise us #1 and #3.
Regards,
Takeshi
Dear Takeshi-san,
Thanks for the detailed explanation on the issue faced.
As regards to the issue #1, I have reviewed the "8625.image2.1_mpeg2lib_F123_OFFSET19.mpg" clip.
It appears you are setting the targetBitRate to 10Mbps instead of 1Mbps.
This is because the bitrate declared in the clip is 9.8Mbps.
Also the bitrate achieved is only 2.9Mbps for the input as the scence is static and the qp saturates to minimum value of 2. (qp cannot go lesser than 2)
This explains why the output file is same for 1mbps.
So can you please check if the value of targetBitRate set in dynamic parameter is 1mbps ?
As regards to issue#3, the best way to reduce 0 byte output (skip frames) in CBR mode is to increase the intraFrameinterval to very large value or set it to 0.
(Setting intraFrameInterval to 0 will encode first frame as I followed by all P)
The other parameter you may want to consider is increasing maxDelay if your application does not have low latency requirements.
Regards,
Neelakanth
Dear Neelakanth-san,
We'll try #3 issue. Thank you for your advice.
The clip I uploaded is not for #1 but for #2 issue. (So we just set 10Mbps at that time)
We set several targetBitRate value and exam. Our question is despite we set the targetBitRate to 1M to 9.8Mbps,
the output file size will be almost same and the quality of the encoded files will be almost same. Why is it happened?
The attached moving pictures are one is 1Mbps CBR encoded and the another is 9.8Mbps CBR encoded.
1) image1_PAL_5_1024k.mpg: 1Mbps (5s clip)
2) image1_PAL_5_9800k.mpg: 9.8Mbps (5s clip)
* 2) clip is played 5 seconds but the total size indicate only 1 sec. This is other problem we're facing.
Could you please advice us #1 issue.
Regards,
Takeshi
Dear Takeshi-san,
We have reviewed both the clips of 1Mbps and 9.8Mbps.
We have verified that both the files playback 5 seconds worth video data.
The first file has met bitrate of 1Mbps but the other file has achieved only 1.6Mbps.
The input content is static with only one small block(48x48 size) moving.
Thus the P frame compression is very high with most mbs coded as SKIP MB.
As explained in previous reply, when you set target to 10mbps the quantization parameter (qp) saturates to a minimum value of 2 due to easily compressed inter mbs.
As a result, achieved bitrate is far less than target of 10mbps clip.
Also note that we do not add stuffing bits in CBR mode when qp saturates to low values and bitrate is not met. (This is because you will not gain any quality by adding stuffing bits, only redundant bits get added at end of frames to meet target bitrate)
It appears that QPMin in extended dynamic parameters is set to 2 in the encoder application.
You can set QPMin to 1 and check if it improves the bitrate.
However you may face the same issue of QP saturating at 1 and still not meeting bitrate due to most mbs getting coded as skip mb as explained above.
Regards,
Neelakanth
Dear Neelakanth-san,
Thank you so much!
About #3 issue:
We tried to set the max value of intraFrameinterval (=0x13) we reduced the phenomenon (0byte output) but still there.
To set a maxDelay value larger, we're facing a problem with unexpected STOP MPEG2 Encoding when using IMP2VENC_DynamicParams (this is PSP problem)
we can not use it.
I'd like to explain to the customer how this phenomenon happen. Would you please explain the cause of 0 byte output?
About #1 issue:
The customer almost understand your explanation. Thank you! However, is there any way to add stuffing bits?
Best Regards,
Takeshi
Dear Neelakanth-san,
We understood why the 0 byte return (skip frames) happens and how we can reduce it. If we inrease the intraFrameinterval or to set it to 0, the error could be reduced and if we set the bitrate bigger the error could be reduced. But we saw unexpectedly this error (0byte return and then stop encoding) only in still image not in moving picture. Then I thought even if the still image, if a total data size of after compression of still image is bigger than its moving pictures, this error could be happened in still image, not in moving pictures. Therefore I measured the both still image and moving pictures as below with following setting.
Bitrate setting for both: CBR-4096K
Resolution for both: NTSC
Other setting for both: GOP_N=4, M=0
No extended parameter is used for both cases.
Acutal Still Image bitrate: 5337K(Ave) / 5545K(Max)
*Image File:7245.Zero_Return_image1_MPEG2_NTSC_P_CBR4M_GOP4-0_AC3-384K_10S_Size0.mpg
Acutal Moving Pictures bitrate: 4626K(Ave) / 5175K(Max)
*Moviing Pictures:2235.No_Error_image1_MPEG2_NTSC_P_CBR4M_GOP4-0_AC3-384k_10S.mpg
This Still Image would be stopped at about 5 seconds unexpectedly. But this moving pictures are successfully completed 10 seconds.
According to this result, now I understood why this error (0byte return) was happened with only in still image becuase of the data size.
But I have a new question because of this result.
Why was the actual bitrate bigger than its setting of 4096K? Since we do not use an enhanced parameters the q value can not be changed. Furthermore this still image seems to be lower data size than this moving picture. Would you please point out why this result happened?
We also found the last compressed image was bigger(x1.3) than others when it unexpectedly stopped around 5 seconds.
Regards,
Takeshi
Additional comments on 9th Sep.)
If you can not open the above files, please download the following zip files.
5417.Zero_Return_image1_MPEG2_NTSC_P_CBR4M_GOP4-0_AC3-384K_10S_Size0.zip
0184.No_Error_image1_MPEG2_NTSC_P_CBR4M_GOP4-0_AC3-384k_10S.zip
Today I found that if we use "interlaced encoding" with a still image, the error is not seen. Is there any relationship that a data size of one frame(fileld) encode?
Regards,
Takeshi