Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (50)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

Sur d’autres sites (3019)

  • Plex DVR File Rename on FFMPEG Encoding

    11 juillet 2021, par Brent Johnson

    I'm currently using a bash shell script to encode all of my Plex DVR recordings to H.264 using FFMPEG. I'm using this little for loop I found online to encode all of the files in a single directory :

    


    for i in *.ts;
    do echo "$i" && ffmpeg -i "$i" -vf yadif -c:v libx264 -preset veryslow -crf 22 -y "/mnt/d/Video/DVR Stash/Seinfeld/${i%.*}.mp4";
done


    


    This has served its purposes well but in the process I would like to rename the file to my preferred naming convention so that the original filename Seinfeld (1989) - S01E01 - Pilot.ts is renamed to Seinfeld S01 E01 Pilot.mp4 in the encoded file. While I am already using a regular expression to change the .ts extension to .mp4, but I'm no expert with regex, especially in the bash shell so any help would be appreciated.

    


    For anyone that's interested in my Plex setup, I'm using an old machine running Linux Mint as my dedicated DVR and actually accessing it over the network with my daily driver which is a gaming machine, so more processing power for video encodes. While that one is a Windows machine, I'm using the Ubuntu bash under WSL2 to run my script, as I prefer it over the Windows command prompt or Powershell (my day job is a web developer on a company issued Mac). So here's a sample of my code for anyone that might consider doing something similar.

    


    if [[ -d "/mnt/sambashare/Seinfeld (1989)" ]]
then
    cd "/mnt/sambashare/Seinfeld (1989)"
    echo "Seinfeld"
    for dir in */; do
        echo "$dir/"
        cd "$dir"
        for i in *.ts;
            do echo "$i" && ffmpeg -i "$i" -vf yadif -c:v libx264 -preset veryslow -crf 22 -y "/mnt/d/Video/DVR Stash/Seinfeld/${i%.*}.mp4";
        done
        cd ..
    done
