Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (32)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (6029)

  • How can I compress or change the resolution of the video very fast with FFmpeg ?

    28 mai 2017, par Rares

    I would like to compress or change the resolution of the video before sending it to server but I don’t want to take too long. For example for the following code a video with size 100MB it takes 2-3 min to resize it to 10MB. Can I do it faster without losing too much quality ?

                String[] command = {"-i", filePath, "-vf", "scale=640:360", "-c:a", "copy", "-preset", "ultrafast", dest.getAbsolutePath()};

    Console output for above command :

       05-28 11:50:22.131 23323-23323/com.example.rares.peoplecounterapp D/TestFFmpeg: SUCCESS with output : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
                                                                                     built with gcc 4.8 (GCC)
                                                                                     configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
                                                                                     libavutil      55. 17.103 / 55. 17.103
                                                                                     libavcodec     57. 24.102 / 57. 24.102
                                                                                     libavformat    57. 25.100 / 57. 25.100
                                                                                     libavdevice    57.  0.101 / 57.  0.101
                                                                                     libavfilter     6. 31.100 /  6. 31.100
                                                                                     libswscale      4.  0.100 /  4.  0.100
                                                                                     libswresample   2.  0.101 /  2.  0.101
                                                                                     libpostproc    54.  0.100 / 54.  0.100
                                                                                   Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/Camera/20170501_212606.mp4':
                                                                                     Metadata:
                                                                                       major_brand     : mp42
                                                                                       minor_version   : 0
                                                                                       compatible_brands: isommp42
                                                                                       creation_time   : 2017-05-01 18:26:46
                                                                                       com.android.version: 6.0
                                                                                     Duration: 00:00:38.70, start: 0.000000, bitrate: 17203 kb/s
                                                                                       Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 17007 kb/s, SAR 1:1 DAR 16:9, 29.98 fps, 29.92 tbr, 90k tbn, 180k tbc (default)
                                                                                       Metadata:
                                                                                         creation_time   : 2017-05-01 18:26:46
                                                                                         handler_name    : VideoHandle
                                                                                       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 155 kb/s (default)
                                                                                       Metadata:
                                                                                         creation_time   : 2017-05-01 18:26:46
                                                                                         handler_name    : SoundHandle
                                                                                   [libx264 @ 0xf7344400] using SAR=1/1
                                                                                   [libx264 @ 0xf7344400] using cpu capabilities: none!
                                                                                   [libx264 @ 0xf7344400] profile Constrained Baseline, level 3.0
                                                                                   [libx264 @ 0xf7344400] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=9 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
                                                                                   Output #0, mp4, to '/storage/emulated/0/DCIM/Camera/20170501_212606_compressed97.mp4':
                                                                                     Metadata:
                                                                                       major_brand     : mp42
                                                                                       minor_version   : 0
                                                                                       compatible_brands: isommp42
                                                                                       com.android.version: 6.0
                                                                                       encoder         : Lavf57.25.100
                                                                                       Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 29.92 fps, 11488 tbn, 29.92 tbc (default)
                                                                                       Metadata:
                                                                                         creation_time   : 2017-05-01 18:26:46
                                                                                         handler_name    : VideoHandle
                                                                                         encoder         : Lavc57.24.102 libx264
                                                                                       Side data:
                                                                                         unknown side data type 10 (24 bytes)
                                                                                       Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 155 kb/s (default)
                                                                                       Metadata:
                                                                                         creation_time   : 2017-05-01 18:26:46
                                                                                         handler_name    : SoundHandle
                                                                                   Stream mapping:
                                                                                     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
                                                                                     Stream #0:1 -> #0:1 (copy)
                                                                                   Press [q] to stop, [?] for help
                                                                                   frame=    6 fps=0.0 q=0.0 size=       0kB time=00:00:01.04 bitrate=   0.4kbits/s speed=1.96x    
                                                                                   frame=   15 fps=
    05-28 11:50:22.132 23323-23323/com.example.rares.peoplecounterapp D/TestFFmpeg: Finished command :ffmpeg [Ljava.lang.String;@d8854f
  • android - ffmpeg output audio contains garbled sound at the end

    31 mai 2017, par Sha

    I’m converting an audio (recorded via android phone with output type MPEG_4 and encoder DEFAULT) to mp3 using ffmpeg like this :

    -y -i /data/user/0/com.whispero.mithoo/files/input.mp3 -codec:a libmp3lame -qscale:a 2 /data/user/0/com.whispero.mithoo/files/output.mp3

    if the input audio is >20 seconds, there’s garbled audio at the end in the converted output file, otherwise if it’s <20 seconds, the output is fine.

    log :

    05-31 15:54:41.760 11922-11922/com.home.myapp E/onStart: onStart
    05-31 15:54:41.788 11922-11922/com.home.myapp E/first visible: 18: 4: total22,last:21
    05-31 15:54:42.046 11922-11922/com.home.myapp E/onProgress: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
    05-31 15:54:42.046 11922-11922/com.home.myapp E/onProgress:   built with gcc 4.8 (GCC)
    05-31 15:54:42.047 11922-11922/com.home.myapp E/onProgress:   configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
    05-31 15:54:42.047 11922-11922/com.home.myapp E/onProgress:   libavutil      55. 17.103 / 55. 17.103
    05-31 15:54:42.047 11922-11922/com.home.myapp E/onProgress:   libavcodec     57. 24.102 / 57. 24.102
    05-31 15:54:42.047 11922-11922/com.home.myapp E/onProgress:   libavformat    57. 25.100 / 57. 25.100
    05-31 15:54:42.048 11922-11922/com.home.myapp E/onProgress:   libavdevice    57.  0.101 / 57.  0.101
    05-31 15:54:42.048 11922-11922/com.home.myapp E/onProgress:   libavfilter     6. 31.100 /  6. 31.100
    05-31 15:54:42.048 11922-11922/com.home.myapp E/onProgress:   libswscale      4.  0.100 /  4.  0.100
    05-31 15:54:42.048 11922-11922/com.home.myapp E/onProgress:   libswresample   2.  0.101 /  2.  0.101
    05-31 15:54:42.049 11922-11922/com.home.myapp E/onProgress:   libpostproc    54.  0.100 / 54.  0.100
    05-31 15:54:42.053 11922-11922/com.home.myapp E/onProgress: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.home.myapp/files/166_31052017155411.mp3':
    05-31 15:54:42.053 11922-11922/com.home.myapp E/onProgress:   Metadata:
    05-31 15:54:42.053 11922-11922/com.home.myapp E/onProgress:     major_brand     : mp42
    05-31 15:54:42.054 11922-11922/com.home.myapp E/onProgress:     minor_version   : 0
    05-31 15:54:42.054 11922-11922/com.home.myapp E/onProgress:     compatible_brands: isommp42
    05-31 15:54:42.054 11922-11922/com.home.myapp E/onProgress:     creation_time   : 2017-05-31 10:54:41
    05-31 15:54:42.055 11922-11922/com.home.myapp E/onProgress:     com.android.version: 6.0.1
    05-31 15:54:42.055 11922-11922/com.home.myapp E/onProgress:   Duration: 00:00:29.98, start: 0.000000, bitrate: 15 kb/s
    05-31 15:54:42.056 11922-11922/com.home.myapp E/onProgress:     Stream #0:0(eng): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 12 kb/s (default)
    05-31 15:54:42.057 11922-11922/com.home.myapp E/onProgress:     Metadata:
    05-31 15:54:42.059 11922-11922/com.home.myapp E/onProgress:       creation_time   : 2017-05-31 10:54:41
    05-31 15:54:42.059 11922-11922/com.home.myapp E/onProgress:       handler_name    : SoundHandle
    05-31 15:54:42.089 11922-11922/com.home.myapp E/onProgress: Output #0, mp3, to '/data/user/0/com.home.myapp/files/166_31052017155411.mp3':
    05-31 15:54:42.090 11922-11922/com.home.myapp E/onProgress:   Metadata:
    05-31 15:54:42.090 11922-11922/com.home.myapp E/onProgress:     major_brand     : mp42
    05-31 15:54:42.091 11922-11922/com.home.myapp E/onProgress:     minor_version   : 0
    05-31 15:54:42.092 11922-11922/com.home.myapp E/onProgress:     compatible_brands: isommp42
    05-31 15:54:42.093 11922-11922/com.home.myapp E/onProgress:     com.android.version: 6.0.1
    05-31 15:54:42.095 11922-11922/com.home.myapp E/onProgress:     TSSE            : Lavf57.25.100
    05-31 15:54:42.095 11922-11922/com.home.myapp E/onProgress:     Stream #0:0(eng): Audio: mp3 (libmp3lame), 8000 Hz, mono, fltp (default)
    05-31 15:54:42.096 11922-11922/com.home.myapp E/onProgress:     Metadata:
    05-31 15:54:42.097 11922-11922/com.home.myapp E/onProgress:       creation_time   : 2017-05-31 10:54:41
    05-31 15:54:42.098 11922-11922/com.home.myapp E/onProgress:       handler_name    : SoundHandle
    05-31 15:54:42.098 11922-11922/com.home.myapp E/onProgress:       encoder         : Lavc57.24.102 libmp3lame
    05-31 15:54:42.099 11922-11922/com.home.myapp E/onProgress: Stream mapping:
    05-31 15:54:42.100 11922-11922/com.home.myapp E/onProgress:   Stream #0:0 -> #0:0 (amr_nb (amrnb) -> mp3 (libmp3lame))
    05-31 15:54:42.100 11922-11922/com.home.myapp E/onProgress: Press [q] to stop, [?] for help
    05-31 15:54:42.595 11922-11922/com.home.myapp E/onProgress: size=      18kB time=00:00:05.54 bitrate=  27.0kbits/s speed=11.1x    
    05-31 15:54:43.096 11922-11922/com.home.myapp E/onProgress: size=      43kB time=00:00:13.32 bitrate=  26.6kbits/s speed=13.3x    
    05-31 15:54:43.518 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.518 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.525 11922-11922/com.home.myapp E/onProgress: Multiple frames in a packet from stream 0
    05-31 15:54:43.525 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.538 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.540 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.540 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.541 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.541 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.542 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.543 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.543 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] dtx mode is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
    05-31 15:54:43.544 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Note: libopencore_amrnb supports dtx
    05-31 15:54:43.544 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
    05-31 15:54:43.545 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.546 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.546 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.547 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.547 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.548 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.549 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.549 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.550 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.551 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.551 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.552 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.552 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.553 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.554 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.555 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.556 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] dtx mode is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
    05-31 15:54:43.557 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Note: libopencore_amrnb supports dtx
    05-31 15:54:43.558 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
    05-31 15:54:43.559 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] dtx mode is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
    05-31 15:54:43.560 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Note: libopencore_amrnb supports dtx
    05-31 15:54:43.561 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
    05-31 15:54:43.562 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.563 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.563 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.519 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
    05-31 15:54:44.521 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.522 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.523 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.524 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.526 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.527 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.530 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.531 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.532 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.533 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.534 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.535 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.536 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.537 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.538 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.539 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.540 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.541 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.542 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.543 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.544 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.545 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.546 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.548 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.549 11922-11922/com.home.myapp E/onProgress: size=      90kB time=00:00:30.03 bitrate=  24.6kbits/s speed=16.6x    
    05-31 15:54:44.556 11922-11922/com.home.myapp E/onProgress: video:0kB audio:90kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.425926%
    05-31 15:54:44.558 11922-11922/com.home.myapp E/SUCCESS: SUCCESS
    05-31 15:54:44.558 11922-11922/com.home.myapp E/onFinish: onFinish

    My MediaRecorder settings are :

    mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    mRecorder.setAudioSamplingRate(24000);
    mRecorder.setAudioEncodingBitRate(32000);
    Log.e("Path","Createdfilepath:"+mFile.getPath());
    mRecorder.setOutputFile(mFile.getPath());
    mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
  • RTP packets detected as UDP

    8 juillet 2024, par fritz

    Here is what I am trying to do :

    &#xA;&#xA;

    WebRTC endpoint > RTP Endpoint > ffmpeg > RTMP server.&#xA;

    &#xA;&#xA;

    This is what my SDP file looks like.

    &#xA;&#xA;

    var cm_offer = "v=0\n" &#x2B;&#xA;              "o=- 3641290734 3641290734 IN IP4 127.0.0.1\n" &#x2B;&#xA;              "s=nginx\n" &#x2B;&#xA;              "c=IN IP4 127.0.0.1\n" &#x2B;&#xA;              "t=0 0\n" &#x2B;&#xA;              "m=audio 60820 RTP/AVP 0\n" &#x2B;&#xA;              "a=rtpmap:0 PCMU/8000\n" &#x2B;&#xA;              "a=recvonly\n" &#x2B;&#xA;              "m=video 59618 RTP/AVP 101\n" &#x2B;&#xA;              "a=rtpmap:101 H264/90000\n" &#x2B;&#xA;              "a=recvonly\n";&#xA;

    &#xA;&#xA;

    What's happening is that wireshark can detect the incoming packets at port 59618, but not as RTP packets but UDP packets. I am trying to capture the packets using ffmpeg with the following command :

    &#xA;&#xA;

    ubuntu@ip-132-31-40-100:~$ ffmpeg -i udp://127.0.0.1:59618 -vcodec copy stream.mp4&#xA;ffmpeg version git-2017-01-22-f1214ad Copyright (c) 2000-2017 the FFmpeg developers&#xA;  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)&#xA;  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc&#xA;  libavutil      55. 44.100 / 55. 44.100&#xA;  libavcodec     57. 75.100 / 57. 75.100&#xA;  libavformat    57. 63.100 / 57. 63.100&#xA;  libavdevice    57.  2.100 / 57.  2.100&#xA;  libavfilter     6. 69.100 /  6. 69.100&#xA;  libavresample   3.  2.  0 /  3.  2.  0&#xA;  libswscale      4.  3.101 /  4.  3.101&#xA;  libswresample   2.  4.100 /  2.  4.100&#xA;  libpostproc    54.  2.100 / 54.  2.100 &#xA;

    &#xA;&#xA;

    All I get is a blinking cursor and The stream.mp4 file is not written to disk after I exit (ctrl+c).

    &#xA;&#xA;

    So can you help me figure out :

    &#xA;&#xA;

      &#xA;
    1. why wireshark cannot detect the packets as RTP (I suspect it has something to do with SDP)
    2. &#xA;

    3. How to handle SDP answer when the RTP endpoint is pushing to ffmpeg which doesn't send an answer back.
    4. &#xA;

    &#xA;&#xA;

    Here is the entire code (hello world tutorial modified)

    &#xA;&#xA;

    /*&#xA;     * (C) Copyright 2014-2015 Kurento (http://kurento.org/)&#xA;     *&#xA;     * Licensed under the Apache License, Version 2.0 (the "License");&#xA;     * you may not use this file except in compliance with the License.&#xA;     * You may obtain a copy of the License at&#xA;     *&#xA;     *   http://www.apache.org/licenses/LICENSE-2.0&#xA;     *&#xA;     * Unless required by applicable law or agreed to in writing, software&#xA;     * distributed under the License is distributed on an "AS IS" BASIS,&#xA;     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#xA;     * See the License for the specific language governing permissions and&#xA;     * limitations under the License.&#xA;     */&#xA;&#xA;    function getopts(args, opts)&#xA;    {&#xA;      var result = opts.default || {};&#xA;      args.replace(&#xA;          new RegExp("([^?=&amp;]&#x2B;)(=([^&amp;]*))?", "g"),&#xA;          function($0, $1, $2, $3) { result[$1] = decodeURI($3); });&#xA;&#xA;      return result;&#xA;    };&#xA;&#xA;    var args = getopts(location.search,&#xA;    {&#xA;      default:&#xA;      {&#xA;        ws_uri: &#x27;wss://&#x27; &#x2B; location.hostname &#x2B; &#x27;:8433/kurento&#x27;,&#xA;        ice_servers: undefined&#xA;      }&#xA;    });&#xA;&#xA;    function setIceCandidateCallbacks(webRtcPeer, webRtcEp, onerror)&#xA;    {&#xA;      webRtcPeer.on(&#x27;icecandidate&#x27;, function(candidate) {&#xA;        console.log("Local candidate:",candidate);&#xA;&#xA;        candidate = kurentoClient.getComplexType(&#x27;IceCandidate&#x27;)(candidate);&#xA;&#xA;        webRtcEp.addIceCandidate(candidate, onerror)&#xA;      });&#xA;&#xA;      webRtcEp.on(&#x27;OnIceCandidate&#x27;, function(event) {&#xA;        var candidate = event.candidate;&#xA;&#xA;        console.log("Remote candidate:",candidate);&#xA;&#xA;        webRtcPeer.addIceCandidate(candidate, onerror);&#xA;      });&#xA;    }&#xA;&#xA;&#xA;    function setIceCandidateCallbacks2(webRtcPeer, rtpEp, onerror)&#xA;    {&#xA;      webRtcPeer.on(&#x27;icecandidate&#x27;, function(candidate) {&#xA;        console.log("Localr candidate:",candidate);&#xA;&#xA;        candidate = kurentoClient.getComplexType(&#x27;IceCandidate&#x27;)(candidate);&#xA;&#xA;        rtpEp.addIceCandidate(candidate, onerror)&#xA;      });&#xA;    }&#xA;&#xA;&#xA;    window.addEventListener(&#x27;load&#x27;, function()&#xA;    {&#xA;      console = new Console();&#xA;&#xA;      var webRtcPeer;&#xA;      var pipeline;&#xA;      var webRtcEpt;&#xA;&#xA;      var videoInput = document.getElementById(&#x27;videoInput&#x27;);&#xA;      var videoOutput = document.getElementById(&#x27;videoOutput&#x27;);&#xA;&#xA;      var startButton = document.getElementById("start");&#xA;      var stopButton = document.getElementById("stop");&#xA;&#xA;      startButton.addEventListener("click", function()&#xA;      {&#xA;        showSpinner(videoInput, videoOutput);&#xA;&#xA;        var options = {&#xA;          localVideo: videoInput,&#xA;          remoteVideo: videoOutput&#xA;        };&#xA;&#xA;&#xA;        if (args.ice_servers) {&#xA;         console.log("Use ICE servers: " &#x2B; args.ice_servers);&#xA;         options.configuration = {&#xA;           iceServers : JSON.parse(args.ice_servers)&#xA;         };&#xA;        } else {&#xA;         console.log("Use freeice")&#xA;        }&#xA;&#xA;        webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function(error)&#xA;        {&#xA;          if(error) return onError(error)&#xA;&#xA;          this.generateOffer(onOffer)&#xA;        });&#xA;&#xA;        function onOffer(error, sdpOffer)&#xA;        {&#xA;          if(error) return onError(error)&#xA;&#xA;          kurentoClient(args.ws_uri, function(error, client)&#xA;          {&#xA;            if(error) return onError(error);&#xA;&#xA;            client.create("MediaPipeline", function(error, _pipeline)&#xA;            {&#xA;              if(error) return onError(error);&#xA;&#xA;              pipeline = _pipeline;&#xA;&#xA;              pipeline.create("WebRtcEndpoint", function(error, webRtc){&#xA;                if(error) return onError(error);&#xA;&#xA;                webRtcEpt = webRtc;&#xA;&#xA;                setIceCandidateCallbacks(webRtcPeer, webRtc, onError)&#xA;&#xA;                webRtc.processOffer(sdpOffer, function(error, sdpAnswer){&#xA;                  if(error) return onError(error);&#xA;&#xA;                  webRtcPeer.processAnswer(sdpAnswer, onError);&#xA;                });&#xA;                webRtc.gatherCandidates(onError);&#xA;&#xA;                webRtc.connect(webRtc, function(error){&#xA;                  if(error) return onError(error);&#xA;&#xA;                  console.log("Loopback established");&#xA;                });&#xA;              });&#xA;&#xA;&#xA;&#xA;            pipeline.create("RtpEndpoint", function(error, rtp){&#xA;                if(error) return onError(error);&#xA;&#xA;                //setIceCandidateCallbacks2(webRtcPeer, rtp, onError)&#xA;&#xA;&#xA;                var cm_offer = "v=0\n" &#x2B;&#xA;                      "o=- 3641290734 3641290734 IN IP4 127.0.0.1\n" &#x2B;&#xA;                      "s=nginx\n" &#x2B;&#xA;                      "c=IN IP4 127.0.0.1\n" &#x2B;&#xA;                      "t=0 0\n" &#x2B;&#xA;                      "m=audio 60820 RTP/AVP 0\n" &#x2B;&#xA;                      "a=rtpmap:0 PCMU/8000\n" &#x2B;&#xA;                      "a=recvonly\n" &#x2B;&#xA;                      "m=video 59618 RTP/AVP 101\n" &#x2B;&#xA;                      "a=rtpmap:101 H264/90000\n" &#x2B;&#xA;                      "a=recvonly\n";&#xA;&#xA;&#xA;&#xA;                rtp.processOffer(cm_offer, function(error, cm_sdpAnswer){&#xA;                  if(error) return onError(error);&#xA;&#xA;                  //webRtcPeer.processAnswer(cm_sdpAnswer, onError);&#xA;                });&#xA;                //rtp.gatherCandidates(onError);&#xA;&#xA;                webRtcEpt.connect(rtp, function(error){&#xA;                  if(error) return onError(error);&#xA;&#xA;                  console.log("RTP endpoint connected to webRTC");&#xA;                });&#xA;              });&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;            });&#xA;          });&#xA;        }&#xA;      });&#xA;      stopButton.addEventListener("click", stop);&#xA;&#xA;&#xA;      function stop() {&#xA;        if (webRtcPeer) {&#xA;          webRtcPeer.dispose();&#xA;          webRtcPeer = null;&#xA;        }&#xA;&#xA;        if(pipeline){&#xA;          pipeline.release();&#xA;          pipeline = null;&#xA;        }&#xA;&#xA;        hideSpinner(videoInput, videoOutput);&#xA;      }&#xA;&#xA;      function onError(error) {&#xA;        if(error)&#xA;        {&#xA;          console.error(error);&#xA;          stop();&#xA;        }&#xA;      }&#xA;    })&#xA;&#xA;&#xA;    function showSpinner() {&#xA;      for (var i = 0; i &lt; arguments.length; i&#x2B;&#x2B;) {&#xA;        arguments[i].poster = &#x27;img/transparent-1px.png&#x27;;&#xA;        arguments[i].style.background = "center transparent url(&#x27;img/spinner.gif&#x27;) no-repeat";&#xA;      }&#xA;    }&#xA;&#xA;    function hideSpinner() {&#xA;      for (var i = 0; i &lt; arguments.length; i&#x2B;&#x2B;) {&#xA;        arguments[i].src = &#x27;&#x27;;&#xA;        arguments[i].poster = &#x27;img/webrtc.png&#x27;;&#xA;        arguments[i].style.background = &#x27;&#x27;;&#xA;      }&#xA;    }&#xA;&#xA;    /**&#xA;     * Lightbox utility (to display media pipeline image in a modal dialog)&#xA;     */&#xA;    $(document).delegate(&#x27;*[data-toggle="lightbox"]&#x27;, &#x27;click&#x27;, function(event) {&#xA;      event.preventDefault();&#xA;      $(this).ekkoLightbox();&#xA;    });&#xA;

    &#xA;