Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th May 2018, 00:33   #21  |  Link
NailBomber
Registered User
 
Join Date: May 2015
Location: Russia
Posts: 17
Yes, I'll have to do that or remux into .h264 ES using FFMPEG, since it seems a different encoder was used.
Learned some new things from this thread, which is always good.
Still I would like to be at least as close as I can to original video parameters.

Speaking of, I'm making a simple script that tries to get parameters from FFMPEG trace_headers output.
Is this a correct way to get video dimensions from SPS?
Code:
parameters["width"] = ( pic_width_in_mbs_minus1 + 1 ) * 16
parameters["height"] = ( 2 - frame_mbs_only_flag ) * ( pic_height_in_map_units_minus1 + 1 ) * 16

if ( frame_cropping_flag == 1 ):
    cropUnitX = None
    cropUnitY = None

    if ( chroma_format_idc == 0 ):
        cropUnitX = 1
        cropUnitY = 2 - frame_mbs_only_flag
    else:
        cropUnitX = 2
        cropUnitY = 2 * ( 2 - frame_mbs_only_flag )

    parameters["width"] = parameters["width"] - ( frame_crop_left_offset * cropUnitX ) - ( frame_crop_right_offset * cropUnitX )
    parameters["height"] = parameters["height"] - ( frame_crop_top_offset * cropUnitY ) - ( frame_crop_bottom_offset * cropUnitY )

Last edited by NailBomber; 13th May 2018 at 00:36.
NailBomber is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.