fi


    


    While I've considered doing a for loop for all shows, for now I am doing each show like this individually as there are a few shows I have custom encoding settings for

    


  • DivX audio not decoded on DVD player

    8 août 2019, par Shaul

    Moved to https://video.stackexchange.com/questions/28225/divx-audio-not-decoded-on-dvd-player

    I am converting MP4 movie into AVI/DivX format. I plan to copy the AVI to a USB memory stick and plug it into my DVD player. My player is a Pioneer 3052 that supports USB input.

    I convert the file using ffmpeg without error messages. The output file is played correctly on my computer, including audio. I use "Movies & TVs" and "DIVX Player" for testing.

    When I try running it on my Pioneer the video and the subtitles are ok but there’s no audio. I know that there’s no issues with the hardware because videos converted with "FreeMake Video converter" do play audio.

    My command line is :

    .\ffmpeg.exe  "-i INFILE -c:v mpeg4 -vtag xvid -qscale:v 3 -c:a libmp3lame  -vf "scale=720:576:force_original_aspect_ratio=decrease,pad=720:576:(ow-iw)/2:(oh-ih)/2","subtitles=f=SRTFILE:charenc=ISO-8859-8:force_style=PrimaryColour=&H0000FFFF,Fontsize=16" OUTFILE

    I also experimented with -b:a 192k, -b:a 96k and -qscale:a 4 all leading to the same results.

    I wander what else to try.
    I add the report produced by ffprobe (for the output file) :

    [STREAM]
    index=0
    codec_name=mpeg4
    codec_long_name=MPEG-4 part 2
    profile=Simple Profile
    codec_type=video
    codec_time_base=1001/24000
    codec_tag_string=xvid
    codec_tag=0x64697678
    width=720
    height=576
    coded_width=720
    coded_height=576
    has_b_frames=0
    sample_aspect_ratio=1:1
    display_aspect_ratio=5:4
    pix_fmt=yuv420p
    level=1
    color_range=unknown
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=left
    field_order=unknown
    timecode=N/A
    refs=1
    quarter_sample=false
    divx_packed=false
    id=N/A
    r_frame_rate=24000/1001
    avg_frame_rate=24000/1001
    time_base=1001/24000
    start_pts=0
    start_time=0.000000
    duration_ts=163203
    duration=6806.925125
    bit_rate=1243432
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=163203
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    [/STREAM]
    [STREAM]
    index=1
    codec_name=mp3
    codec_long_name=MP3 (MPEG audio layer 3)
    profile=unknown
    codec_type=audio
    codec_time_base=1/48000
    codec_tag_string=U[0][0][0]
    codec_tag=0x0055
    sample_fmt=fltp
    sample_rate=48000
    channels=2
    channel_layout=stereo
    bits_per_sample=0
    id=N/A
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=3/125
    start_pts=0
    start_time=0.000000
    duration_ts=283622
    duration=6806.928000
    bit_rate=192000
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=283622
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    [/STREAM]
    [FORMAT]
    filename=H:\Movies\Memento.avi
    nb_streams=2
    nb_programs=0
    format_name=avi
    format_long_name=AVI (Audio Video Interleaved)
    start_time=0.000000
    duration=6806.928000
    size=1235006020
    bit_rate=1451469
    probe_score=100
    TAG:encoder=Lavf58.20.100
    [/FORMAT]

    EDIT :
    I add an example of a movie that is OK on this DVD player :

    [STREAM]
    index=0
    codec_name=mpeg4
    codec_long_name=MPEG-4 part 2
    profile=Advanced Simple Profile
    codec_type=video
    codec_time_base=1001/24000
    codec_tag_string=XVID
    codec_tag=0x44495658
    width=576
    height=432
    coded_width=576
    coded_height=432
    has_b_frames=1
    sample_aspect_ratio=1:1
    display_aspect_ratio=4:3
    pix_fmt=yuv420p
    level=5
    color_range=unknown
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=left
    field_order=unknown
    timecode=N/A
    refs=1
    quarter_sample=false
    divx_packed=false
    id=N/A
    r_frame_rate=24000/1001
    avg_frame_rate=24000/1001
    time_base=1001/24000
    start_pts=0
    start_time=0.000000
    duration_ts=134521
    duration=5610.646708
    bit_rate=943851
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=134521
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    [/STREAM]
    [STREAM]
    index=1
    codec_name=mp3
    codec_long_name=MP3 (MPEG audio layer 3)
    profile=unknown
    codec_type=audio
    codec_time_base=1/48000
    codec_tag_string=U[0][0][0]
    codec_tag=0x0055
    sample_fmt=fltp
    sample_rate=48000
    channels=2
    channel_layout=stereo
    bits_per_sample=0
    id=N/A
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=3/125
    start_pts=0
    start_time=0.000000
    duration_ts=233777
    duration=5610.648000
    bit_rate=91176
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=233777
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    [/STREAM]
    [FORMAT]
    filename=H:\Honey.I.Shrunk.The.Kids.1989.FS.DVDRip.XViD.iNT-EwDp.HebSub.www.Moridim.tv.avi
    nb_streams=2
    nb_programs=0
    format_name=avi
    format_long_name=AVI (Audio Video Interleaved)
    start_time=0.000000
    duration=5610.648000
    size=734808064
    bit_rate=1047733
    probe_score=100
    TAG:encoder=VirtualDubMod 1.5.10.2 (build 2540/release)
    [/FORMAT]
  • why AVFrame pts value doesn't affect bitrate of frames ?

    31 janvier 2021, par fsdfhdsjkhfjkds

    I'm trying code realtime screen sharing I noticed H264 codec doesn't do constant time encode for every frame. That causes being not able to encode exact same amount frame rate with context->time_base. When we encode less frames per second than time_base bitrate of second becomes lower than what we set.

    


    I modified libav's example encode code and put 1/1000 time base and supply it with only 10 frame. I increase frame->pts related with time_base but bitrates still stay at low.

    


    For results I just change context->time_base to 1, 1000, 1, 10 etc

    


    1/1000 time base (as sum 1989 bytes per second) :

    


    encoded frame 0 (size=1169)
encoded frame 100 (size=95)
encoded frame 200 (size=92)
encoded frame 300 (size=102)
encoded frame 400 (size=90)
encoded frame 500 (size=90)
encoded frame 600 (size=90)
encoded frame 700 (size=83)
encoded frame 800 (size=95)
encoded frame 900 (size=83)


    


    1/10 time base (as sum 95324 bytes per second) :

    


    encoded frame 0 (size=14187)
