Recherche avancée

Médias (91)

Autres articles (91)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

Sur d’autres sites (12406)

  • Ffmpeg hangs when -vcodec copy specified (called from Java via ProcessBuilder)

    24 juin 2015, par Inglonias

    I’m trying to use ffmpeg to export an array of bytes to a video file, but the people I work with insist that I use -vcodec copy in the arguments for it. This, however, causes the code to hang, whereas if I don’t use -vcodec copy, the code will not hang. I don’t know what the problem is, and I’ve been trying to debug this code for the past two hours.

    Here is the relevant section of code. I’ve added comments above and below the line where the code hangs. Can anybody help me ?

           // This is the tricky part. We need to build an ffmpeg process that
           // takes input from stdin, and then plug Java into that.
           ProcessBuilder ffmpegBuilder = new ProcessBuilder();
           String[] cmd = {"ffmpeg", "-i", "-","-vcodec", "copy", directory
                   + "/" + fileName};
           StringBuilder combinedCmd = new StringBuilder();
           for (String s : cmd) {
               combinedCmd.append(s);
               combinedCmd.append(" ");
           }
           mLogger.log(Level.INFO,"Final command is " + combinedCmd.toString());
           ffmpegBuilder.command(cmd);
           ffmpegBuilder.redirectErrorStream(true); // So that stdout and stderr go
                                                       // to the same stream.
           byte[] dataToWrite = new byte[data.size()];
           for (int i = 0; i < dataToWrite.length; i++) {
               dataToWrite[i] = data.get(i); // Is there really STILL no better way
                                               // to convert an ArrayList to an
                                               // array?!
           }
           try {
               Process ffmpeg = ffmpegBuilder.start();
               OutputStream stdin = ffmpeg.getOutputStream();
               BufferedReader stdout = new BufferedReader(new InputStreamReader(
                       ffmpeg.getInputStream()));
    //HANGS AT THIS LINE vvvvvvvvvvvvvvvv
               stdin.write(dataToWrite);
    //HANGS AT THIS LINE ^^^^^^^^^^^^^^^^

               String line = "I know a song that gets on everybody's nerves...";
               while ((line != null) && stdout.ready()) {
                   line = stdout.readLine();
                   mLogger.log(Level.INFO, line);
               }
               try {
                   ffmpeg.waitFor(2, TimeUnit.SECONDS);
                   ffmpeg.destroyForcibly();
               } catch (InterruptedException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
               }
           } catch (IOException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
           }
  • Audio playing back at the wrong speed using FFmpeg on Android

    11 avril 2019, par Kyborg2011

    General problem in the following :
    I decode the audio as follows :

    ReSampleContext* rsc = av_audio_resample_init(
           1, aCodecCtx->channels,
           aCodecCtx->sample_rate, aCodecCtx->sample_rate,
           av_get_sample_fmt("u8"), aCodecCtx->sample_fmt,
           16, 10, 0, 1);

    while (av_read_frame(pFormatCtx, &packet)>= 0) {
       if (aCodecCtx->codec_type == AVMEDIA_TYPE_AUDIO) {
           int data_size = AVCODEC_MAX_AUDIO_FRAME_SIZE * 2;
           int size=packet.size;
           int decoded = 0;

            while(size > 0) {
                int len = avcodec_decode_audio3(aCodecCtx, pAudioBuffer,
                    &data_size, &packet);

                //Сonvert audio to sample 8bit
                out_size = audio_resample(rsc, outBuffer, pAudioBuffer, len);

                jbyte *bytes = (*env)->GetByteArrayElements(env, array, NULL);

                memcpy(bytes, outBuffer, out_size);
                (*env)->ReleaseByteArrayElements(env, array, bytes, 0);
                (*env)->CallStaticVoidMethod(env, cls, mid, array, out_size, number);

                size -= len;
                number++;
            }
        }
    }

    Next release it AudioTrack. After that, I hear that song that was necessary, but with noise and speed of 2 times larger. In what may be the problem ?

    UPDATE :
    This is Java code :

    public static AudioTrack track;
    public static byte[] bytes;
    protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
       int bufSize = 2048;
       track = new AudioTrack(AudioManager.STREAM_MUSIC, 44100, AudioFormat.CHANNEL_OUT_MONO,
                   AudioFormat.ENCODING_PCM_8BIT, bufSize, AudioTrack.MODE_STREAM);

       bytes = new byte[bufSize];
       Thread mAudioThread = new Thread(new Runnable() {
           public void run() {
               int res = main(2, "/sdcard/muzika_iz_reklami_bmw_5_series_-_bmw_5_series.mp3", bytes);
               System.out.println(res);
           }
       });
       mAudioThread.setPriority(Thread.MAX_PRIORITY);
       mAudioThread.start();
    }

    private static void play(byte[] play, int length, int p) {
       if (p==0){
           track.play();
       }
       track.write(play, 0, length);
    }
  • Automatic encoder selection failed Default encoder for format mp3 is probably disabled. Please choose an encoder manually.Error selecting an encoder

    27 janvier 2018, par Parimal Desai

    using ffmpeg compressing song to low quality getting error for

    "Automatic encoder selection failed for output stream #0:1. Default encoder for format mp3 (codec mp3) is probably disabled. Please choose an encoder manually. Error selecting an encoder for stream 0:1"

    ffmpeg -i /home/smubu/public_html/uploads/tracks/47865540_1999341734_1027911481.mp3 -ab 64 /home/smubu/public_html/uploads/tracks/47865540_1999341734_1027911481_comp_96.mp3

    ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
     configuration:
     libavutil      55. 78.100 / 55. 78.100
     libavcodec     57.107.100 / 57.107.100
     libavformat    57. 83.100 / 57. 83.100
     libavdevice    57. 10.100 / 57. 10.100
     libavfilter     6.107.100 /  6.107.100
     libswscale      4.  8.100 /  4.  8.100
     libswresample   2.  9.100 /  2.  9.100
    [mp3 @ 0x218e380] Estimating duration from bitrate, this may be inaccurate
    Input #0, mp3, from '/home/smubu/public_html/uploads/tracks/47865540_1999341734_1027911481.mp3':
     Metadata:
       encoder         : LAME 32bits version 3.98.2 (http://www.mp3dev.org/)
       title           : Dj.Senior'B Kantinti [Club Rmx
       track           : 2010
       comment         : Downloaded from Howwe Entertainment [ www.howwe.biz ]
       TEXT            : 2010
       TLEN            : 97391548
       artist          : Stecia Mayanja
       album_artist    : www.howwe.biz
       composer        : www.howwe.biz
       album           : Howwe Entertainment
       genre           : www.howwe.biz
       date            : 2010
     Duration: 00:03:46.34, start: 0.000000, bitrate: 81 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 80 kb/s
       Stream #0:1: Video: png, rgba(pc), 600x600, 90k tbr, 90k tbn, 90k tbc
       Metadata:
         comment         : Other
    Automatic encoder selection failed for output stream #0:1. Default encoder for format mp3 (codec mp3) is probably disabled. Please choose an encoder manually.
    Error selecting an encoder for stream 0:1

    Help me regarding this issue