Recherche avancée

Médias (91)

Autres articles (78)

  • 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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • 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 (...)

Sur d’autres sites (13186)

  • Writing a video frame by frame using ffmpeg

    16 juin, par Chris

    I am trying to write a video frame-by-frame using ffmpeg as explained here : http://zulko.github.io/blog/2013/09/27/read-and-write-video-frames-in-python-using-ffmpeg/

    


    However, I am always getting an OSError : [Errno 22] Invalid argument. I am on Windows 7 and using Python 3.4.

    


    Here is the code :

    


    import subprocess as sp
import numpy as np
import time

ffmpeg_bin = r'C:\path\to\ffmpeg\ffmpeg.exe'

command = [ffmpeg_bin,
           '-y', # (optional) overwrite output file if it exists
           '-f', 'rawvideo',
           '-vcodec','rawvideo',
           '-s', '420x360', # size of one frame
           '-pix_fmt', 'rgb24',
           '-r', '24', # frames per second
           '-i', '-', # The imput comes from a pipe
           '-an', # Tells FFMPEG not to expect any audio
           '-vcodec', 'mpeg',
           'my_output_videofile.mp4' ]

proc = sp.Popen(command, stdin=sp.PIPE, stderr=sp.PIPE)

a = np.zeros((360, 420, 3), dtype=np.uint8)

for ii in range(5*24):
    print(ii)
    proc.stdin.write(a.tostring())
    time.sleep(1/24)

