Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Android NDK - ffmpeg header files not found by compiler

    7 septembre 2015, par markt

    I am trying to use the ffmpeg libraries with Android NDK in the experimental plugin.

    I am attempting to compile this example: https://github.com/roman10/android-ffmpeg-tutorial/blob/master/android-ffmpeg-tutorial01/jni/tutorial01.c

    My problem is that the header files are not being found by the compiler:

    Error:(13, 32) libavcodec/avcodec.h: No such file or directory
    

    I added flags to build.grade:

    cppFlags += "-ilibavcodec -ilibavutil -ilibavformat -ilibswscale"
    ldFlags += "-llibavcodec -llibavutil -llibavformat -llibswscale"
    

    Which seems to keep lint happy, but not the compiler. (Not sure if I have done this right?)

    I Have added the header files to the /jni folder: Project folder structure

    And build.grade looks like this:

    apply plugin: 'com.android.model.application'
    model {
        android {
            compileSdkVersion = 23
            buildToolsVersion = "23.0.1"
    
            defaultConfig.with { 
                applicationId = "roman10.tutorial.android_ffmpeg_tutorial01"
                minSdkVersion.apiLevel = 10
                targetSdkVersion.apiLevel = 23
    
            }
        }
    
        compileOptions.with {
            sourceCompatibility = JavaVersion.VERSION_1_7
            targetCompatibility = JavaVersion.VERSION_1_7
        }
    
        android.buildTypes {
            release {
                minifyEnabled = false
                proguardFiles += file('proguard-rules.pro')
            }
        }
    
    
        android.ndk {
            moduleName = "tutorial01"
            ldLibs += ["android","log","jnigraphics","z"]
            cppFlags += "-ilibavcodec -ilibavutil -ilibavformat -ilibswscale"
            ldFlags += "-llibavcodec -llibavutil -llibavformat -llibswscale"
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:support-v4:23.0.1'
    }
    

    Thanks.

  • Android Fatal Signal 11 in FFmpeg

    7 septembre 2015, par kamal

    Hi am using Ffmpeg library for Video Streaming in Android app.I have done compilation and import successfully.When i execute the app the video plays 2 secs and after that it crashes.can anyone give me the solution.

    Here is the logcat :

    09-07 12:41:06.108    1826-1826/com.ffmpegtest W/linker﹕ libffmpeg-neon.so has text relocations. This is wasting memory and is a security risk. Please fix.   
    09-07 12:41:07.178    1826-1904/com.ffmpegtest A/libc﹕ invalid address or address of corrupt block 0x75ad1f98 passed to dlfree
    09-07 12:41:07.178    1826-1904/com.ffmpegtest A/libc﹕ Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 1904 (AsyncTask #1)
    
  • Voice Declaration of Music File

    6 septembre 2015, par linuxfreebird

    I am struggling so hard with this bash script. I want my mp3 file to have a voice synthesis play at the beginning stating the name of the mp3 file before the music starts playing. I feel like there must be something out there that already does this, but I have not found one. I want the script to just take one argument str_url and it takes care of all of these steps automatically.

    str_title=$(youtube-dl -c --simulate --get-title $str_url) # get video name as string
    str_title=$(echo "$str_title" | sed 's|/||g') # remove '/' characters to stop directory creation
    youtube-dl -c -o "$str_title.%(ext)s" $str_url # generate audio mp4 file
    avconv -i "$str_title"".mp4" -vn -f wav "$str_title"".wav" # convert mp4 to wav
    rm "$str_title"".mp4" # delete mp4
    espeak --stdout > "espeak.wav" "$str_title" #convert text to speech sound wav file
    normalize-audio "$str_title"".wav"
    normalize-audio "espeak.wav"
    ffmpeg -i "espeak.wav" -i "$str_title"".wav" \
    -filter_complex "[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a]" \
    -map "[v]" -map "[a]" "espeak - ""$str_title"".wav"
    ffmpeg -i "espeak - ""$str_title"".wav" -codec:a libmp3lame -qscale:a 2 "espeak - ""$str_title"".mp3"
    

    I am having trouble recombining the wav files back into a mp3 file that my car can play. I tried using mp3wrap, but my car did not recognize the audio file. My car only recognizes basic mp3 files which I had to use sound convert to convert them to mp3. The current version of my script generates the following error:

    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s
    Stream specifier ':0' in filtergraph description [0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a] matches no streams.
    

    I am using ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers.

    What should I do next? Is there linux program that already does this? Thank you for your time and consideration.

  • ffmpeg won't save the file when executed from a php page

    6 septembre 2015, par Tayax

    I wrote few lines of codes today to create an video from an image with ffmpeg.

    the command works well directly on my server and the file is saved at the good place, but when running it from PHP, the process goes, but the file won't save for some reason.

    Here is the code I use :

    $ffmpegcmd= "/usr/bin/ffmpeg -loop 1 -y -i /home/mysite/www/forwork/simpletext.jpg -c:v libx264 -t 30 -pix_fmt yuv420p /home/mysite/www/forwork/movie.avi 2>&1";
    exec($ffmpegcmd, $output);  
    print_r($output);
    

    And here is the answer I get :

    Array ( [0] => ffmpeg version git-2015-09-06-db18b3d Copyright (c) 2000-2015 the FFmpeg developers 
    [1] => built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16) 
    [2] => configuration: --prefix=/usr/ffmpeg_build --extra-cflags=-I/usr/ffmpeg_build/include --extra-ldflags=-L/usr/ffmpeg_build/lib --bindir=/usr/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 
    [3] => libavutil 55. 0.100 / 55. 0.100 
    [4] => libavcodec 57. 0.100 / 57. 0.100 
    [5] => libavformat 57. 0.100 / 57. 0.100 
    [6] => libavdevice 57. 0.100 / 57. 0.100 
    [7] => libavfilter 6. 0.100 / 6. 0.100 
    [8] => libswscale 4. 0.100 / 4. 0.100 
    [9] => libswresample 2. 0.100 / 2. 0.100 
    [10] => libpostproc 54. 0.100 / 54. 0.100 
    [11] => Input #0, image2, from '/home/mysite/www/forwork/simpletext.jpg': 
    [12] => Duration: 00:00:00.04, start: 0.000000, bitrate: 10414 kb/s 
    [13] => Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc 
    [14] => /home/mysite/www/forwork/movie.avi: Permission denied )
    

    I chmod the forwork directory to 755 but it won't change anything.

    help troubleshooting this would be greatly appreciate. Thanks

  • ffmpeg rotate video according to sensor data

    6 septembre 2015, par oleg.semen

    I'm trying to scale videos down captured by the Android cellphones in order to reduce amount of data to be uploaded to the server. What I'm doing right now is:

    String.format("-i %s -vf \"scale='if(gt(a,1),-1,%d)':'if(gt(1,a),%d,-1)'\" -strict -2 %s", in, h, w, out);

    It scales down well. But users often hold their phoned in different orientation. When original video is played on a device it is rotated according to rotation saved in metadata. But after encoding video does not contain this information.

    How can I perform scaling that rotates video according to this data or at least to store this data in output file ? Thanks.