Recherche avancée

Médias (91)

Autres articles (98)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (5414)

  • Benefits and Shortcomings of Multi-Touch Attribution

    13 mars 2023, par Erin — Analytics Tips

    Few sales happen instantly. Consumers take their time to discover, evaluate and become convinced to go with your offer. 

    Multi-channel attribution (also known as multi-touch attribution or MTA) helps businesses better understand which marketing tactics impact consumers’ decisions at different stages of their buying journey. Then double down on what’s working to secure more sales. 

    Unlike standard analytics, multi-channel modelling combines data from various channels to determine their cumulative and independent impact on your conversion rates. 

    The main benefit of multi-touch attribution is obvious : See top-performing channels, as well as those involved in assisted conversions. The drawback of multi-touch attribution : It comes with a more complex setup process. 

    If you’re on the fence about getting started with multi-touch attribution, here’s a summary of the main arguments for and against it. 

    What Are the Benefits of Multi-Touch Attribution ?

    Remember an old parable of blind men and an elephant ?

    Each one touched the elephant and drew conclusions about how it might look. The group ended up with different perceptions of the animal and thought the others were lying…until they decided to work together on establishing the truth.

    Multi-channel analytics works in a similar way : It reconciles data from various channels and campaign types into one complete picture. So that you can get aligned on the efficacy of different campaign types and gain some other benefits too. 

    Better Understanding of Customer Journeys 

    On average, it takes 8 interactions with a prospect to generate a conversion. These interactions happen in three stages : 

    • Awareness : You need to introduce your company to the target buyers and pique their interest in your solution (top-of-the-funnel). 
    • Consideration : The next step is to channel this casual interest into deliberate research and evaluation of your offer (middle-of-the-funnel). 
    • Decision : Finally, you need to get the buyer to commit to your offer and close the deal (bottom-of-the-funnel). 

    You can analyse funnels using various attribution models — last-click, fist-click, position-based attribution, etc. Each model, however, will spotlight the different element(s) of your sales funnel. 

    For example, a single-touch attribution model like last-click zooms in on the bottom-of-the-funnel stage. You can evaluate which channels (or on-site elements) sealed the deal for the prospect. For example, a site visitor arrived from an affiliate link and started a free trial. In this case, the affiliate (referral traffic) gets 100% credit for the conversion. 

    This measurement tactic, however, doesn’t show which channels brought the customer to the very bottom of your funnel. For instance, they may have interacted with a social media post, your landing pages or a banner ad before that. 

    Multi-touch attribution modelling takes funnel analysis a notch further. In this case, you map more steps in the customer journey — actions, events, and pages that triggered a visitor’s decision to convert — in your website analytics tool.

    Funnels Report Matomo

    Then, select a multi-touch attribution model, which provides more backward visibility aka allows you to track more than one channel, preceding the conversion. 

    For example, a Position Based attribution model reports back on all interactions a site visitor had between their first visit and conversion. 

    A prospect first lands at your website via search results (Search traffic), which gets a 40% credit in this model. Two days later, the same person discovers a mention of your website on another blog and visits again (Referral traffic). This time, they save the page as a bookmark and revisit it again in two more days (Direct traffic). Each of these channels will get a 10% credit. A week later, the prospect lands again on your site via Twitter (Social) and makes a request for a demo. Social would then receive a 40% credit for this conversion. Last-click would have only credited social media and first-click — search engines. 

    The bottom line : Multi-channel attribution models show how different channels (and marketing tactics) contribute to conversions at different stages of the customer journey. Without it, you get an incomplete picture.

    Improved Budget Allocation 

    Understanding causal relationships between marketing activities and conversion rates can help you optimise your budgets.

    First-click/last-click attribution models emphasise the role of one channel. This can prompt you toward the wrong conclusions. 

    For instance, your Facebook ads campaigns do great according to a first-touch model. So you decide to increase the budget. What you might be missing though is that you could have an even higher conversion rate and revenue if you fix “funnel leaks” — address high drop-off rates during checkout, improve page layout and address other possible reasons for exiting the page.

    Matomo Customisable Goal Funnels
    Funnel reports at Matomo allow you to see how many people proceed to the next conversion stage and investigate why they drop off.

    By knowing when and why people abandon their purchase journey, you can improve your marketing velocity (aka the speed of seeing the campaign results) and your marketing costs (aka the budgets you allocate toward different assets, touchpoints and campaign types). 

    Or as one of the godfathers of marketing technology, Dan McGaw, explained in a webinar :

    “Once you have a multi-touch attribution model, you [can] actually know the return on ad spend on a per-campaign basis. Sometimes, you can get it down to keywords. Sometimes, you can get down to all kinds of other information, but you start to realise, “Oh, this campaign sucks. I should shut this off.” And then really, that’s what it’s about. It’s seeing those campaigns that suck and turning them off and then taking that budget and putting it into the campaigns that are working”.

    More Accurate Measurements 

    The big boon of multi-channel marketing attribution is that you can zoom in on various elements of your funnel and gain granular data on the asset’s performance. 

    In other words : You get more accurate insights into the different elements involved in customer journeys. But for accurate analytics measurements, you must configure accurate tracking. 

    Define your objectives first : How do you want a multi-touch attribution tool to help you ? Multi-channel attribution analysis helps you answer important questions such as :

    • How many touchpoints are involved in the conversions ? 
    • How long does it take for a lead to convert on average ? 
    • When and where do different audience groups convert ? 
    • What is your average win rate for different types of campaigns ?

    Your objectives will dictate which multi-channel modelling approach will work best for your business — as well as the data you’ll need to collect. 

    At the highest level, you need to collect two data points :

    • Conversions : Desired actions from your prospects — a sale, a newsletter subscription, a form submission, etc. Record them as tracked Goals
    • Touchpoints : Specific interactions between your brand and targets — specific page visits, referral traffic from a particular marketing channel, etc. Record them as tracked Events

    Your attribution modelling software will then establish correlation patterns between actions (conversions) and assets (touchpoints), which triggered them. 

    The accuracy of these measurements, however, will depend on the quality of data and the type of attribution modelling used. 

    Data quality stands for your ability to procure accurate, complete and comprehensive information from various touchpoints. For instance, some data won’t be available if the user rejected a cookie consent banner (unless you’re using a privacy-focused web analytics tool like Matomo). 

    Different attribution modelling techniques come with inherent shortcomings too as they don’t accurately represent the average sales cycle length or track visitor-level data, which allows you to understand which customer segments convert best.

    Learn more about selecting the optimal multi-channel attribution model for your business.

    What Are the Limitations of Multi-Touch Attribution ?

    Overall, multi-touch attribution offers a more comprehensive view of the conversion paths. However, each attribution model (except for custom ones) comes with inherent assumptions about the contribution of different channels (e.g,. 25%-25%-25%-25% in linear attribution or 40%-10%-10%-40% in position-based attribution). These conversion credit allocations may not accurately represent the realities of your industry. 

    Also, most attribution models don’t reflect incremental revenue you gain from existing customers, which aren’t converting through analysed channels. For example, account upgrades to a higher tier, triggered via an in-app offer. Or warranty upsell, made via a marketing email. 

    In addition, you should keep in mind several other limitations of multi-touch attribution software.

    Limited Marketing Mix Analysis 

    Multi-touch attribution tools work in conjunction with your website analytics app (as they draw most data from it). Because of that, such models inherit the same visibility into your marketing mix — a combo of tactics you use to influence consumer decisions.

    Multi-touch attribution tools cannot evaluate the impact of :

    • Dark social channels 
    • Word-of-mouth 
    • Offline promotional events
    • TV or out-of-home ad campaigns 

    If you want to incorporate this data into your multi-attribution reporting, you’ll have to procure extra data from other systems — CRM, ad measurement partners, etc, — and create complex custom analytics models for its evaluation.

    Time-Based Constraints 

    Most analytics apps provide a maximum 90-day lookback window for attribution. This can be short for companies with longer sales cycles. 

    Source : Marketing Charts

    Marketing channels can be overlooked or underappreciated when your attribution window is too short. Because of that, you may curtail spending on brand awareness campaigns, which, in turn, will reduce the number of people entering the later stages of your funnel. 

    At the same time, many businesses would also want to track a look-forward window — the revenue you’ll get from one customer over their lifetime. In this case, not all tools may allow you to capture accurate information on repeat conversions — through re-purchases, account tier updates, add-ons, upsells, etc. 

    Again, to get an accurate picture you’ll need to understand how far into the future you should track conversions. Will you only record your first sales as a revenue number or monitor customer lifetime value (CLV) over 3, 6 or 12 months ? 

    The latter is more challenging to do. But CLV data can add another depth of dimension to your modelling accuracy. With Matomo, you set up this type of tracking by using our visitors’ tracking feature. We can help you track select visitors with known identifiers (e.g. name or email address) to discover their visiting patterns over time. 

    Visitor User IDs in Matomo

    Limited Access to Raw Data 

    In web analytics, raw data stands for unprocessed website visitor information, stripped from any filters, segmentation or sampling applied. 

    Data sampling is a practice of analysing data subsets (instead of complete records) to extrapolate findings towards the entire data set. Google Analytics 4 applies data sampling once you hit over 500k sessions at the property level. So instead of accurate, real-life reporting, you receive approximations, generated by machine learning models. Data sampling is one of the main reasons behind Google Analytics’ accuracy issues

    In multi-channel attribution modelling, usage of sampled data creates further inconsistencies between the reports and the actual state of affairs. For instance, if your website generates 5 million page views, GA multi-touch analytical reports are based on the 500K sample size aka only 90% of the collected information. This hardly represents the real effect of all marketing channels and can lead to subpar decision-making. 

    With Matomo, the above is never an issue. We don’t apply data sampling to any websites (no matter the volume of traffic) and generate all the reports, including multi-channel attribution ones, based on 100% real user data. 

    AI Application 

    On the other hand, websites with smaller traffic volumes often have limited sampling datasets for building attribution models. Some tracking data may also be not available because the visitor rejected a cookie banner, for instance. On average, less than 50% of users in Australia, France, Germany, Denmark and the US among other countries always consent to all cookies. 

    To compensate for such scenarios, some multi-touch attribution solutions apply AI algorithms to “fill in the blanks”, which impacts the reporting accuracy. Once again, you get approximate data of what probably happened. However, Matomo is legally exempt from showing a cookie consent banner in most EU markets. Meaning you can collect 100% accurate data to make data-driven decisions.

    Difficult Technical Implementation 

    Ever since attribution modelling got traction in digital marketing, more and more tools started to emerge.

    Most web analytics apps include multi-touch attribution reports. Then there are standalone multi-channel attribution platforms, offering extra features for conversion rate optimization, offline channel tracking, data-driven custom modelling, etc. 

    Most advanced solutions aren’t available out of the box. Instead, you have to install several applications, configure integrations with requested data sources, and then use the provided interfaces to code together custom data models. Such solutions are great if you have a technical marketer or a data science team. But a steep learning curve and high setup costs make them less attractive for smaller teams. 

    Conclusion 

    Multi-touch attribution modelling lifts the curtain in more steps, involved in various customer journeys. By understanding which touchpoints contribute to conversions, you can better plan your campaign types and budget allocations. 

    That said, to benefit from multi-touch attribution modelling, marketers also need to do the preliminary work : Determine the key goals, set up event and conversion tracking, and then — select the optimal attribution model type and tool. 

    Matomo combines simplicity with sophistication. We provide marketers with familiar, intuitive interfaces for setting up conversion tracking across the funnel. Then generate attribution reports, based on 100% accurate data (without any sampling or “guesstimation” applied). You can also get access to raw analytics data to create custom attribution models or plug it into another tool ! 

    Start using accurate, easy-to-use multi-channel attribution with Matomo. Start your free 21-day trial now. No credit card requried. 

  • How to reduce size of moov atom of H.264 movies to improve streaming start for smartphones ?

    12 mars 2023, par Andrey Lebedev

    We run a video service streaming movies to smartphones (iOS&Android).
