Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Converting from mp4 using H264 Baseline to MTS for Mobile Devices

    30 octobre 2013, par Alex Tran

    I can encode the file *.mp4 has H264 baseline and Web optimized with HandBrake successfully.

    But I am on stuck with problem :

    Convert the file *.mp4 to the file *.mts.

    Because after converting, the file *.mts lost the encoded and web optimized feature.

    Therefore, I want to ask how to after converting, I can always store the encoded and web optimized in file *.mts.

    P/s:

    I try this guide Converted mp4 h264 baseline format.

    ffmpeg -i input.mp4 -c:v libx264 -profile:v baseline -movflags faststart output.mts
    

    But It shows the error : enter image description here

    I also do :

    ffprobe -show_streams -i input.mp4
    

    And it shows the error: enter image description here

    Please tell me how,

    Really Thanks,

  • Android screen sharing to multiple android devices

    29 octobre 2013, par nick

    Hi i am trying to stream my android device's screen to multiple android devices. so am sending my device's screenshot frequently to all the devices. its works fine. now, is it possible to convert each image into a video using the ffmpeg on the client device? so that it looks like a streaming video of my device screen. am i in a right way? if i am wrong, please suggest me correct way.

  • How to make ffmpeg realy silen without to use another process

    29 octobre 2013, par Dougui

    I'm using ffmpeg in a ruby code like this :

    fork { exec "ffmpeg -f alsa -ac 2 -i pulse -y #{path} -r 22050" }
    

    It sends the pid of the created process. In the trace, I have this :

    Stream mapping:
      Stream #0.0 -> #0.0
    Press ctrl-c to stop encoding
    psize=     832kB time=4.52 bitrate=1507.4kbits/s    6.1kbits/s    its/s    
    size=     963kB time=5.14 bitrate=1536.1kbits/s    
    video:0kB audio:963kB global headers:0kB muxing overhead 0.004664%
    

    I want to make it quiet. I tried to add -loglevel panic and -v 0 but it does not work. I know, I can add this >/dev/null 2>&1 but it create another process and my method send only the pid of the first process.

    Is there a way to make ffmpeg realy silent without to create another process?

  • Need help finding a way to use avconv or ffmpeg to convert any video to an exact size and shape

    29 octobre 2013, par mikecole79

    This is for work. We have a system that supports streaming video, but we support multiple players. I have multiple systems that I COULD use for this. Currently, I've been using the media server that we use to stream the video, which has ffmpeg on it (running Red Hat 4). On that system, I've used:

     ffmpeg -i INPUT_FILE.mp4 -c:v libx264 -crf 23 -maxrate 3000k -bufsize 30000k -c:a aac -strict experimental -b:a 192k -filter:v "scale=iw*min($width/iw\,$height/ih):ih*min($width/iw\,$height/ih), pad=$width:$height:($width-iw*min($width/iw\,$height/ih))/2:($height-ih*min($width/iw\,$height/ih))/2" -f OUTPUT_FILE.mp4
    

    And I thought that it worked well. On one file I used to test, it seemed to display properly on both player types. On a different file, it did not appear properly. The input files are also in varying formats (mostly mp4, with a few m4g files) and different aspect ratios.

    We also have many desktop/laptop machines that are running Ubuntu 13.04 (comes with avconv) that I'd like to be able to use to format video as well. If I can get at least one of these systems to properly format video, that would be great, but ideally I'd like to figure out how to do this with both avconv AND ffmpeg so I can use any system.

    The problem that we're trying to solve is that one player is an Android DMP device, which will play a video of varying sizes properly by adding black bars at the sides or top/bottom as needed to keep the video sized properly. The other player is a Samsung Smart TV, which is SO Smart that it can reformat videos to fit the screen. Which sucks horribly, because if they're not sized to exactly the right format, it will stretch them one direction or another to make them be sized right. The resulting video show's people that appear to be 8 feet tall weighing 130 pounds, or 4 feet tall and 3 feet wide.

    Obviously, this isn't what we desire, but I lack the knowledge of avconv/ffmpeg to do anything to fix it. I need an expert, and I am not he. Nor is anyone I currently work with an expert on this subject. Anyone that is, I'd appreciate your help more than I can express via a web interface.

    Thanks!

  • FFmpeg remux without decode/encode

    29 octobre 2013, par Bolton

    I want to use ffmpeg lib to save rtsp stream to local mp4 file without decode. both the inpout stream and output file use H264+AAC codec. For now I use the following code to read the packet from the input stream and write to the output file.

    ...
    av_write_header(oFmtCtx);
    av_init_packet(&packet);
    int j = 0;
    
    while (av_read_frame(pIFmtCtx, &packet) >= 0 && j < 140/*temp use to get a period of the stream*/)
    {
        //now I only output the audio stream
        if (packet.stream_index == audioStream)
        {
            AVPacket pkt;
            av_init_packet(&pkt);
            pkt.size = packet.size;
            pkt.data = packet.data;
            pkt.dts = AV_NOPTS_VALUE;
            pkt.pts = AV_NOPTS_VALUE;
            pkt.flags |= PKT_FLAG_KEY;
            pkt.stream_index = oStream->index;
            if (av_interleaved_write_frame(oFmtCtx, &pkt) != 0)
            {
                LOGI("Error while writing audio frame\n");
                break;
            }
        }
        j++;
    
    }
    av_write_trailer(oFmtCtx);
    

    The file is generated. and when I open it using VLC, the playback lasts for the right time but no audio is outputed. Any help will be greatly appreciated, Thanks in advance.

    Bolton