Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • How to access MP4 tfhd headers

    31 juillet 2017, par Ariana

    This is a follow-up question from my previous question here. It looks like our video processing software assumes there is sample_duration flag (it is set to 1).

    So my question is how to access the default_sample_duration field in the tfhd as shown below?

    Let's assume I'm in the traf_box, and I need to just access the Default_sample_duration (I already found the flag is located in the tfhd_flags & 0x8 from here). I just need to add a function in C++ to extract the value of this field:

    enter image description here

    void get_traf_box_index(FILE* inputFile, uint32_t traf_size, vector >& moof_sample_details, vector >& moof_sample_durations, vector& truns_sample_counts, uint32_t& base_media_decode_time) {
        uint32_t read_size = 0;
        while(read_size < (traf_size - 8)) {
            uint32_t box_size = read_box_size(inputFile);
            read_size += 4;
    
            uint32_t box_type = read_box_type(inputFile);
            read_size += 4;
    
            switch (box_type) {
                case TRUN_BOX_TYPE: 
    
                    get_trun_box_index(inputFile, truns_sample_counts, moof_sample_details, moof_sample_durations);
                    read_size += (box_size-8);
                    moof_trun_count++;
                    break;
    
                case TFDT_BOX_TYPE: 
                    get_tfdt_box_index(inputFile, base_media_decode_time);
                    read_size += (box_size-8);
                    break;
    
                    //TODO add tfhd
                //case TFHD_BOX_TYPE:
    
                default:
                    read_size += skip_n_bypes(inputFile, (box_size-8));
                    break;      
            }
        }
    }
    
  • How to use avcodec_register() in C++ program

    31 juillet 2017, par Michael Ivanov

    I don't want to register all the codecs with avcodec_register_all(); I want to register one specific codec. Strangly, I cannot find any working example that shows how to use avcodec_register() . Most of the examples I found suggest something like this:

    extern AVCodec ff_h264_decoder;
    
    avcodec_register(&ff_h264_decoder);
    

    But I am getting

    unresolved external symbol

    Error from the linker. I tried to wrap the struct with extern "C" , but still the same.Do I need to link h264 lib to access those structs?

  • Efficient low latency stream forwarding in intel atom

    31 juillet 2017, par Sönke Felsing

    I have a certain problem in forwarding a stream from a web camera to my local network.

    My Network camera provides a RTP video stream 720p24 to NIC1 of my Gateway PC (Intel Atom, 1.8GHz , Ubuntu 16.04). Now I would like to forward this stream to all PCs (Intel i5, i7,...) which are connected to NIC2 of the Gateway PC.

    I tested already some stuff with ffmpeg and VLC. VLC does not even run the Video on the Atom due to Hardware limitatons and ffmpeg is just capable of 1-2fps at 480p, but ffserver works fine. MPlayer at least Shows the Video in all its beauty but does not support Streaming unfortunately.

    Does anybody know a well performing way to get access to the stream of the camera through the Gateway PC without directly connecting the two Networks? Due to the fact that we would like to make some remote operations there may not be introduced any further latency for buffering, transcoding, ...

    If the Solutions uses multicast I would be happy.

    I really look forward to your responses!

  • Casting a mp2t stream to Chromecast

    31 juillet 2017, par Tiago Ferreira

    I'm developing a project where I receive data from an external mp2t stream in a node.js app and I'm trying to cast it to a chromecast device using the castv2-client package setting the contentType attribute to "video/mp2t" but it's not working.

    If I convert the stream to an mp4 file using ffmpeg I can cast the video, but it stutters a lot given the fact that on each chunk of video received, it has to convert it.

    Is there any way I can cast the mp2t video directly as I receive it?

  • How to adjust the background music volume according to the main audio volume ?

    31 juillet 2017, par harishkumar329

    I am using the following ffmpeg "amerge" command to mix two audio files,

    ffmpeg -i voice.mp3 -i music.mp3 -filter_complex "[0:a]volume=1dB[a0];[1:a]volume=0.5[a1];[a0][a1]amerge=inputs=2[a]" -map "[a]" -strict -2 -y output.mp3

    voice.mp3 file also includes the silences in the middle of the audio, the positions of silence is completely dynamic.

    Currently, the voice volume is set as 1db and the music volume is set as 0.5. Because of this when there is no voice, the audio volume sounds low, if I increase the background music volume, it will spoil the voice clarity.

    Is there a way where the volume for the voice and music gets adjusted dynamically while mixing using "ffmpeg" or any such tool?

    I know that it is possible by writing the code to separate silence and voice and mix individually with the music and then merge everything together, in that method getting the music flow without any jerks is difficult, also it requires a lot of coding and testing.