We are encoding in H.264+AAC and using the mp4 container.
We have a problem that long movies (60 minutes+) take a very long time to
start playing and have tracked this down to the large size of moov
atom for these movies.
For 110 minute movies the atom is as large as 4.2Mb which obviously takes a long
time to download to a smart-phone over 3G !

    



    Is there anyway to make the moov atom smaller ? We can reduce it bit
by dropping the audio sampling rate, but obviously anything below 22kHz
would not really be acceptable.

    



    We are using ffmpeg as the encoder, and MP4Box to move the metadata
to the front of the file. Is there any way to get it to make
a smaller moov ? Any other encoders out there which make a smaller moov ?

    



    For example...

    



    Big size (280 Mb, 1h 49min) streamable mp4 (h.264, AAC) file have a big header size (4.2 Mb). File was encoded by two pass ffmpeg and MP4Box for replacing metadata into beginning of the file :

    



    /usr/bin/ffmpeg -i /var/lib/encoder/incoming/2388 -aspect 320:210 -threads 8 -vcodec libx264 -profile baseline -level 13 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -b:v 270k -maxrate 270k -bufsize 270k -g 30 -passlogfile /tmp/mediaservice/3100/video-IPH.ffmpeg -an -f rawvideo -pass 1 -y /dev/null

/usr/bin/ffmpeg -i /var/lib/encoder/incoming/2388 -aspect 320:210 -threads 8 -vcodec libx264 -profile baseline -level 13 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -b:v 270k -maxrate 270k -bufsize 270k -g 30 -passlogfile /tmp/mediaservice/3100/video-IPH.ffmpeg -acodec libfaac -ac 2 -b:a 32k -ar 44100 -f mp4 -pass 2 -y /var/lib/encoder/encoded/3100/video-IPH.mp4

