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 23rd March 2013, 06:09   #1  |  Link
videoRx
Robert Reinhardt
 
videoRx's Avatar
 
Join Date: Nov 2012
Location: Bainbridge Island, WA (close to Seattle)
Posts: 9
Modify existing MP4 file's total bitrate

I'd like to know if it's possible to modify the header (or metadata or specific atom) of an H.264/AAC MP4 file to alter the perceived bitrate. For example, if the reported bitrate (MediaInfo, QuickTime property inspector, etc) is 1000Kbps, I'd like to change it to another arbitrary value such as 2000Kbps. I don't need to influence playback in conventional desktop apps--it's purely for an ingest mechanism on a streaming media server (Wowza) for combined playlists where there's a mixture of low and high bitrate MP4 files and I want to low bitrate MP4 files to appear to have the same bitrate as the high bitrate MP4 files.

If this is possible, I'd appreciate any reference to a command line interface (mp4box, mp4creator, atomicparsley) that's capable of changing this value [or collection of values to "add up" to the total bitrate]. So far, all the examples I'm finding online are specifically for ID3 metadata tags (artist, title, etc), width, height, and framerate.

Many thanks in advance!
__________________
Robert Reinhardt
videoRx.com
http://linkedin.com/in/adaptivestreaming
videoRx is offline   Reply With Quote
Old 23rd March 2013, 16:50   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,370
Are you sure that these programs are looking at some kind of header value at all? The easiest and most precise way to determine the total bitrate would be to just look at the filesize and only look at the headers for the duration.
sneaker_ger is offline   Reply With Quote
Old 23rd March 2013, 17:27   #3  |  Link
videoRx
Robert Reinhardt
 
videoRx's Avatar
 
Join Date: Nov 2012
Location: Bainbridge Island, WA (close to Seattle)
Posts: 9
Thanks for the reply. It's a complicated scenario, but I'll summarize in as few as words as possible. Wowza Media Server can re-stream a VOD file as a live stream, and this mechanism by itself is just fine--Wowza provides many ways to push a stream to subscribers, and to specify whatever bitrate you want for those streams. However, I need to push this live stream to Akamai, a CDN provider, and they look at the metadata on the incoming stream to write out the manifests used for Apple HLS and Adobe HDS streams. In my scenario, I'm building playlists with multiple VOD files that stream sequentially over a given stream name, and the first and last clips are bumpers that compress well but have a lower bitrate than the main content. I don't want the manifests generated by Akamai to use the lower bitrate of the first clip, so I need to modify the metadata on the first clip to match that of the main content. This is for a larger scale production, and re-encoding all the clips to match the highest would be a much larger production effort than to just modify the metadata on the bumper content before the stream initiates.

In short, I'd like to know if there's a specific piece of metadata I can edit to override what is typically used by inspectors to show the data rate of a file. Thanks again for any suggestions!
__________________
Robert Reinhardt
videoRx.com
http://linkedin.com/in/adaptivestreaming
videoRx is offline   Reply With Quote
Old 23rd March 2013, 17:41   #4  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,370
But how does Wowza determine that bitrate in the first place? If it is not done via a header value you won't be able to simply adjust it.

From a quick search you may be able to adjust ${SourceVideoBitrate} in the templates?
http://www.wowza.com/forums/content....wza-Transcoder
sneaker_ger is offline   Reply With Quote
Old 23rd March 2013, 18:22   #5  |  Link
videoRx
Robert Reinhardt
 
videoRx's Avatar
 
Join Date: Nov 2012
Location: Bainbridge Island, WA (close to Seattle)
Posts: 9
That's specifically for the transcoder add-on for live streams; I'm only using a stream publisher. I do a lot of Java work with Wowza, so please trust me when I say that it will pass the NetStream.onMetaData() coming out of my publisher (which is FFmpeg-based) on to Akamai. I have confirmed with Wowza engineers that Wowza doesn't do any bitrate calculations that are passed on to the NetStream.onMetaData() callback on a published stream.

Do you know if there's a tool, preferably a CLI, that can adjust the metadata values for bitrate?
__________________
Robert Reinhardt
videoRx.com
http://linkedin.com/in/adaptivestreaming
videoRx is offline   Reply With Quote
Old 23rd March 2013, 18:37   #6  |  Link
SeeMoreDigital
Life looks better in UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,408
Out of interest, what tool are you using to analyse the atom data?
__________________
| 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 offline   Reply With Quote
Old 23rd March 2013, 18:45   #7  |  Link
videoRx
Robert Reinhardt
 
videoRx's Avatar
 
Join Date: Nov 2012
Location: Bainbridge Island, WA (close to Seattle)
Posts: 9
Right now, I'm just using FFprobe to see what's specified on the global and track level, but I don't need to do any atom analysis to push the live streams from the VOD content. This type of manipulation isn't my domain, that's for sure. I've used MP4Box in the past to remux audio tracks and subtitle tracks for my clients that need multilingual streams coming out of Wowza, but I haven't specifically had to manipulate this type of data. As far as I can tell, I just need to know the path to this particular piece of metadata and then I can alter it, and it's awfully difficult finding anything other than ID3 path structures in search queries.
__________________
Robert Reinhardt
videoRx.com
http://linkedin.com/in/adaptivestreaming
videoRx is offline   Reply With Quote
Old 23rd March 2013, 21:01   #8  |  Link
SeeMoreDigital
Life looks better in UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,408
I suppose you've tried something as basic as inserting an image into the .MP4 container, in accordance with the MPEG-4 specification?
__________________
| 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 offline   Reply With Quote
Old 26th March 2013, 02:44   #9  |  Link
videoRx
Robert Reinhardt
 
videoRx's Avatar
 
Join Date: Nov 2012
Location: Bainbridge Island, WA (close to Seattle)
Posts: 9
Looks like I was able to figure out a solution based on FFmpeg alone. It appears that, when FLV is the published format (-f flv) for RTMP live publishing (output is set to an RTMP URL), that you can override the videodatarate and audiodatarate values of the NetStream.client.onMetaData() info object by simply specifying a video bitrate (-b:v) and/or audio bitrate (-b:a) and so long as you're only copying the respective tracks (-c:v copy -c:a copy or -vcodec copy -acodec copy), you can override the published values to an FLV container. Good enough for this problem!

UPDATE: This only works with the latest builds of FFmpeg. I compiled directly from the GIT repository.
__________________
Robert Reinhardt
videoRx.com
http://linkedin.com/in/adaptivestreaming

Last edited by videoRx; 27th March 2013 at 18:45.
videoRx is offline   Reply With Quote
Reply

Tags
bitrate, cli, header, mp4

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 22:54.


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