Recherche avancée

Médias (1)

Mot : - Tags -/iphone

Autres articles (33)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • 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"

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

Sur d’autres sites (6106)

  • ffmpeg status & quality / cuda (CPU/GPU)

    18 juin 2024, par cocco

    ffmpeg am I doing it right ?

    


    So much time has passed since I use ffmpeg to convert clips on my home web server, now that mp4 (h264 & aac) is the current overall standard (works on every console, smartphone, smartTV, pc) I decided to convert my old clips from various digital cameras to to this new container/codecs.

    


      

    1. less space & the same quality.
    2. 


    3. compatibility
    4. 


    5. support for tags (subler for mac)
    6. 


    


    after some research I opted for ffmpeg because of various reasons

    


      

    1. commandline (I made my simple web interface with default settings which I execute with php's exec)
    2. 


    3. the quality/size amount
    4. 


    


    I read that many expensive video conversion software programs are not able to handle low bitrate videos properly. I also tested some of them and personally I could not find the proper export settings or I was not impressed by the results... some had fixed default export settings, most had a lower video quality at the same filesize. ffmpeg allows me to set the -crf (18-24 usually) and -preset (veryslow, fast..) which allows me to reduce the filesize drastically maintaining the same visible quality.

    


    Said that I'm using the preset at very slow (there is also placebo but the final video file is only 1% smaller in size).

    


    And here is the command I use

    


    ffmpeg
-y //overwrite the file if it exists

-i INPUTFILE // replace with the input file

-metadata title=THETITLE // set a nice title, visible on modern devices
-metadata date=THEDATE // set a nice title, visible on modern devices

-c:v libx264 // use the h264 codec
 -crf 21 // try different numbers between 18-26
 -preset veryslow // placebo,slow,fast,ultrafast==big file 
 -tune film // tune it a little
 -pix_fmt yuv420p // preferred on most modern devices
 -profile:v main // preferred on most modern devices
 -level 3.1 // preferred on most modern devices 
 -refs 4 // preferred on most modern devices

-c:a libfdk_aac // use aac
 -metadata:s:a language=eng // set a language, visible on modern devices 
 -b:a 128k // audio bitrate 128k is like mp3 192k
 -ar 48000 // 44100 ... whatever
 -ac 2 // audiochannels
 -movflags +faststart //move the metadata in the front of the video so it loads faster

OUTPUTFILE


    


    Some camcorder clips with m2ts already have the avc/h264 compatible codec so I just copy the stream.
    
some have the ac3/Dolby surround audio. I convert the audio but keep the ac3 as second audio track mapping the ffmpeg streams. this allows me to watch the mp4 on browsers and mobile devices but I'm able to keep the surround sound to playback on some tv's, advanced media players or devices like apple tv.

    


    Not that I'm not happy with the speed (using quad core's) but I recently read again about cuda opencl and there is also the simple fact that I'm not using other converters than ffmpeg since a lot of time.

    


    Is ffmpeg (with the setting I use) a good converter to keep the same video quality than the source reducing the space occupied by and average of 30-40% ?

    


    Is GPU conversion really that bad (cuda .. testing a gtx970) ?
it would be nice to add some more speed to the conversions by using both the gpu and the cpu..but for my understanding they cannot work together ??? and using only GPU is a drastically quality loss...cpu is more precise, GPU is faster in calculation are too imprecise from what I read.. so expensive software programs use cuda only for preview purpose... right ?

    


    Is ffmpeg or another software compatible with CPU+GPU encoding ?
I really don't remember where, but I read that the ffmpeg is not a good videoconverter.

    


    I'm really happy with the size/quality, I gained an average of 30% in space with no visible quality loss. With some extra parameters i can adjust some really old analog videos that are deinterlaced in a really bad way.

    


    


    maybe I could gain more size/quality with another software ???

    


    


    note : I like ffmpeg.it's free and it has commandline so I can create my own interface with php html & js and use it on various machines without the need to install it in every device I use. I upload the idevice clips directly to the ffmpeg server.

    


    EDIT :

    


    @talonmies ...cuda tag removed :

    


    http://www.nvidia.com/object/cuda_home_new.html

    


    


    CUDA® is a parallel computing platform and programming model invented
by NVIDIA. It enables dramatic increases in computing performance by
harnessing the power of the graphics processing unit (GPU). With
millions of CUDA-enabled GPUs sold to date, software developers,
scientists and researchers are finding broad-ranging uses for GPU
computing with CUDA. Here are a few examples : - See more at :
http://www.nvidia.com/object/cuda_home_new.html#sthash.dEYaqae7.dpuf

    


    


    isn't cuda the programming model that a theoretical ffmpeg library should support to handle GPU encoding on nvidia cards like the gtx 970 ?? like the badaboom software http://www.geforce.com/games-applications/pc-applications/badaboom-media-converter.

    


  • Alsa audio playback program occurs underrun errors frequency

    15 juillet 2021, par Tank2006

    My environment is Raspberry Pi 3B/Raspberry Pi OS, and I'm building remotely from Visual Studio 2019 on Windows 10.

    


    I want to play PCM audio decoded by FFmpeg in ALSA(C language API).