/usr/bin/MP4Box -quiet -tmp /tmp/mediaservice/3100/ -inter 500 /var/lib/encoder/encoded/3100/video-IPH.mp4


    



    Media info (audio sample rate = 44100) :

    



    General
Count                                    : 278
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Count of audio streams                   : 1
Video_Format_List                        : AVC
Video_Format_WithHint_List               : AVC
Codecs Video                             : AVC
Audio_Format_List                        : AAC
Audio_Format_WithHint_List               : AAC
Audio codecs                             : AAC LC
Complete name                            : 1348645218_970458_2465.iph.mp4
File name                                : 1348645218_970458_2465.iph.mp4
File extension                           : mp4
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
Commercial name                          : MPEG-4
Format profile                           : Base Media
Internet media type                      : video/mp4
Codec ID                                 : isom
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
Codec                                    : MPEG-4
Codec                                    : MPEG-4
Codec/Extensions usually used            : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
File size                                : 272703970
File size                                : 260 MiB
File size                                : 260 MiB
File size                                : 260 MiB
File size                                : 260 MiB
File size                                : 260.1 MiB
Duration                                 : 6556027
Duration                                 : 1h 49mn
Duration                                 : 1h 49mn 16s 27ms
Duration                                 : 1h 49mn
Duration                                 : 01:49:16.027
Overall bit rate                         : 332767
Overall bit rate                         : 333 Kbps
Stream size                              : 4230761
Stream size                              : 4.03 MiB (2%)
Stream size                              : 4 MiB
Stream size                              : 4.0 MiB
Stream size                              : 4.03 MiB
Stream size                              : 4.035 MiB
Stream size                              : 4.03 MiB (2%)
Proportion of this stream                : 0.01551
HeaderSize                               : 4230683
DataSize                                 : 268473217
FooterSize                               : 70
IsStreamable                             : Yes
File last modification date              : UTC 2012-09-26 12:38:19
File last modification date (local)      : 2012-09-26 21:38:19
Writing application                      : Lavf54.6.100

