Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFMPEG mp4 input on android

    2 juin 2017, par DweebsUnited

    I have been banging my head against the wall on this for a while now. I need to trim part of an mp4 file, using ffmpeg on android. I have ffmpeg compiled, linked, and I can confirm that it works as expected in my ndk calls. What I am running into is getting an mp4 file to ffmpeg in a protocol it can actually work with.

    Right now, I have a Uri for the file that I get a ParcelFileDescriptor from. I pass its file descriptor to an ndk call that does all the ffmpeg processing using the pipe protocol. Issue: ffmpeg cannot read an mp4 over the pipe protocol, because it needs to seek back to the start once it finds the moov atom.

    All I'm doing is remuxing the videos. I'm not doing any heavy work, or more complicated ffmpeg calls

    Attempted solution: Set up custom AVio calls that open the descriptor as a file stream, and handle it that way. Issue: file descriptor from java is not seekable, it's more of a stream.

    Possible solution: Preprocess videos to have the moov atom at the front. Issue: Not allowed, the files come from somewhere I cannot control.

    Possible solution: Run one call to find all the file information, then another to actually remux the file. Issue: I don't know what I need to save from the first parse through to make this possible. Just the moov atom? Can I just replace the io object in the first call's inputFormatContext with a new one in the second call? Can I pass it two distinct file descriptors, both to the same file, and not have to make two ndk calls?

    Any help or ideas you can offer is greatly appreciated.

  • Ffmpeg framework android

    2 juin 2017, par Yupi

    I have been working on one project in which ffmpeg collection of libraries has to be included. But I'm struggling to implement it in Android Studio. I can't find clear explanation for that. Most of the explanations are for Linux or Mac OS but I'm using Windows. I have followed couple explanations which says that new directory has to be created in order: jniLibs/armeabi/ffmpeg.so I have done all of that. All things that like general. When I load library:
    static { System.loadLibrary("ffmpeg"); }

    I can't get acces to native mehods like public static native int encodeVideoFrame(byte[] yuv_image);

    Warning says: Cannot resolve corresponding JNI function

    So problem is with compiling ffmpeg for Android using Windows and including it in Android Studio. Any help would be very appreciated. Thanks.

  • PES Packet formation while encoding H.264 to TS without using ffmpeg

    2 juin 2017, par vs93

    So... I want to encode H.264 data to TS manually without using ffmpeg or like that. I am using only one PAT, one PMT. The TS file my program creates, can't be played by VLC. But, if I run ffmpeg -i big_buck_bunny_1496402185.ts ppm/ppm_%3d.ppm, ppm files are created successfully. Now, I have some confusions -

     1. I am forming PES packet using nalu from one SPS to next SPS(not including).
    Is this the right way?  
    I mean, what are the delimiters for forming PES packet? 
    AUD can be one option, but if the source does not contain AUD? then SPS? or what?
    Also should all NALU types be there in a PES packet?
     2. As I said, VLC can't play the file, but ffmpeg can find the access units, decode it. 
    What can be the reason? It seems the data I am using to form a packet is okay.
    Can it be the PCR/PTS/DTS issue? 
    Now, PCR is the property of TS and PTS/DTS is of PES packet. 
    I am quite confused about these three values.
    Currently the values are PCR_base = 0, pcr_ext = 1, 
    pts = 2 and dts = 1. I have used these arbitrarily.
    What should be the values as I know my source video is of 24 fps?
    Can someone please give me some references so that I can learn the basics of PCR/PTS/DTS.
    
    

    Please suggest me how to assign these values.

  • vlc in android studio with ffmpeg in linux

    2 juin 2017, par Eva Zana

    I am using VLC in android studio with FFMPEG in Linux, I need to change some code in FFMPEG c file but when I compile FFMPEG and run VLC application in android it uses the original version of FFMPEG and not the modified

    my compile code is:

    ./configue
    sudo make install
    make
    

    I have tried everything Why has this occurred? Maybe there is another way to compile or how to find the source of FFMPEG if I delete the file of FFMPEG and compile it restore the FFMPEG file from somewhere? However I don't know how?

  • Import FFMPEG Library to Android

    2 juin 2017, par Gio Vanno

    First, I'm new in this Import thing

    I've compiled latest version of ffmpeg with NDK r14b, and managed to get some Library after compiling(like libavutil.so,libavcodec.so,libavfilter.so,etc)

    Click here for pic

    but im a bit confused importing it to my android project.

    First, I want to make an Audio editing app that can merge several mp3 file at specific time, and adjust volume (Increase or Decrease its sound) mp3 file.

    I've read about ffmpeg recently, since most people recommended to use this Library.

    For merging :

    -https://superuser.com/questions/1092291/merge-many-audio-files-with-specific-positions/1092346#1092346

    For adjust volume :

    -Decode MP3, then increase the audio volume, and then encode the new audio

    What i want to ask is:

    -from guardian's ffmpeg project and WritingMinds ffmpeg lib (can't post the link since i got not enough rep and this 2 are often mentioned in stackoverflow), does this 2 Libraries have what i needed? I'm a bit confused in this thing. An explanation would be a help.

    -from http://ffmpeg-android.blogspot.co.id/ i cant run the ndk-build command at the last part. How should i use it?

    Thank you in advance!