encoded frame 1 (size=6053)
encoded frame 2 (size=8530)
encoded frame 3 (size=9277)
encoded frame 4 (size=9508)
encoded frame 5 (size=11163)
encoded frame 6 (size=9685)
encoded frame 7 (size=9346)
encoded frame 8 (size=7662)
encoded frame 9 (size=9913)


    


    code :

    


    #include &#xA;#include &#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;&#xA;static void encode(AVCodecContext *context, AVFrame *frame, AVPacket *pkt, FILE *outfile){&#xA;    int ret = avcodec_send_frame(context, frame);&#xA;    assert(ret >= 0);&#xA;    while(ret >= 0){&#xA;        ret = avcodec_receive_packet(context, pkt);&#xA;        if(ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)&#xA;            return;&#xA;        else if(ret &lt; 0)&#xA;            assert(0);&#xA;        printf("encoded frame %lld (size=%d)\n", pkt->pts, pkt->size);&#xA;        fwrite(pkt->data, 1, pkt->size, outfile);&#xA;        av_packet_unref(pkt);&#xA;    }&#xA;}&#xA;&#xA;int main(int argc, char **argv){&#xA;    if(argc &lt;= 1){&#xA;        fprintf(stderr, "Usage: %s <output file="file">\n", argv[0]);&#xA;        exit(0);&#xA;    }&#xA;    av_log_set_level(AV_LOG_QUIET);&#xA;    const char *filename = argv[1];&#xA;    const AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;    assert(codec);&#xA;    AVCodecContext *context = avcodec_alloc_context3(codec);&#xA;    assert(context);&#xA;    AVFrame *frame = av_frame_alloc();&#xA;    assert(frame);&#xA;    AVPacket *pkt = av_packet_alloc();&#xA;    assert(pkt);&#xA;    context->bit_rate = 800000;&#xA;    context->width = 1280;&#xA;    context->height = 720;&#xA;    context->time_base = (AVRational){1, 1000};&#xA;    context->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;    AVDictionary *dict = 0;&#xA;    assert(av_dict_set(&amp;dict, "preset", "veryfast", 0) >= 0);&#xA;    assert(av_dict_set(&amp;dict, "tune", "zerolatency", 0) >= 0);&#xA;    assert(avcodec_open2(context, codec, &amp;dict) >= 0);&#xA;    FILE *f = fopen(filename, "wb");&#xA;    assert(f);&#xA;    frame->format = context->pix_fmt;&#xA;    frame->width  = context->width;&#xA;    frame->height = context->height;&#xA;    assert(av_frame_get_buffer(frame, 0) >= 0);&#xA;    for(int i = 0; i &lt; 10; i&#x2B;&#x2B;){&#xA;        for(int y = 0; y &lt; context->height; y&#x2B;&#x2B;){&#xA;            for(int x = 0; x &lt; context->width; x&#x2B;&#x2B;){&#xA;                frame->data[0][y * frame->linesize[0] &#x2B; x] = x &#x2B; y &#x2B; i * 3;&#xA;            }&#xA;        }&#xA;        for(int y = 0; y &lt; context->height / 2; y&#x2B;&#x2B;){&#xA;            for(int x = 0; x &lt; context->width / 2; x&#x2B;&#x2B;){&#xA;                frame->data[1][y * frame->linesize[1] &#x2B; x] = 128 &#x2B; y &#x2B; i * 2;&#xA;                frame->data[2][y * frame->linesize[2] &#x2B; x] = 64 &#x2B; x &#x2B; i * 5;&#xA;            }&#xA;        }&#xA;        frame->pts = i * (context->time_base.den / 10);&#xA;        encode(context, frame, pkt, f);&#xA;    }&#xA;    fclose(f);&#xA;    avcodec_free_context(&amp;context);&#xA;    av_frame_free(&amp;frame);&#xA;    av_packet_free(&amp;pkt);&#xA;    return 0;&#xA;}&#xA;</output>

    &#xA;

    How we can keep right bitrate with different time_base than frame rate ?

    &#xA;