Video
Count                                    : 201
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
ID                                       : 1
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format/Url                               : http://developers.videolan.org/x264.html
Commercial name                          : AVC
Format profile                           : Baseline@L1.3
Format settings                          : 5 Ref Frames
Format settings, CABAC                   : No
Format settings, CABAC                   : No
Format settings, ReFrames                : 5
Format settings, ReFrames                : 5 frames
Format settings, GOP                     : M=1, N=30
Internet media type                      : video/H264
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
Codec                                    : AVC
Codec                                    : AVC
Codec/Family                             : AVC
Codec/Info                               : Advanced Video Codec
Codec/Url                                : http://developers.videolan.org/x264.html
Codec/CC                                 : avc1
Codec profile                            : Baseline@L1.3
Codec settings                           : 5 Ref Frames
Codec settings, CABAC                    : No
Codec_Settings_RefFrames                 : 5
Duration                                 : 6556017
Duration                                 : 01:49:16.017
Bit rate                                 : 270000
Bit rate                                 : 270 Kbps
Width                                    : 480
Width                                    : 480 pixels
Height                                   : 270
Height                                   : 270 pixels
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.778
Display aspect ratio                     : 16:9
Rotation                                 : 0.000
Frame rate mode                          : CFR
Frame rate mode                          : Constant
FrameRate_Mode_Original                  : VFR
Frame rate                               : 29.970
Frame rate                               : 29.970 fps
Frame count                              : 196484
Resolution                               : 8
Resolution                               : 8 bits
Colorimetry                              : 4:2:0
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan type                                : Progressive
Interlacement                            : PPF
Interlacement                            : Progressive
Bits/(Pixel*Frame)                       : 0.070
Stream size                              : 220159060
Stream size                              : 210 MiB (81%)
Stream size                              : 210 MiB
Stream size                              : 210 MiB
Stream size                              : 210 MiB
Stream size                              : 210.0 MiB
Stream size                              : 210 MiB (81%)
Proportion of this stream                : 0.80732
Writing library                          : x264 - core 125
Writing library                          : x264 core 125
Writing library/Name                     : x264
Writing library/Version                  : core 125
Encoding settings                        : cabac=0 / ref=5 / deblock=1:0:0 / analyse=0x1:0x131 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=30 / keyint_min=16 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=2pass / mbtree=1 / bitrate=270 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=270 / vbv_bufsize=270 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
Tagged date                              : UTC 2012-09-25 07:21:37

Audio
Count                                    : 169
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
ID                                       : 2
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Commercial name                          : AAC
Format profile                           : LC
Codec ID                                 : 40
Codec                                    : AAC LC
Codec                                    : AAC LC
Codec/Family                             : AAC
Codec/CC                                 : 40
Duration                                 : 6556027
Duration                                 : 1h 49mn
Duration                                 : 1h 49mn 16s 27ms
Duration                                 : 1h 49mn
Duration                                 : 01:49:16.027
Bit rate mode                            : VBR
Bit rate mode                            : Variable
Bit rate                                 : 58955
Bit rate                                 : 59.0 Kbps
Maximum bit rate                         : 270000
Maximum bit rate                         : 270 Kbps
Channel(s)                               : 2
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Channel positions                        : 2/0/0
Sampling rate                            : 44100
Sampling rate                            : 44.1 KHz
Samples count                            : 289120791
Compression mode                         : Lossy
Compression mode                         : Lossy
Stream size                              : 48314149
Stream size                              : 46.1 MiB (18%)
Stream size                              : 46 MiB
Stream size                              : 46 MiB
Stream size                              : 46.1 MiB
Stream size                              : 46.08 MiB
Stream size                              : 46.1 MiB (18%)
Proportion of this stream                : 0.17717
Tagged date                              : UTC 2012-09-25 07:21:37


    



    Moov atom info (/moov/trak[0] - video, /moov/trak[1] - audio) sample rate 44100 :
(look stsz and stts nodes in trak)

    



    Atom ftyp @ 0 of size: 32, ends @ 32
