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 5th March 2018, 14:00   #1  |  Link
Richard1485
Guest
 
Posts: n/a
Changing AVC Metadata Without Re-encoding

Is there a way to change the metadata of an AVC elementary stream without re-encoding? For example, it would be useful to be able to slow down a 25p stream encoded with PAFF/MBAFF and flag it as progressive. Of course, eac3to can accomplish the slowdown, but the stream still reads as interlaced. (Changing AR would be another potential use.)

In short, it would be nice to have something that does for AVC what Restream did for MPEG-2. Is this possible? I tried searching for a tool to accomplish this but drew a blank.
  Reply With Quote
Old 5th March 2018, 20:35   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
frame rate can be changed with: https://forum.doom9.org/showthread.php?t=152419, no clue about changing interlaced to progressive,..
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 5th March 2018, 21:41   #3  |  Link
Richard1485
Guest
 
Posts: n/a
Thanks! I came across that tool but (like you) saw nothing about changing interlaced to progressive. It does sound useful though.
  Reply With Quote
Old 5th March 2018, 21:47   #4  |  Link
mkver
Registered User
 
Join Date: May 2016
Posts: 197
You don't need that ancient ffmpeg build; ffmpeg now has a bitstream filter h264_metadata for changing AR and framerate.
Regarding flagging from interlaced to progressive: If your stream is MBAFF and uses only progressive encoding (no interlaced macroblocks) -- e.g. if you use x264's fake-interlaced-option, then it should be possible to change the stream to progressive, but there isn't any tool that I know of that does this. If you are really using interlaced encoding (in particular with PAFF), there is no chance to change the bitstream to make it appear progressive. Your best option is to try to signal at the container level that your content is actually progressive.
mkver is offline   Reply With Quote
Old 5th March 2018, 22:18   #5  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by mkver View Post
If your stream is MBAFF and uses only progressive encoding (no interlaced macroblocks) -- e.g. if you use x264's fake-interlaced-option
Isn't x264 --fake-interlaced is PAFF?
sneaker_ger is offline   Reply With Quote
Old 6th March 2018, 00:44   #6  |  Link
mkver
Registered User
 
Join Date: May 2016
Posts: 197
I just tested it and it is indeed PAFF with every picture coded as frame. So maybe it is enough to change the frame_mbs_flag to 1, eliminate the mb_adaptive_frame_field_flag, update the pic_height_in_map_units_minus1, update the vertical cropping flags (attention: if frame_mbs_only_flag is set to 0, then the frames will be padded to mod 32, so that when the fake-interlaced is reversed, it may be that one crops 16 or more pixels away vertically; this is not against the H.264 spec, but AFAIK some players don't like it;1080 is well behaved in this regard), update the slice headers (delete the field_pic_flag). For cabac one also needs to ensure the byte alignment condition of the slice data. And of course all of this has to be done on the SODB or RBSP level, not the NAL level. Have I missed something?
mkver is offline   Reply With Quote
Old 6th March 2018, 10:10   #7  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Quote:
Originally Posted by Richard1485 View Post
In short, it would be nice to have something that does for AVC what Restream did for MPEG-2. Is this possible? I tried searching for a tool to accomplish this but drew a blank.
Agreed... Such a tool for AVC and even HEVC (with a simple UI) would be most useful
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is online now   Reply With Quote
Old 13th March 2018, 11:13   #8  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Seeing this I assume it can be done (just a matter of an effort and price):

https://hdr.avtop.com/hdr_solutions_avtop
kolak is offline   Reply With Quote
Old 18th March 2018, 02:18   #9  |  Link
Richard1485
Guest
 
Posts: n/a
^Thanks! That's tool looks great but rather expensive.

Is it possible to change scan-type/store-method from separated fields to interleaved fields?

EDIT: Here's a post that outlines the difference (though my primary interest in not in decoding, and these are not my files).

EDIT: Is there a free tool that displays detailed information about the stream? MediaInfo has its uses, but the information that it presents is quite limited. Of course, x264-encoded streams contain information about how they were encoded, but this is not the case with all h.264 streams.

Last edited by Richard1485; 18th March 2018 at 18:37. Reason: addition; added hyperlink
  Reply With Quote
Old 18th March 2018, 13:18   #10  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
free: ffmpeg trace_headers bitstream filter, h264_parse; Allegedly buggy, leaving for reference: https://sourceforge.net/projects/h264streamanalysis/
expensive (but with free demos): Zond, CodecVisa
Attached Files
File Type: zip h264_parse.zip (58.3 KB, 135 views)

Last edited by sneaker_ger; 19th March 2018 at 12:06. Reason: mkver informed me about "H264 Stream Analysis" being bugged. Added other free tools instead.
sneaker_ger is offline   Reply With Quote
Old 18th March 2018, 13:30   #11  |  Link
Richard1485
Guest
 
Posts: n/a
^ That's really useful. Thanks!

EDIT: I might as well add links to the other two tools (for future reference).

CodecVisa

Zond

Last edited by Richard1485; 18th March 2018 at 13:35. Reason: added hyperlinks
  Reply With Quote
Old 18th March 2018, 16:41   #12  |  Link
mkver
Registered User
 
Join Date: May 2016
Posts: 197
And there is also an ffmpeg bitstream filter for this: trace_headers.
mkver is offline   Reply With Quote
Reply

Tags
analysis, avc, h.264, metadata, stream

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 15:20.


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