Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8892503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:00:56+00:00 2026-06-14T23:00:56+00:00

Take the following code: m_h264Settings = new H264VideoStreamSettings(); <some configuration in between> m_ns.videoStreamSettings =

  • 0

Take the following code:

m_h264Settings = new H264VideoStreamSettings();
<some configuration in between>
m_ns.videoStreamSettings = m_h264Settings;

What’s a decent way to toggle whether m_ns’s videoStreamSettings are still using H264 or not?

I tried looking up the property videoStreamSettings in the primary documentation for NetStreams (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html), and Adobe apparently skipped that little detail. I know how to effectively control whether the NetStream uses H264 or “the default” throughout the whole execution of the application, but I want to be able to keep clicking a button to make it switch back and forth, without replacing the NetStream or doing anything else crazy like that.

How is this properly done? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:00:58+00:00Added an answer on June 14, 2026 at 11:00 pm

    Reading your question it appears as though there are a couple of questions your asking plus a little more clarification would be helpful so I will make some assumptions to try and answer:

    Question 1:

    What’s a decent way to toggle whether m_ns’s videoStreamSettings are
    still using H264 or not?

    By default do you mean using the On2 VP6 video codec and therefore publishing to the FLV format as opposed to F4V?

    I presume your query is related to a connecting application which is playing back the published stream? You could obviously use variable to track which settings you applied to the stream within the recording application itself otherwise.

    I will run with the assumption you have a separate application that is ingesting the published stream and your simply trying to determine whether the stream is published using H264 and not On2 VP6. Firstly the file type will differ, one will be FLV and one will be F4V. Secondly you can take advantage of assigning metadata to the stream when you publish:

    protected function sendMetadata():void {
        var metaData:Object = new Object();
        metaData.codec = stream.videoStreamSettings.codec;
        metaData.profile = m_h264Settings.profile;
        metaData.level = m_h264Settings.level;
        metaData.hasMetadata = true;
        stream.send("@setDataFrame", "onMetaData", metaData);
    }  
    

    In your playback application you can then use the onMetaData() callback to grab the information you require:

    public function onMetaData(infoObject:Object):void {}
    

    Question 2:

    I want to be able to keep clicking a button to make it switch back and
    forth, without replacing the NetStream or doing anything else crazy
    like that.

    I would recommend a reconnection routine on toggling your settings to unpublish the existing stream and re-connect the camera and publish a new stream with the different video settings. This would maintain the integrity of the stream and to be honest, un-publishing and re-publishing a stream is not all that crazy as you say.

    If you must go down the route of toggling settings then my assumption above on what you declare as default would prevent changing file formats on an already publishing stream.

    I personally wouldn’t use the same codec and apply different
    H264VideoStreamSettings mid-publish of a stream. H264VideoStreamSettings are only validated on adding the camera to the stream and applied once compression has started. It is my understanding the compression starts on publishing of the stream so to toggle as you suggest your are going to be messing around with compression on an already publishing stream. The resulting stream would result in too many fluctuations in my opinion and I struggle to see why this would be necessary. However, I may stand to be corrected or it may be for testing purposes.

    This is completely untested but you could create the camera instance, apply your videoStreamSettings, attach the camera to your stream instance and then publish. Whilst it is publishing to switch the settings you could detach your camera instance from the net stream:

    stream.attachCamera(null);
    

    And then simply create a new instance of the camera, apply the new videoStreamSettings and finally attach it to the already published stream.

    I typically send the metadata when the status event “NetStream.Publish.Start” has been received. You would have to modify this and re-send every time you re-attach the camera to the stream, so long as the stream is publishing. I do not know what the implications of this would be though, but your connected player should receive the callback on metadata changes hopefully.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take the following code snippet: SPAttachmentCollection attachments = item.Attachments ; What exactly is SPAttachmentCollection
Take the following code: <abbr title=World Health Organization>WHO</abbr> Can we style an abbr tag's
Take the following code: public static string ReverseIt(string myString) { char[] foo = myString.ToCharArray();
Okay so i have a semi weridish problem with re.sub. Take the following code:
Take the following C code as an example: char buffer1[5]; int* ret; printf(Buffer1 is:
Take the following lines of code that would work fine in a c# asp.net
Take a look that the following code snippet: A a = null try {
I have the following code to take an image and generate the thumbnail. how
I have the following code to take screenshots of a window: HDC WinDC; HDC
I have the following code to take a screenshot of a window, and get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.