Atom moov @ 32 of size: 4230651, ends @ 4230683
     Atom mvhd @ 40 of size: 108, ends @ 148
     Atom trak @ 148 of size: 868970, ends @ 869118
         Atom tkhd @ 156 of size: 92, ends @ 248
         Atom edts @ 248 of size: 36, ends @ 284
             Atom elst @ 256 of size: 28, ends @ 284
         Atom mdia @ 284 of size: 868834, ends @ 869118
             Atom mdhd @ 292 of size: 32, ends @ 324
             Atom hdlr @ 324 of size: 45, ends @ 369
             Atom minf @ 369 of size: 868749, ends @ 869118
                 Atom vmhd @ 377 of size: 20, ends @ 397
                 Atom dinf @ 397 of size: 36, ends @ 433
                     Atom dref @ 405 of size: 28, ends @ 433
                 Atom stbl @ 433 of size: 868685, ends @ 869118
                     Atom stsd @ 441 of size: 149, ends @ 590
                         Atom avc1 @ 457 of size: 133, ends @ 590
                             Atom avcC @ 543 of size: 47, ends @ 590
                     Atom stts @ 590 of size: 24, ends @ 614
                     Atom stss @ 614 of size: 26340, ends @ 26954
                     Atom stsc @ 26954 of size: 52, ends @ 27006
                     Atom stsz @ 27006 of size: 785956, ends @ 812962
                     Atom stco @ 812962 of size: 56156, ends @ 869118
     Atom trak @ 869118 of size: 3361468, ends @ 4230586
         Atom tkhd @ 869126 of size: 92, ends @ 869218
         Atom edts @ 869218 of size: 36, ends @ 869254
             Atom elst @ 869226 of size: 28, ends @ 869254
         Atom mdia @ 869254 of size: 3361332, ends @ 4230586
             Atom mdhd @ 869262 of size: 32, ends @ 869294
             Atom hdlr @ 869294 of size: 45, ends @ 869339
             Atom minf @ 869339 of size: 3361247, ends @ 4230586
                 Atom smhd @ 869347 of size: 16, ends @ 869363
                 Atom dinf @ 869363 of size: 36, ends @ 869399
                     Atom dref @ 869371 of size: 28, ends @ 869399
                 Atom stbl @ 869399 of size: 3361187, ends @ 4230586
                     Atom stsd @ 869407 of size: 91, ends @ 869498
                         Atom mp4a @ 869423 of size: 75, ends @ 869498
                             Atom esds @ 869459 of size: 39, ends @ 869498
                     **Atom stts @ 869498 of size: 2135816, ends @ 3005314**
                     Atom stsc @ 3005314 of size: 39712, ends @ 3045026
                     **Atom stsz @ 3045026 of size: 1129400, ends @ 4174426**
                     Atom stco @ 4174426 of size: 56160, ends @ 4230586
     Atom udta @ 4230586 of size: 97, ends @ 4230683
         Atom meta @ 4230594 of size: 89, ends @ 4230683
             Atom hdlr @ 4230606 of size: 33, ends @ 4230639
             Atom ilst @ 4230639 of size: 44, ends @ 4230683
                 Atom ©too @ 4230647 of size: 36, ends @ 4230683
                     Atom data @ 4230655 of size: 28, ends @ 4230683
Atom mdat @ 4230683 of size: 268473217, ends @ 272703900
Atom free @ 272703900 of size: 8, ends @ 272703908
Atom free @ 272703908 of size: 62, ends @ 272703970
------------------------------------------------------
Total size: 272703970 bytes; 50 atoms total. AtomicParsley version: 0.9.0 (utf8)
Media data: 268473217 bytes; 4230753 bytes all other atoms (1.551% atom overhead).
Total free atom space: 70 bytes; 0.000% waste. Padding available: 0 bytes.
------------------------------------------------------


    



    After reencoding this movie with audio sample rate 11025 header size much less :

    



    Media info (audio sample rate = 11025) : (crop duplicate info)

    



    General
***
HeaderSize                               : 1276359

Video
***

Audio
Count                                    : 169
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
ID                                       : 2
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Commercial name                          : AAC
Format profile                           : LC
Codec ID                                 : 40
Codec                                    : AAC LC
Codec                                    : AAC LC
Codec/Family                             : AAC
Codec/CC                                 : 40
Duration                                 : 6556132
Duration                                 : 1h 49mn
Duration                                 : 1h 49mn 16s 132ms
Duration                                 : 1h 49mn
Duration                                 : 01:49:16.132
Bit rate mode                            : VBR
Bit rate mode                            : Variable
Bit rate                                 : 37991
Bit rate                                 : 38.0 Kbps
Maximum bit rate                         : 128000
Maximum bit rate                         : 128 Kbps
Channel(s)                               : 2
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Channel positions                        : 2/0/0
Sampling rate                            : 11025
Sampling rate                            : 11.025 KHz
Samples count                            : 72281355
Compression mode                         : Lossy
Compression mode                         : Lossy
Stream size                              : 31134257
Stream size                              : 29.7 MiB (12%)
Stream size                              : 30 MiB
Stream size                              : 30 MiB
Stream size                              : 29.7 MiB
Stream size                              : 29.69 MiB
Stream size                              : 29.7 MiB (12%)
Proportion of this stream                : 0.12327
Tagged date                              : UTC 2012-09-25 13:20:28


    



    Moov atom info (/moov/trak[0] - video, /moov/trak[1] - audio) sample rate 11025 :

    



    Atom ftyp @ 0 of size: 32, ends @ 32
