Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • raw data to ts conversion using FFMPEG API's

    3 décembre 2014, par user3663917

    I am new to FFMPEG and was trying to convert a YUV data obtained from camera to a .ts file using FFMPEG. I used the command line tools and the conversion is working properly.Now i was trying to use FFMPEG API's for this conversion other than using command line arguments. Is there some good documentation showing this ?

  • How do I remux/transcode a progressive file in ffmpeg ?

    3 décembre 2014, par Levi Roberts

    Here's what I'm trying to do.

    My primary objective is to remux or transcode a currently downloading media file for AppleTV and iOS compatible streaming.

    I am doing this by looking at the media file and only transcoding when necessary, otherwise it will only alter the container the video/audio lives in. This will reduce overhead for files that are already compatible. The specific compatible output I am looking for is AppleTV3 and iOS.

    I have a file that is progressive, meaning that it is downloading using another download manager or another app without the help of nodejs. This file may or may not have the moov information available in the beginning of the file. It just so happens, that I believe my test file does.

    I have some code that is partially working and it would make sense to be able to get this code fully working. That said, I'm not dismissing alternative ways to do this.

    My primary problem (I think) has to do with the moov header location or that it's being set incorrectly. I'm hoping the fix is as simple as correcting my poor ffmpeg knowledge with command line parameters.

    I am piping the file to and from ffmpeg via GrowingFile and fs.createWriteStream respectively.


    My code for doing so is:

    var fs = require('fs');
    var child = require('child_process');
    
    var GrowingFile = require('growing-file');
    var input_file = GrowingFile.open('./tmp/input.mp4');
    var output_file = fs.createWriteStream('./tmp/output.m4v');
    
    // I've tried various args and ffmpeg params here without success.
    var args = ['-re', '-i', 'pipe:0', '-g', '52', '-ab', '64k', '-vcodec', 'libx264', '-vb', '448k', '-f', 'mp4', '-movflags', 'frag_keyframe+faststart', 'pipe:1'];
    var trans_proc = child.spawn('ffmpeg', args, null); 
    
    input_file.pipe(trans_proc.stdin);
    trans_proc.stdout.pipe(output_file);
    


    I am also temporarily trying to make these files work as intended via ffmpeg command line alone, without success. That command is:

    ffmpeg -i original.mp4 -vcodec copy -r 24 output.m4v


    Snippet of original.mp4 via mediainfo:

    General
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42
    File size                                : 9.87 MiB
    Duration                                 : 43mn 14s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 31.9 Kbp
    
    Video
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L2.1
    Codec ID                                 : avc1
    Duration                                 : 43mn 14s
    Width                                    : 480 pixels
    Height                                   : 268 pixels
    Color space                              : YUV
    Scan type                                : Progressive
    Stream size                              : 67.5 MiB
    
    Audio
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 43mn 14s
    Bit rate mode                            : Variable
    Bit rate                                 : 96.0 Kbps
    


    What's happening is that output.m4v has an incorrect duration of only the part of the file that's already downloaded. The video reaches the end or a refresh happens to make the duration longer. This process repeats until the original file is done downloading. What I want is to be able to emulate/clone the duration of the input file to the output file .

  • FFMPEG converting very slowly [on hold]

    3 décembre 2014, par user2610280

    ffmpeg -i input_file.webm -c:a copy output_file.mp4 for converting from a webm to mp4. It is converting very slowly, i mean it takes as much time as much is the video.

  • Create screen shot from video dynamically without ffmpeg [on hold]

    3 décembre 2014, par hitesh

    I need to take screenshot from the video after uploading, I already tried ffmpeg but it seems wjile enabling ffmpeg in my Cent OS 6.5 server. (check here )

    So I am looking for other ways to do this, I will be using simple html file tag for getting the video file, then I will be uploading it in server.

    what are other ways than ffmpeg to create screen shot from video dynamically in php or JS.

  • html5 video client side optimization

    3 décembre 2014, par Withfriendship Hiox

    I am using flowplayer and doing video quality selection as in the following page :

    Flowplayer quality selection

    User choose a quality and plays the video like 160p, 260p, 530p etc depending on their Internet speed to load the video quickly. However in the server side I have to encode the original video using Ffmpeg into each of these resolutions and store them.

    So it doing like video_1234_low.mp4, video_1234_mid.mp4, video_1234_high.mp4, etc. and switch the source to that video depending on which the user selects. This consumes a lot of drive space for large videos.

    Is there any possibility to load the video quickly without storing these files. Dynamic conversion on demand is difficult because it takes time. I wonder is there any client side trick to reduce the download size and play low quality video.