Recherche avancée

Médias (39)

Mot : - Tags -/audio

Sur d’autres sites (114)

  • What is the bitrate of my audio file based on ffmpeg output ?

    21 avril 2015, par blueether

    Is it the 40kb/s under Format, or is it the 16kb/s under Stream ? What is the relationship between the Format and the Stream ?
    The below output is for a file generated using Core Audio on an iphone, with an Audio Unit. The output format was specified by an AudioStreamBasicDescription descriptor

    Updated :
    Output from ffprobe -v error -show_format -show_streams 123_1429602551009.051025.m4a :

    [STREAM]
    index=0
    codec_name=aac
    codec_long_name=AAC (Advanced Audio Coding)
    profile=LC
    codec_type=audio
    codec_time_base=1/8000
    codec_tag_string=mp4a
    codec_tag=0x6134706d
    sample_fmt=fltp
    sample_rate=8000
    channels=1
    channel_layout=mono
    bits_per_sample=0
    id=N/A
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/8000
    start_pts=0
    start_time=0.000000
    duration_ts=43008
    duration=5.376000
    bit_rate=16501
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=42
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    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
    TAG:creation_time=1970-04-16 22:36:01
    TAG:language=eng
    [/STREAM]
    [FORMAT]
    filename=123_1429602551009.051025.m4a
    nb_streams=1
    nb_programs=0
    format_name=mov,mp4,m4a,3gp,3g2,mj2
    format_long_name=QuickTime / MOV
    start_time=0.000000
    duration=5.376000
    size=27473
    bit_rate=40882
    probe_score=100
    TAG:major_brand=M4A
    TAG:minor_version=0
    TAG:compatible_brands=M4A mp42isom
    TAG:creation_time=1970-04-16 22:36:01
    TAG:iTunSMPB= 00000000 00000840 00000361 0000000000009C5F 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [/FORMAT]
  • Merge video files using Concat filter in FFmpeg

    8 juillet 2013, par vijay

    I am using FFmpeg to concat video files of different codecs in my android application.
    I read the FFmpeg documentation and tried the following things.

    1. ffmpeg -i "concat:input1.mpg|input2.mpg" -c copy output.mp4 (works only for mpg files)

    2. ffmpeg -i 1.mp4 -c copy -bsf dump_extra 1.ts
      ffmpeg -i 2.mp4 -c copy -bsf dump_extra 2.ts
      ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4 (works for mp4 files)

    I tried both the methods for 3gp files but it throws an error in stream filters.The second method stores the .ts files in device that should not be done and also i lost the quality of the video.

    When i googled it out i found that FFmpeg provides a way to concat files with different codecs.So i tried the following command to this in a single step without storing files in device.

    fmpeg -i 1.mp4 -i 2.3gp -i 3.mpg -filter_complex '[0:0] [0:1] [1:0] [1:1]
    [2:0] [2:1] concat=n=3:v=1:a=1 [a] [v] ' -map '[a]' -map '[v]' -c copy output.mp4

    It throws the following exception :

    ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
     built on Jun 25 2013 20:34:51 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
     configuration:
     libavutil      52. 18.100 / 52. 18.100
     libavcodec     54. 92.100 / 54. 92.100
     libavformat    54. 63.104 / 54. 63.104
     libavdevice    54.  3.103 / 54.  3.103
     libavfilter     3. 42.103 /  3. 42.103
     libswscale      2.  2.100 /  2.  2.100
     libswresample   0. 17.102 /  0. 17.102
    F.mp4: No such file or directory
    tsk@tsk:~/Android/Backups/android-ffmpeg-x264/Project/jni$ ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex '[0:1] [0:0] [1:1] [1:0] concat=n=2:v=1:a=1 [v] [a]' -map '[v]' -map '[a]' output.mp4
    ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
     built on Jun 25 2013 20:34:51 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
     configuration:
     libavutil      52. 18.100 / 52. 18.100
     libavcodec     54. 92.100 / 54. 92.100
     libavformat    54. 63.104 / 54. 63.104
     libavdevice    54.  3.103 / 54.  3.103
     libavfilter     3. 42.103 /  3. 42.103
     libswscale      2.  2.100 /  2.  2.100
     libswresample   0. 17.102 /  0. 17.102
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: mp41
       creation_time   : 1970-01-01 00:00:00
     Duration: 00:00:04.04, start: 0.000000, bitrate: 1457 kb/s
       Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1454 kb/s, SAR 349:320 DAR 349:240, 25 fps, 25 tbr, 25 tbn, 25 tbc
       Metadata:
         creation_time   : 1970-01-01 00:00:00
         handler_name    : VideoHandler
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: mp41
       creation_time   : 1970-01-01 00:00:00
     Duration: 00:00:04.04, start: 0.000000, bitrate: 1498 kb/s
       Stream #1:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1495 kb/s, SAR 349:320 DAR 349:240, 25 fps, 25 tbr, 25 tbn, 25 tbc
       Metadata:
         creation_time   : 1970-01-01 00:00:00
         handler_name    : VideoHandler
    Stream specifier ':1' in filtergraph description [0:1] [0:0] [1:1] [1:0] concat=n=2:v=1:a=1 [v] [a] matches no streams.

    I googled out but found no solution yet.

    Any help is appreciated.

  • Problems accessing codecs with ggplot and gganimate

    19 décembre 2016, par noLongerRandom

    Using gganimate. Can’t figure out how to properly access functionality of ffmpeg, specifically I want to change the codec I’m using in the video file I’m outputting.

    # load packages
    library(ggplot)
    library(animation)
    library(gganimate)

    # Here's my data.frame
    myDf <- data.frame(
       year = c(1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014),
       bottom50 = c(0.195, 0.191, 0.187, 0.192, 0.196, 0.205, 0.207, 0.210, 0.209, 0.204, 0.203, 0.204, 0.205, 0.203, 0.202, 0.200, 0.200, 0.201, 0.199, 0.195, 0.190, 0.183, 0.179, 0.179, 0.177, 0.172, 0.169, 0.169, 0.168, 0.166, 0.158, 0.159, 0.158, 0.154, 0.151, 0.148, 0.149, 0.148, 0.146, 0.149, 0.148, 0.145, 0.142, 0.138, 0.135, 0.137, 0.137, 0.136, 0.130, 0.127, 0.123, 0.127, 0.125), top1 = c(0.126, 0.127, 0.129, 0.128, 0.126, 0.123, 0.122, 0.115, 0.110, 0.111, 0.111, 0.109, 0.106, 0.105, 0.105, 0.107, 0.108, 0.111, 0.107, 0.110, 0.112, 0.115, 0.125, 0.125, 0.122, 0.133, 0.149, 0.145, 0.145, 0.139, 0.150, 0.146, 0.147, 0.153, 0.160, 0.166, 0.169, 0.177, 0.183, 0.173, 0.171, 0.172, 0.183, 0.194, 0.201, 0.199, 0.195, 0.185, 0.198, 0.196, 0.208, 0.196, 0.202)
    )

    #Basic plot
    p <- ggplot(myDf, aes(x = year, y = bottom50, frame = year)) +
       geom_line(color = "dodgerblue") +
       geom_line(aes(y = top1), color = "darkred")

    The non-animated version gets me what I want :

    enter image description here

    And I get an animation version output to video with :

    gganimate(p, interval = .1, title_frame = FALSE, "income.mp4")

    That’s fine, but I want to change some the output parameters, specifically : alter the dimensions, the frame rate, and use a different codec.

    # change some of the options
    ani.options(ani.height = 1080, ani.width = 1920,
               interval = 0.04166667, other.opts = "-vcodec qtrle -f mov")
    # re-animate
    gganimate(p, title_frame = FALSE, "income.mov")

    That gives me the following error :

    Error in animation_saver(saver, filename) :
     Don't know how to save animation of type mov

    I’m using ’.mov’ as my file extension because I’m trying to change to the Animation codec (so it’s no longer a .mp4 wrapper). I’ve got ffmpeg installed, so this is probably a syntax issue. But the documentation isn’t very clear here ; gganimate doesn’t have any documentation on changing codecs (or outputting any video besides an mp4), and the animation package is light on specifics as well.