Atom moov @ 32 of size: 1276327, ends @ 1276359
     Atom mvhd @ 40 of size: 108, ends @ 148
     Atom trak @ 148 of size: 821662, ends @ 821810
         Atom tkhd @ 156 of size: 92, ends @ 248
         Atom edts @ 248 of size: 36, ends @ 284
             Atom elst @ 256 of size: 28, ends @ 284
         Atom mdia @ 284 of size: 821526, ends @ 821810
             Atom mdhd @ 292 of size: 32, ends @ 324
             Atom hdlr @ 324 of size: 45, ends @ 369
             Atom minf @ 369 of size: 821441, ends @ 821810
                 Atom vmhd @ 377 of size: 20, ends @ 397
                 Atom dinf @ 397 of size: 36, ends @ 433
                     Atom dref @ 405 of size: 28, ends @ 433
                 Atom stbl @ 433 of size: 821377, ends @ 821810
                     Atom stsd @ 441 of size: 149, ends @ 590
                         Atom avc1 @ 457 of size: 133, ends @ 590
                             Atom avcC @ 543 of size: 47, ends @ 590
                     Atom stts @ 590 of size: 24, ends @ 614
                     Atom stss @ 614 of size: 26340, ends @ 26954
                     Atom stsc @ 26954 of size: 52, ends @ 27006
                     Atom stsz @ 27006 of size: 785956, ends @ 812962
                     Atom stco @ 812962 of size: 8848, ends @ 821810
     Atom trak @ 821810 of size: 454452, ends @ 1276262
         Atom tkhd @ 821818 of size: 92, ends @ 821910
         Atom edts @ 821910 of size: 36, ends @ 821946
             Atom elst @ 821918 of size: 28, ends @ 821946
         Atom mdia @ 821946 of size: 454316, ends @ 1276262
             Atom mdhd @ 821954 of size: 32, ends @ 821986
             Atom hdlr @ 821986 of size: 45, ends @ 822031
             Atom minf @ 822031 of size: 454231, ends @ 1276262
                 Atom smhd @ 822039 of size: 16, ends @ 822055
                 Atom dinf @ 822055 of size: 36, ends @ 822091
                     Atom dref @ 822063 of size: 28, ends @ 822091
                 Atom stbl @ 822091 of size: 454171, ends @ 1276262
                     Atom stsd @ 822099 of size: 91, ends @ 822190
                         Atom mp4a @ 822115 of size: 75, ends @ 822190
                             Atom esds @ 822151 of size: 39, ends @ 822190
                     Atom stts @ 822190 of size: 161368, ends @ 983558
                     Atom stsc @ 983558 of size: 1480, ends @ 985038
                     Atom stsz @ 985038 of size: 282372, ends @ 1267410
                     Atom stco @ 1267410 of size: 8852, ends @ 1276262
     Atom udta @ 1276262 of size: 97, ends @ 1276359
         Atom meta @ 1276270 of size: 89, ends @ 1276359
             Atom hdlr @ 1276282 of size: 33, ends @ 1276315
             Atom ilst @ 1276315 of size: 44, ends @ 1276359
                 Atom ©too @ 1276323 of size: 36, ends @ 1276359
                     Atom data @ 1276331 of size: 28, ends @ 1276359
Atom mdat @ 1276359 of size: 251293325, ends @ 252569684
Atom free @ 252569684 of size: 8, ends @ 252569692
Atom free @ 252569692 of size: 62, ends @ 252569754
------------------------------------------------------
Total size: 252569754 bytes; 50 atoms total. AtomicParsley version: 0.9.0 (utf8)
Media data: 251293325 bytes; 1276429 bytes all other atoms (0.505% atom overhead).
Total free atom space: 70 bytes; 0.000% waste. Padding available: 0 bytes.
------------------------------------------------------


    



    On slow connection this movie start playing after 30-40 seconds until header info (4.2 Mb) downloading. I need that movie start playing fast as it possible. And i have next questions :

    



      

    1. How reduce size of movie header ?

    2. 


    3. How reduce size of
/moov[0]/trak[1]/mdia[0]/minf[0]/stbl[0] and why it so big when
sample rate 44100 ?

    4. 


    


  • Decode a proprietary H264 network video stream

    10 mars 2023, par al_mukthar

    I have incoming byte streams probably encoded in H264 from a RTSP camera through a websocket in my spring boot application,

    


    I need to decode the incoming H264 streams to transmit the video to my frontend clients.
I have tried using javaCV/FFMpeg but nothing works.

    


    Any help would be appreciated

    


    this is the part of hex dump received through socket

    


    00000000: 01 00 00 00 04 48 32 36 34 00 00 00 24 38 65 34    .....H264...$8e4