But this code returns Underrun error(EPIPE) at "snd_pcm_writei" and plays a cracky sound.

    


    Probably the way the resources are managed is wrong, but I don't know how to optimize it.

    


    avres AlsaPlayer::OpenOutputDevice(AlsaDeviceType ao_type, OutputMode omode)
{
    memset(&output_format, 0, sizeof(InterfaceFormat));

    avres res;

    string dname = GetAlsaDeviceName(false, (ao_type == AD_DIGITAL));
    res = snd_pcm_open(&play_handle, dname.c_str(), SND_PCM_STREAM_PLAYBACK, 0);

    if (AV_FAILED(res)) return res;

    unsigned int sample_rate = DEFAULT_OUTPUT_RATE;
    uint64_t ch_layout = (ao_type == AD_ANALOG_6CH) ? AV_CH_LAYOUT_5POINT1 : AV_CH_LAYOUT_STEREO;
    int channels = av_get_channel_layout_nb_channels(ch_layout);

    snd_pcm_hw_params_t *hw_params;
    res = snd_pcm_hw_params_malloc(&hw_params);

    snd_pcm_hw_params_any(play_handle, hw_params);

    res = snd_pcm_hw_params_set_access(play_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED);
    res = snd_pcm_hw_params_set_format(play_handle, hw_params, SND_PCM_FORMAT_S16_LE);
    res = snd_pcm_hw_params_set_channels(play_handle, hw_params, channels);
    res = snd_pcm_hw_params_set_rate_near(play_handle, hw_params, &sample_rate, 0);
    res = snd_pcm_hw_params(play_handle, hw_params);

    snd_pcm_uframes_t frames; 
    snd_pcm_hw_params_get_period_size(hw_params, &frames, 0);
    snd_pcm_hw_params_get_period_time(hw_params, &out_period_time, 0);

    snd_pcm_hw_params_free(hw_params);

    if (AV_FAILED(res)) return res;

    output_format.channels = channels;
    output_format.ch_layout = ch_layout;
    output_format.format = AV_SAMPLE_FMT_S16;
    output_format.frame_size = channels * 16 / 8;
    output_format.mode.output = omode;
    output_format.sample_rate = sample_rate;

    out_period_size = (int)frames * output_format.frame_size;
    out_buf_size = 10 * out_period_size;
    output_fifo = av_fifo_alloc(out_buf_size);

    return res;
}

void AlsaPlayer::RenderThread()
{
    while (av_fifo_size(output_fifo) == 0) usleep(1000);

    avres res;
    int frame_size = (output_format.mode.output == OutputMode::Analog) ? output_format.frame_size : 4;
    uint8_t *dst = new uint8_t[out_buf_size];
    while (need_exit == false) {
        int sz = FFMIN(out_buf_size, av_fifo_size(output_fifo));
        int frames = sz / frame_size;
        if (sz > frame_size) {
            res = av_fifo_generic_read(output_fifo, dst, sz, nullptr);
            res = (int)snd_pcm_writei(play_handle, dst, frames);

            if (AV_FAILED(res)) {
                if (AV_FAILED(snd_pcm_recover(play_handle, res, 0))) {
                    need_exit = true;
                    SendComErrorMessage(false, res, "dest_device_error");
                    break;
                }
            }
        }
    }
    delete[]dst;
}


    


    Can I pick your brains ?

    


  • DE-10 FFMPEG Raw YCbCr 4:2:2 Frame to PNG or Video leads to bad result

    22 mai 2021, par Anouar Touati

    So i am trying to record analog video from analog-video in port of the DE10-standard board.

    


    the raw frames are 4:2:2 720x480 hence frame size should be 720*480 * 2 = 691200bytes,however i get 2 more bytes with hex value 0 at the beginning of the frametwo leading bytes.

    


    ffmpeg complains about wrong buffer size so i removed them.

    


    using ffmpeg -y -s 720x480 -pix_fmt yuv422p -i input_frame.yuv output_image.png
the result is way off.

    


    analog video fed to the board has still image (photo taken by phone from TV) Reference Pic.
and the result from ffmpeg is FFMPEG output.

    


    i used HxD editor and mirrored that single frame many times to create a larger file then used the following command to encode it to MP4 file which give the same result.

    


    ffmpeg -y -s 720x480 -pix_fmt yuv422p -i dump_video.yuv output_video.mp4.

    


    i hope someone can help to fix the issue or point me in the right direction as i dont know if the problem is from hardware or from ffmpeg command. Thnx.