Log in

View Full Version : How to re-encode with the same parameters?


alexVS
12th July 2009, 14:03
I'm composing hockey game clip, cutting fragments from whole game (mp4, h264 AVC) with YAMB.

I want to insert 10sec fragment into the clip, and there is no keyframe at the point where I want to cut.

So I need to reencode 10sec with the same parameters as original clip. I don't want to reencode ALL clip. Is it possible to reencode this 10sec so that it will have all the same parameters as original?

P.S. I tried to set all parameters that I got from Mediainfo in MEGUI, made the new 10sec video, YAMB joins it with original, but MPC and KMPlayer stop playback at the point where my fragment starts.

alexVS
12th July 2009, 14:11
Or can any program at some point of video stream convert non-keyframe into keyframe and automatically do recompression of nearby frames?

Sharktooth
12th July 2009, 15:40
try avidemux... also learn to edit your posts instead of posting twice.

alexVS
12th July 2009, 15:55
It's always difficult for me to use avidemux
Could you help me please.
My source hockey game is in mp4

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Muxing mode : Container profile=Unknown@4.1
Codec ID : V_MPEG4/ISO/AVC
Duration : 34mn 59s
Bit rate : 5 001 Kbps
Nominal bit rate : 5 100 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16/9
Frame rate : 50.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.109
Stream size : 1.22 GiB (94%)
Writing library : x264 core 65 r999kMod cc51047
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x133 / me=dia / subme=6 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=2 / thread_queue=2 / nr=0 / decimate=1 / mbaff=0 / bframes=5 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=5100 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

Could you tell me where to get x264 core 65 r999kMod cc51047 ? Maybe if I enter these parameters, my re-encoded 10 second part will be compatible with source :confused: :thanks:

komisar
12th July 2009, 16:02
Could you tell me where to get x264 core 65 r999kMod cc51047
here: http://komisar.gin.by/old/999/
but you may try re-encoding with last version of x264

alexVS
12th July 2009, 17:31
Thanks a lot!

Successfully made new file with the same parameters as original.
Joined all parts with mp4box
All works fine now :)

LoRd_MuldeR
12th July 2009, 18:53
Could you tell me where to get x264 core 65 r999kMod cc51047 ? Maybe if I enter these parameters, my re-encoded 10 second part will be compatible with source :confused: :thanks:

There is no need to go back to an old build of x264.

Any version of x264 will produce valid H.264 streams. Hence joining streams from different versions of x264 should be no problem.

kemuri-_9
12th July 2009, 19:13
Any version of x264 will produce valid H.264 streams. Hence joining streams from different versions of x264 should be no problem.

shouldn't there be a 'As long as the parameters are (nearly) the same' clause in there somewhere?

LoRd_MuldeR
12th July 2009, 19:39
shouldn't there be a 'As long as the parameters are (nearly) the same' clause in there somewhere?

There should be nothing that prevents him to choose the same (or compatible) encoder parameters with up-to-date x264, I think...

akupenguin
12th July 2009, 19:59
The concatenation of any two valid h264 streams is a valid h264 stream. You may, however, have problems muxing it into mp4 or mkv if you don't specify a different --sps-id for each segment that has a different sps. If you do set --sps-id appropriately, then there are no constraints at all on the settings: they can be different profile, different resolution, etc.

LoRd_MuldeR
12th July 2009, 20:18
The concatenation of any two valid h264 streams is a valid h264 stream. You may, however, have problems muxing it into mp4 or mkv if you don't specify a different --sps-id for each segment that has a different sps. If you do set --sps-id appropriately, then there are no constraints at all on the settings: they can be different profile, different resolution, etc.

The question is: Do "real world" players (software and hardware) cope with such streams?

In my experience some applications even choke on MPEG-2 streams with a "simple" resolution change ;)

akupenguin
12th July 2009, 20:48
OK, so maybe not resolution. But libavcodec and coreavc can cope with changes in any other parameter. You'll have to ask someone else about hardware.

LoRd_MuldeR
12th July 2009, 21:06
But libavcodec and coreavc can cope with changes in any other parameter.

That's relieving :)