00000010: 32 39 65 37 61 2D 32 66 34 66 2D 34 37 31 61 2D    29e7a-2f4f-471a-
00000020: 39 61 63 30 2D 66 66 62 38 64 64 37 63 37 64 37    9ac0-ffb8dd7c7d7
00000030: 32 00 00 00 D4 7B 22 49 73 49 6E 69 74 22 3A 66    2...T{"IsInit":f
00000040: 61 6C 73 65 2C 22 49 73 41 75 64 69 6F 22 3A 66    alse,"IsAudio":f
00000050: 61 6C 73 65 2C 22 54 6F 74 61 6C 53 65 63 6F 6E    alse,"TotalSecon
00000060: 64 73 22 3A 30 2E 30 36 2C 22 46 72 61 6D 65 54    ds":0.06,"FrameT
00000070: 69 6D 65 22 3A 22 32 30 32 33 2D 30 32 2D 32 33    ime":"2023-02-23
00000080: 54 30 34 3A 32 31 3A 35 33 2E 35 33 31 5A 22 2C    T04:21:53.531Z",
00000090: 22 53 65 71 75 65 6E 63 65 49 64 22 3A 31 2C 22    "SequenceId":1,"
000000a0: 42 61 73 65 44 65 63 6F 64 65 54 69 6D 65 22 3A    BaseDecodeTime":
000000b0: 32 36 35 38 37 2C 22 4D 65 64 69 61 54 69 6D 65    26587,"MediaTime
000000c0: 22 3A 32 36 35 38 37 2C 22 49 73 46 72 61 6D 65    ":26587,"IsFrame
000000d0: 48 69 64 64 65 6E 22 3A 66 61 6C 73 65 2C 22 49    Hidden":false,"I
000000e0: 73 4B 65 79 46 72 61 6D 65 22 3A 66 61 6C 73 65    sKeyFrame":false
000000f0: 2C 22 49 64 22 3A 34 34 35 2C 22 47 65 6E 65 72    ,"Id":445,"Gener
00000100: 61 74 69 6F 6E 22 3A 31 7D 00 00 3F 50 00 00 00    ation":1}..?P...
00000110: 68 6D 6F 6F 66 00 00 00 10 6D 66 68 64 00 00 00    hmoof....mfhd...
00000120: 00 00 00 01 BD 00 00 00 50 74 72 61 66 00 00 00    ....=...Ptraf...
00000130: 10 74 66 68 64 00 02 00 00 00 00 00 01 00 00 00    .tfhd...........
00000140: 14 74 66 64 74 01 00 00 00 00 00 00 00 00 00 67    .tfdt..........g
00000150: DB 00 00 00 24 74 72 75 6E 01 00 0F 01 00 00 00    [...$trun.......
00000160: 01 00 00 00 70 00 00 00 3C 00 00 3E E0 00 01 00    ....p...<..>`...
00000170: 00 00 00 00 00 00 00 3E E8 6D 64 61 74 00 00 3E    .......>hmdat..>
00000180: DC 41 E1 81 80 93 BE 16 2B 33 77 3D 4C B6 55 8B    \Aa...>.+3w=L6U.
00000190: D2 55 60 92 05 F7 F7 A4 97 54 4B 6C A6 68 48 84    RU`..ww$.TKl&hH.
000001a0: 68 FF D2 B6 6C 02 31 FC 24 01 78 EA BD 20 AD 15    h.R6l.1|$.xj=.-.
000001b0: F1 73 31 4B EB EF 18 1B 50 B3 13 F2 DC C6 4C E1    qs1Kko..P3.r\FLa
000001c0: 75 8B 94 52 6B C5 09 37 55 1E 45 66 6A 92 39 23    u..RkE.7U.Efj.9#
000001d0: C9 2D FD BB EC AD FD CF C4 30 75 FF 44 66 FA 85    I-};l-}OD0u.Dfz.
000001e0: D9 7C 18 72 AE 63 45 60 DD D7 65 44 84 49 95 8D    Y|.r.cE`]WeD.I..
000001f0: 2C 70 6C 57 8E E9 A9 EB B6 F6 78 BD D6 88 99 F6    ,plW.i)k6vx=V..v
00000200: FC 25 B1 0A FF DF CB 77 6A 67 37 24 A5 3D 8F A1    |%1.._Kwjg7$%=.!
00000210: 27 9B 4F 42 0E CD B8 87 6E C9 99 FC 6F 4C 53 4B    '.OB.M8.nI.|oLSK
00000220: 01 EA B6 AF 99 F8 22 C1 8F 1E C1 66 D6 8A 09 D6    .j6/.x"A..AfV..V
00000230: 99 79 91 F7 C1 2A 08 1F 81 CB 5E DD C3 CA 86 8F    .y.wA*...K^]CJ..
00000240: 57 BF 17 A2 64 6B 69 56 AE 19 1F 57 AD A6 D8 C2    W?."dkiV...W-&XB
00000250: 06 28 EB 46 D3 E4 85 51 3E E2 A5 40 50 50 85 7D    .(kFSd.Q>b%@PP.}
00000260: 72 6B 20 87 1A 6E 73 E1 B8 88 9E 20 23 48 6D FE    rk...nsa8...#Hm~
00000270: C2 0D 39 ED 24 B2 6D B5 9B 81 B6 BC F4 EE DE A2    B.9m$2m5..6..bB.{"&.!4.R^5
000002b0: 2A A6 E2 71 D7 4F 96 0A EC AE 8D 39 27 B8 CF 61    *&bqWO..l..9'8Oa
000002c0: CC ED E9 AF 74 C3 95 D3 E3 96 32 20 E6 31 0B E4    Lmi/tC.Sc.2.f1.d
000002d0: DC F4 FF 41 37 36 E7 DB 87 AE B3 7D BF CA F8 05    \t.A76g[..3}?Jx.
000002e0: 72 2A 38 AB B8 8E 98 43 97 C8 5E 80 57 C6 E7 1E    r*8+8..C.H^.WFg.
000002f0: 86 75 CE CD CE BF CF 10 C9 8A C2 C9 6E 33 41 AC    .uNMN?O.I.BIn3A,
00000300: 91 AC A8 F3 1B E6 D5 0A 22 A1 2C 4C 68 19 51 4D    .,(s.fU."!,Lh.QM
00000310: 17 DA AE E1 D7 BC 0E 2D F8 14 61 E2 4F BA 26 A3    .Z.aW<.-x.abO:&#
00000320: 0A E4 A6 BE 08 EA 3C 28 E6 C5 6B CA 3A 86 D2 59    .d&>.j<(fEkJ:.RY
00000330: 34 C2 ED 91 72 5A EF 2C BE D7 38 A4 60 D7 F3 97    4Bm.rZo,>W8$`Ws.
00000340: BB E6 FD C2 D0 29 10 B5 A4 79 D8 3E 61 48 8A F9    ;f}BP).5$yX>aH.y
00000350: C6 D8 13 D0 FD DB D6 FA 24 7F CD 5A BF 06 57 49    FX.P}[Vz$.MZ?.WI
00000360: 51 EC ED B2 74 AB 92 1D 37 68 70 A2 A5 31 B5 5F    Qlm2t+..7hp"%15_
00000370: EA CF 9E 3E 6A B1 78 16 B7 94 D1 46 7B 63 C1 67    jO.>j1x.7.QF{cAg
00000380: D2 B0 08 44 64 1E 68 15 39 80 E3 DD EB C0 E1 71    R0.Dd.h.9.c]k@aq
00000390: E8 EE D0 4D DF 4F 41 E0 96 C5 34 AD BC D3 9E 88    hnPM_OA`.E4-'.7pV%_>.T..
00000430: 7F FC AD 71 CE AF 54 8B 5D DC 27 34 20 A3 0A 73    .|-qN/T.]\'4.#.s
00000440: 76 A5 81 33 22 31 56 6B 1D 82 C4 32 FB 82 15 F6    v%.3"1Vk..D2{..v
00000450: 97 C8 47 29 3C 9E 59 9A C0 83 48 A0 55 CB C8 D6    .HG)<.Y.@.H.UKHV
00000460: 36 92 CC 54 A7 00 E3 28 9E 99 45 B2 E5 7E 88 A7    6.LT'.c(..E2e~.'
00000470: 28 4E CA 75 17 3C D3 B5 6C F5 FD AC 05 55 BF F7    (NJu.?{.T2Yr.h.wYGw
000004d0: 3C 19 C8 7B 81 9B 17 19 E9 81 A0 36 AD C6 62 71    <.H{....i..6-Fbq
000004e0: DB 68 72 8F 6A 37 45 D9 0E 6E DC 2C 5E 52 C2 75    [hr.j7EY.n\,^RBu
000004f0: 51 2F F9 CE 8A 10 12 E9 C8 68 A9 D6 A6 D7 5B 14    Q/yN...iHh)V&W[.
00000500: 11 51 42 FD BE B5 09 56 7F 19 C3 EB A7 A6 DF 6C    .QB}>5.V..Ck'&_l
00000510: 55 A3 11 DC EF 81 C3 CD DD 63 BF 38 F8 5A 4A 45    U#.\o.CM]c?8xZJE
00000520: 33 24 7B A4 55 B3 85 A6 87 75 3B 85 51 5C 03 B7    3${$U3.&.u;.Q\.7


    


    UPDATE TO THE CODE

    


    1st Packet find here
2nd Packet find here

    


    I have updated the code as per one of the comment to read only MDAT box to retrieve H264 stream from the incoming bytes[] through the socket, now I send only MDAT box contents (next byte after MDAT box)

    


    public Map.Entry> hasMdat(byte[] byteArray) {
    for (int i = 0; i < byteArray.length - 3; i++) {
        if (byteArray[i] == (byte) 109 &&
                byteArray[i + 1] == (byte) 100 &&
                byteArray[i + 2] == (byte) 97 &&
                byteArray[i + 3] == (byte) 116) {

            return Map.entry(true, Arrays.asList(i, i + 1, i + 2, i + 3));
        }
    }
    return Map.entry(false, List.of(0));
}


    


    This is my code which handles the byte stream

    


    initSocketConnection(new VideoStreamCallback() {
        @Override
        public void onVideoStreamReceived(byte[] bytes) {
           
Map.Entry> b = hasMdat(bytes);
        if (b.getKey()) {
            byte[] b1 = Arrays.copyOfRange(bytes, b.getValue().get(3) + 1, bytes.length);
  //write b1 back to client using spring SSE
            
        }

        }
    });