Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (31)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

Sur d’autres sites (4450)

  • ffmpeg+php Add Music to video

    19 septembre 2013, par user2792392

    Dear Sir i create this code for simple video convert from one to another.
    i want to add more feature like
    ffmpeg+php Add Music to video

    how to do it ??
    convert request to begin encoding the video, and status request that retrieves
    * the current encoding status so the progress bar can be updated.
    *
    * The $outfile variable should be changed to an input value, but is set this way
    * for now for testing purposes.
    *
    * @ver 0.1
    */
    require 'config.php' ;
    require 'functions.php' ;

    //<<-- CHECK FOR ERRORS -->>//
    $type       = _chkVal('type', '');
    $fkey       = _chkVal('fkey', '');
    $infile     = _chkVal('filename', '');
    $outfile    = 'testing.mp4';
    $params     = _chkVal('params', '');

    // Check Request Type
    $validTypes = array('convert', 'status');

    if( !in_array($type, $validTypes) )
       json_response(array('fkey' => $fkey, 'msg' => 'Invalid process type!'), true);

    // $fkey will always be 8 characters.
    // It's created with PHP's hash() function using 'crc32' algorithm in index.php
    if( strlen($fkey) != 8 )
       json_response(array_merge(array('fkey' => '', 'msg' => 'Invalid fkey given!')), true);

    // Filename should be at least 5 (1 character + 4 character extension. EX : i.mp4)
    if( $type == 'convert' && ( strlen($infile) < 5) )
       json_response(array('fkey' => $fkey, 'msg' => 'Invalid input filename given!'), true);

    // Filename should be at least 5 (1 character + 4 character extension. EX : i.mp4)
    if( $type == 'convert' && ( strlen($outfile) < 5) )
       json_response(array('fkey' => $fkey, 'msg' => 'Invalid output filename given!'), true);

    if( $type == 'convert' && (strlen($params) < 1) )
       json_response(array('fkey' => $fkey, 'msg' => 'Invalid parameters given!'), true);

    //<<-- END OF ERROR CHECK -->>//


    $ffmpegConvert = new ffmpegConvert($fkey);


    //<<-- PROCESS REQUEST -->>//

    // Start the video conversion
    if( $type == 'convert' )
    {
       $ffmpegConvert->exec( $infile, $outfile, $params, $fkey );
       // Add 2 second delay to give the server time to start writing the status log,
       // otherwise $ffmpegConvert->jsonStatus() will trigger an error...
       sleep(2);
       $ffmpegConvert->jsonStatus();
    }

    // Check on video conversion progress
    if( $_POST['type'] == 'status' )
    {
       $ffmpegConvert->jsonStatus();
    }

    //<<-- END OF PROCESS REQUEST -->>//

    // Shouldn't get to this, but if so, let's send a message for debugging reasons....
    json_response(array('msg' => 'Unhandled request type!'), true);
  • Converting ffmpeg loudnorm first pass dcf summary report output to data.frame R

    23 décembre 2022, par Chris

    Following from operations on a video with ffmpeg, a loudnorm first pass report for purely audio files is produced

    


    names(aud_proc_df)
[1] "in_files" "proc_out" "filter"

cmds_loudness_report <- with(aud_proc_df, sprintf("ffmpeg -hide_banner -i %s -af loudnorm=I=-23:TP=-2:LRA=7:print_format=summary -f null /dev/null 2>&1 | tail -n 12 >> loudness_rpt_all.txt", in_files)) # linux specific notation
lapply(cmds_loudness_report, system)


    


    reading this as a .csv rather than .dcf

    


    loudness_df_csv <- read.csv('loudness_rpt_all.txt', header = FALSE, sep =':')
head(loudness_df_csv)
                 V1                  V2
1  Input Integrated          -24.7 LUFS
2   Input True Peak           -1.6 dBTP
3         Input LRA             17.9 LU
4   Input Threshold          -37.8 LUFS
5 Output Integrated          -23.4 LUFS
6  Output True Peak           -2.0 dBTP
#data
structure(list(V1 = c("Input Integrated", "Input True Peak", 
"Input LRA", "Input Threshold", "Output Integrated", "Output True Peak", 
"Output LRA", "Output Threshold", "Normalization Type", "Target Offset", 
"Input Integrated", "Input True Peak", "Input LRA", "Input Threshold", 
"Output Integrated", "Output True Peak", "Output LRA", "Output Threshold", 
"Normalization Type", "Target Offset"), V2 = c("    -24.7 LUFS", 
"      -1.6 dBTP", "            17.9 LU", "     -37.8 LUFS", 
"   -23.4 LUFS", "     -2.0 dBTP", "           14.8 LU", "    -36.2 LUFS", 
"   Dynamic", "        +0.4 LU", "    -23.9 LUFS", "      +0.2 dBTP", 
"            22.0 LU", "     -37.6 LUFS", "   -23.6 LUFS", "     -2.0 dBTP", 
"           21.9 LU", "    -37.0 LUFS", "   Dynamic", "        +0.6 LU"
)), row.names = c(NA, 20L), class = "data.frame")


    


    then, for column notation portability between win and linux systems

    


    df_names <- unique(loudness_df_csv$V1)
df_names2 <- gsub(' ', '_', df_names)


    


    and then make a data.frame

    


    loudnorm_rpt <- data.frame(loudness_df_csv$V2[which(loudness_df_csv$V1 == df_names[1])], loudness_df_csv$V2[which(loudness_df_csv$V1 == df_names[2])], loudness_df_csv$V2[which(loudness_df_csv$V1 == df_names[3])], loudness_df_csv$V2[which(loudness_df_csv$V1 == df_names[4])], loudness_df_csv$V2[which(loudness_df_csv$V1 == df_names[5])], loudness_df_csv$V2[which(loudness_df_csv$V1 == df_names[6])], loudness_df_csv$V2[which(loudness_df_csv$V1 == df_names[7])], loudness_df_csv$V2[which(loudness_df_csv$V1 == df_names[8])], loudness_df_csv$V2[which(loudness_df_csv$V1 == df_names[9])], loudness_df_csv$V2[which(loudness_df_csv$V1 == df_names[10])])
names(loudnorm_rpt) <- df_names2
rownames(loudnorm_rpt) <- c('A', 'B')


    


    Should I just wrap this in a function or is there a dcf to data.frame function that I've missed ?

    


  • pyav / ffmpeg / libav select number of P-frames and B-frames

    27 mai 2021, par user1315621

    I am streaming from an rtsp source. It looks like half of the frames received are key frames. Is there a way to reduce this percentage and have an higher number of P-frames and B-frames ? If possible, I would like to increase the number of P-frames (not the one of B-frames).
I am using pyav which is a Python wrapper for libav (ffmpeg)

    


    Code :

    


    container = av.open(
    url, 'r',
    options={
        'rtsp_transport': 'tcp',
        'stimeout': '5000000',
        'max_delay': '5000000',
    }
)
stream = container.streams.video[0]
codec_context = stream.codec_context
codec_context.export_mvs = True
codec_context.gop_size = 25  

for packet in self.container.demux(video=0):
    for video_frame in packet.decode():
        print(video_frame.is_key_frame)


    


    Output :

    


    True
False
True
False
...


    


    Note 1 : I can't edit the source. I can just edit the code used to stream the video.

    


    Note 2 : same solution should apply to pyav, libavi and ffmpeg.

    


    Edit : it seems that B-frames are disabled : codec_context.has_b_frames is False