proc.stdin.close()
proc.stderr.close()
proc.wait()


    


    And here is the output of the program :

    


    0&#xA;1&#xA;Traceback (most recent call last):&#xA;  File ".\write_dummy_video.py", line 25, in <module>&#xA;    proc.stdin.write(a.tostring())&#xA;OSError: [Errno 22] Invalid argument&#xA;</module>

    &#xA;

    Interestingly, if I comment line number 26 (i.e. time.sleep(1/24)) the error message changes slightly but the loop still only runs twice. Here is the error output :

    &#xA;

    0&#xA;1&#xA;Traceback (most recent call last):&#xA;  File ".\write_dummy_video.py", line 25, in <module>&#xA;    proc.stdin.write(a.tostring())&#xA;BrokenPipeError: [Errno 32] Broken pipe&#xA;</module>

    &#xA;

    What could be causing this problem, and how can I fix it ?

    &#xA;

  • Simples loop to iterate over files and send them to ffmpeg

    25 octobre 2019, par user2752471

    I want to do a shell script that will iterate over several video files in a directory, send everyone of them to ffmpeg, that will then reencode each one, producing a reencoded file that will have the same name as the original, except with .avi extension instead .mkv or .mp4.

    I found a fairly simple script in another topic here on SO, tried to change it slightly to take into account the file extension and the destination directory.

    However my script only produces countless "anything : No such file or directory"

    Here is it :

    $ for f in $(find -type f -name *.mkv); do ffmpeg -n -i "$f" -c:v copy ".$f" ; done

    And these is the ffmpeg command that I usually use :

    ffmpeg -y -i  -vf scale=720:-2 -c:v mpeg4 -vtag xvid -b:v 969k -pass 1 -an -f avi /dev/null &amp;&amp; ffmpeg -i -c:a libmp3lame -b:a 48k -ac 1 -vf scale=720:-2 -c:v mpeg4 -vtag xvid -b:v 969k -pass 2  .avi

    So I need to identify what is incorrect in the first script, that is considering each small word of the file’s name as a file, and then change it as to add all these ffmpeg parameters.

    Somethings that I do not understand in the script :

    1)Are the -type and f in find command necessary. From what I read of the documentation, all it does is to tell find that it shall look for normal files, something that seems irrelevant for my case. When I use find, I do : find starting dir -name filename. So do I have to keep it ?

    2)What -n means for ffmpeg ? I am currently without a man entry for ffmpeg. Is it necessary for my needs ?

    3)Do I need to have "" around $f ? What it does ?

    4)As far as I understand $ denotes a variable. But what the "f" after it does ? Do I need it ?

    5)The " ;" after the closing ")" and the ".$f" are necessary ? The first is used to indicate the end of the for loop,and the second the end of the ffmpeg command ?

    6)The "do" and the "does" are also necessary for the same motives behind the " ;"

    Here is my attempt of the ffmpeg part of the script. Please tell me what to change on it, as in the find part of it.

    do ffmpeg -n -y -i "$f.mkv" -vf scale=720:-2 -c:v mpeg4 -vtag xvid -b:v 969k -pass 1 -an -f avi /dev/null &amp;&amp; ffmpeg -n -i "$f" -c:a libmp3lame -b:a 48k -ac 1 -vf scale=720:-2 -c:v mpeg4 -vtag xvid -b:v 969k -pass 2  ".$f.avi" ; done

    If I would like the script to also look for ".mp4" besides ".mkv" how I would need to change it ?

    Thanks for any input.

  • avcodec_find_encoder(AV_CODEC_ID_H264) returns null

    25 mai, par Monjura Rumi

    I am building an android application which will encode image captured from camera preview and later decode it. I am using ffmpeg library to encode and decode. To build static library with x264 I have used this tutorial. http://dl.dropbox.com/u/22605641/ffmpeg_android/main.html. As a source code of ffmpeg if I use the one downloaded from the link given in tutorial I can built it but can't build library if i use source code downloaded from here git clone git ://source.ffmpeg.org/ffmpeg.git ffmpeg. I have built library in ubuntu and using it in windows 7 in Eclipse. As I need only h264 encoder and decoder I have used following code for ffmpeg, slightly modified from tutorial.

    &#xA;&#xA;

    #!/bin/bash&#xA;&#xA;NDK=~/Documents/android-ndk-r8e&#xA;PLATFORM=$NDK/platforms/android-8/arch-arm&#xA;PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86&#xA;PREFIX=/home/android-ffmpeg&#xA;&#xA;function build_one&#xA;{&#xA;    ./configure --target-os=linux --prefix=$PREFIX \&#xA;    --enable-cross-compile \&#xA;    --enable-runtime-cpudetect \&#xA;    --disable-asm \&#xA;    --arch=arm \&#xA;    --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \&#xA;    --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \&#xA;    --disable-stripping \&#xA;    --nm=$PREBUILT/bin/arm-linux-androideabi-nm \&#xA;    --sysroot=$PLATFORM \&#xA;    --enable-nonfree \&#xA;    --enable-version3 \&#xA;    --disable-everything \&#xA;    --enable-gpl \&#xA;    --disable-doc \&#xA;    --enable-avresample \&#xA;    --disable-ffplay \&#xA;    --disable-ffserver \&#xA;    --enable-ffmpeg \&#xA;    --disable-ffprobe \&#xA;    --enable-avcodec \&#xA;    --enable-libx264 \&#xA;    --enable-encoder=libx264 \&#xA;    --enable-encoder=libx264rgb \&#xA;    --enable-decoder=h263 \&#xA;    --enable-decoder=h264 \&#xA;    --enable-decoder=svq3 \   &#xA;    --enable-zlib \&#xA;    --enable-gpl \&#xA;    --enable-pic \&#xA;    --disable-devices \&#xA;    --disable-avdevice \&#xA;    --extra-cflags="-I/home/android-ffmpeg/include -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a" \&#xA;    --extra-ldflags="-L/home/android-ffmpeg/lib"&#xA;make -j4 install&#xA;$PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o&#xA;$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib  -soname libffmpeg.so -shared -nostdlib  -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavfilter/libavfilter.a libavresample/libavresample.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog -lx264 --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a&#xA;}&#xA;&#xA;build_one&#xA;

    &#xA;&#xA;

    After building library I have been able to build android ndk. A little part of my JNI code is here.

    &#xA;&#xA;

    JNIEXPORT jint JNICALL Java_com_example_testjava_TestjniActivity_initencoder(JNIEnv* env,jobject obj){&#xA;&#xA;    av_register_all();&#xA;    avcodec_register_all();&#xA;    codec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;    if (!codec) {&#xA;      __android_log_write(ANDROID_LOG_INFO, "debug", "not found");                &#xA;       return -1;&#xA;    }&#xA;.&#xA;.&#xA;.&#xA;}&#xA;

    &#xA;&#xA;

    When I run my java source code that calls initencoder() I get -1 as return value and logcat prints "not found". That means avcodec_find_encoder() returns null and if condition is being ok. I don't know what's wrong. Why this function is returning null ? I have searched a lot but did not find any solution that could guide me to right direction. some says to use avcodec_init(). But ndk-build command fails and shows error saying undefined reference to 'avcodec_init()'. I have started with library build because I thought may be I am doing wrong from the first stage. Did I make any mistake in library building like not enabling things that I should ? Please help me here. This is kind of urgent for me.

    &#xA;