Recherche avancée

Médias (1)

Mot : - Tags -/framasoft

Autres articles (87)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (10032)

  • FFMPEG Link error

    30 novembre 2014, par Thomas

    I’m trying to compile a modified version of this transcoding example from the FFMPEG site, I’ve used all the required includes and joined the libs using this :

    INCLUDEPATH += $$(FFMPEG_DEV_PATH)\include
       LIBS += -L$$(FFMPEG_DEV_PATH)\lib -lavformat -lavcodec -lavutil -lswscale -liconv -lz -lavfilter

    but I get this linking error that I can’t understand :

     "avio_close(AVIOContext*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "av_strerror(int, char*, unsigned long)", referenced from:
         av_make_error_string(char*, unsigned long, int) in PhVideoEncoder.o
     "av_rescale_q(long long, AVRational, AVRational)", referenced from:
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "av_frame_free(AVFrame**)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "av_read_frame(AVFormatContext*, AVPacket*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avcodec_close(AVCodecContext*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avcodec_open2(AVCodecContext*, AVCodec const*, AVDictionary**)", referenced from:
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "av_dump_format(AVFormatContext*, int, char const*, int)", referenced from:
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "av_frame_alloc()", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
     "av_free_packet(AVPacket*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "av_init_packet(AVPacket*)", referenced from:
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "av_opt_set_bin(void*, char const*, unsigned char const*, int, int)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "av_register_all()", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "av_rescale_q_rnd(long long, AVRational, AVRational, AVRounding)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "av_write_trailer(AVFormatContext*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avfilter_graph_free(AVFilterGraph**)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avfilter_inout_free(AVFilterInOut**)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avformat_new_stream(AVFormatContext*, AVCodec const*)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "avformat_open_input(AVFormatContext**, char const*, AVInputFormat*, AVDictionary**)", referenced from:
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
     "avcodec_copy_context(AVCodecContext*, AVCodecContext const*)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "avcodec_find_decoder(AVCodecID)", referenced from:
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
     "avcodec_find_encoder(AVCodecID)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "avfilter_get_by_name(char const*)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avfilter_graph_alloc()", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avfilter_inout_alloc()", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avformat_close_input(AVFormatContext**)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avcodec_decode_audio4(AVCodecContext*, AVFrame*, int*, AVPacket const*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avcodec_decode_video2(AVCodecContext*, AVFrame*, int*, AVPacket const*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avcodec_encode_audio2(AVCodecContext*, AVPacket*, AVFrame const*, int*)", referenced from:
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "avcodec_encode_video2(AVCodecContext*, AVPacket*, AVFrame const*, int*)", referenced from:
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "avfilter_graph_config(AVFilterGraph*, void*)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avfilter_register_all()", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avformat_free_context(AVFormatContext*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avformat_write_header(AVFormatContext*, AVDictionary**)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "av_get_sample_fmt_name(AVSampleFormat)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "av_buffersink_get_frame(AVFilterContext*, AVFrame*)", referenced from:
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
     "avfilter_graph_parse_ptr(AVFilterGraph*, char const*, AVFilterInOut**, AVFilterInOut**, void*)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avformat_find_stream_info(AVFormatContext*, AVDictionary**)", referenced from:
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
     "av_interleaved_write_frame(AVFormatContext*, AVPacket*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "av_buffersrc_add_frame_flags(AVFilterContext*, AVFrame*, int)", referenced from:
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
     "avfilter_graph_create_filter(AVFilterContext**, AVFilter const*, char const*, char const*, void*, AVFilterGraph*)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "av_get_default_channel_layout(int)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avformat_alloc_output_context2(AVFormatContext**, AVOutputFormat*, char const*, char const*)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "av_get_channel_layout_nb_channels(unsigned long long)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "av_frame_get_best_effort_timestamp(AVFrame const*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "av_log(void*, int, char const*, ...)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
         PhVideoEncoder::flush_encoder(unsigned int) in PhVideoEncoder.o
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
         ...
     "av_free(void*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "av_malloc(unsigned long)", referenced from:
         av_malloc_array(unsigned long, unsigned long) in PhVideoEncoder.o
     "av_strdup(char const*)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avio_open(AVIOContext**, char const*, int)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o

    I tried looking for missing libraries but with no luck... What am I missing ?

    EDIT

    Thanks to the first answer, I added the extern C stuff but I still face a few errors :

    Undefined symbols for architecture x86_64:
     "_av_buffersink_get_frame", referenced from:
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
     "_av_buffersrc_add_frame_flags", referenced from:
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
     "_avfilter_get_by_name", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_graph_alloc", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_graph_config", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_graph_create_filter", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_graph_free", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "_avfilter_graph_parse_ptr", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_inout_alloc", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_inout_free", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_register_all", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
    ld: symbol(s) not found for architecture x86_64
  • IOException : Error running exec() Command, When calling FFmpeg method

    21 avril 2016, par kc ochibili

    i am trying to create a slide show mp4 using this ffmpeg method but i keep getting this IOException Error running exec(). Command when i click the button.

    here is my call

    ffmpegController = new FfmpegController(getTempDirectory(), new File(""));
    ffmpegController.createSlideshowFromImagesAndAudio(slideFrames, getAudioPath(), getOutPath(), 500, mCallbackResponse);

    Here is the source code of the small project.
    Here is the apk

    And here is my Error message

      Error running exec(). Command: [ffmpeg, -y, -i, /storage/emulated/0/TestFFmpeg/frame1.png, /storage/emulated/0/TestFFmpeg/temp/image-000.jpg]

    Working Directory: lib Environment: [VIBE_PIPE_PATH=/dev/pipes, ANDROID_ROOT=/system, EMULATED_STORAGE_SOURCE=/mnt/shell/emulated, LOOP_MOUNTPOINT=/mnt/obb, EMULATED_STORAGE_TARGET=/storage/emulated, ANDROID_BOOTLOGO=1, LD_LIBRARY_PATH=/vendor/lib:/system/lib, EXTERNAL_STORAGE=/storage/emulated/legacy, ANDROID_SOCKET_zygote=9, ANDROID_DATA=/data, PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin, ANDROID_ASSETS=/system/app, ASEC_MOUNTPOINT=/mnt/asec, BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/sec_edm.jar:/system/framework/seccamera.jar:/system/framework/secocsp.jar:/system/framework/sc.jar:/system/framework/scrollpause.jar:/system/framework/stayrotation.jar:/system/framework/smartfaceservice.jar:/system/framework/sws.jar:/system/framework/WfdCommon.jar, ANDROID_PROPERTY_WORKSPACE=8,66560, SECONDARY_STORAGE=/storage/extSdCard:/storage/UsbDriveA:/storage/UsbDriveB:/storage/UsbDriveC:/storage/UsbDriveD:/storage/UsbDriveE:/storage/UsbDriveF, ANDROID_STORAGE=/storage]

    Here is my Activity code :

    public class MainActivity extends Activity {

    Button testButton;
    EditText errorLogView;

    TinyDB tinydb;// sharedPreference Wrapper
    static Context context;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);
       context = getApplicationContext();
       tinydb = new TinyDB(context); // sharedPreference Wrapper
       testButton = (Button) findViewById(R.id.test_Image_View);
       errorLogView = (EditText) findViewById(R.id.errorlog);
       setListeners();
    }

    public void setListeners(){
       testButton.setOnClickListener(new OnClickListener() {

           @Override
           public void onClick(View v) {
               // TODO Auto-generated method stub
               Bitmap frame1Bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
               //Saves the image to the file system an returns the path
               String firstFrame = tinydb.putImagePNG("TestFFmpeg", "frame1.png", frame1Bitmap);
               String secondFrame = tinydb.putImagePNG("TestFFmpeg", "frame2.png", frame1Bitmap);
               String thirdFrame = tinydb.putImagePNG("TestFFmpeg", "frame3.png", frame1Bitmap);


               ArrayList<clip> slideFrames = new ArrayList<clip>();
               slideFrames.add(new Clip(firstFrame));
               slideFrames.add(new Clip(secondFrame));
               slideFrames.add(new Clip(thirdFrame));

               copyResourceSoundToSDCard();

               FfmpegController ffmpegController = null;
               try {

                   ffmpegController = new FfmpegController(getTempDirectory(), new File(""));
                   ffmpegController.createSlideshowFromImagesAndAudio(slideFrames, getAudioPath(), getOutPath(), 500, mCallbackResponse);

               } catch (FileNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   toast("FileNotFoundException");
                   toast(e.getLocalizedMessage());
               } catch (IOException e) {
                   // TODO Auto-generated catch block
                   toast("IOException");
                   toast(e.getLocalizedMessage());
                   errorLogView.setText(e.getLocalizedMessage());
                   e.printStackTrace();
               } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   toast("Exception ");
                   toast(e.getLocalizedMessage());
               }          
           }
       });


    }

    public Clip getAudioPath(){
       Clip mAudPath = null;
       try {
           mAudPath = new Clip(new File(tinydb.getString("audpath")).getCanonicalPath());
       } catch (IOException e1) {
           // TODO Auto-generated catch block
           e1.printStackTrace();
       }
       return mAudPath;
    }

    public Clip getOutPath(){
       String videoName = ("myTestVideo.mp4");
       String saveFolder = ("TestFFmpeg/videos");
       String movieFullPath = setupAudioFolder(saveFolder, videoName);

       Clip outPath = null;
       try {
           outPath = new Clip(new File(movieFullPath).getCanonicalPath());
       } catch (IOException e1) {
           // TODO Auto-generated catch block
           e1.printStackTrace();
       }
       tinydb.putString("outhPath", outPath.path);

       return outPath;
    }

    public void copyResourceSoundToSDCard(){
       try {
           copyRawFile(context, R.raw.screens_shot_sound, getResaveDirectory(), "755");
       } catch (IOException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
       } catch (InterruptedException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
       }
    }

    private File getResaveDirectory(){

       String audioName = ("ShotSound.wav");
       String saveFolder = ("TestFFmpeg");
       File appRootFile;
       String path = setupAudioFolder(saveFolder, audioName);
       tinydb.putString("audpath",  path);
       appRootFile = new File(path);
       return appRootFile;
     }

    public String setupAudioFolder(String theFolder, String theImageName){
       File sdcard_path = Environment.getExternalStorageDirectory();
       File mFolder = new File(sdcard_path, theFolder);
       if (!mFolder.exists()) {
           if (!mFolder.mkdirs()) {
               Log.e("While creatingsave path",
                       "Default Save Path Creation Error");
               // Toast("Default Save Path Creation Error");
           }
       }
       String mFullPath = mFolder.getPath() + '/' + theImageName;

       return mFullPath;
    }
    private static void copyRawFile(Context ctx, int resid, File file, String mode) throws IOException, InterruptedException
    {
       final String abspath = file.getAbsolutePath();
       // Write the iptables binary
       final FileOutputStream out = new FileOutputStream(file);
       final InputStream is = ctx.getResources().openRawResource(resid);
       byte buf[] = new byte[1024];
       int len;
       while ((len = is.read(buf)) > 0) {
           out.write(buf, 0, len);
       }
       out.close();
       is.close();
       // Change the permissions
       Runtime.getRuntime().exec("chmod "+mode+" "+abspath).waitFor();
    }      
    ShellCallback mCallbackResponse = new ShellUtils.ShellCallback() {

       @Override
       public void shellOut(String shellLine) {
           // TODO Auto-generated method stub

       }

       @Override
       public void processComplete(int exitValue) {
           // TODO Auto-generated method stub
           toast("process done");

       }
    };

    public File getTempDirectory(){
       String saveFolder = ("TestFFmpeg/temp");
       File appRootFile = setupCustomFile(saveFolder);


       return appRootFile;
    }

    public File setupCustomFile(String theFolder){
       File sdcard_path = Environment.getExternalStorageDirectory();
       File mFolder = new File(sdcard_path, theFolder);
       if (!mFolder.exists()) {
           if (!mFolder.mkdirs()) {
               Log.e("While creatingsave path",
                       "Default Save Path Creation Error");
               // Toast("Default Save Path Creation Error");
           }
       }

       return mFolder;
    }



    public static void toast(String thetext) {
       Toast.makeText(context, thetext, Toast.LENGTH_LONG).show();
    }
    </clip></clip>

    any help would be appreciated

  • Nginx video streaming - ffmpeg convert to flv, but requsted is mp4

    18 juin 2012, par abrahab

    I am converting videos from different sources with ffmpeg to mp4 with libx264 codec.
    The following command (simplified) :
    ffmpeg -i 1.mp4 -y -f mp4 -vcodec libx264 -crf 28 -threads 2 -strict experimental -acodec aac -ab 56k -ar 44100 -ac 2 temp.mp4

    Then, I can not stream the output file (500 Internal Server Error) with nginx mp4-streaming solution (aka http pseudo streaming). My system administrator found, that if rename file to flv it stream well, so, seems the output file is not mp4, but flv ? Why ? How to correctly convert ? Or, please, suggest how to stream video properly ? I think that mp4 is much better then flv... therefore I choose mp4.

    In other words, the problem is to stream output file like mp4.

    ps i also need to be sure that this video will always work at ipad after convertation. thanks and sorry for my bad english.

    EDIT : I found that if convert video with the same string but without -vcodec libx264 - nginx can serve the output .mp4 file well. where may be the problem ?