Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (105)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

Sur d’autres sites (9740)

  • HTTP Livestreaming with ffmpeg

    12 décembre 2020, par Hugo

    Some context : I have an MKV file, I am attempting to stream it to http://localhost:8090/test.flv as an flv file.

    



    The stream begins and then immediately ends.

    



    The command I am using is :

    



    sudo ffmpeg -re -i input.mkv -c:v libx264 -maxrate 1000k -bufsize 2000k -an -bsf:v h264_mp4toannexb -g 50 http://localhost:8090/test.flv


    



    A breakdown of what I believe these options do incase this post becomes useful for someone else :

    



    sudo


    



    Run as root

    



    ffmpeg


    



    The stream command thingy

    



    -re


    



    Stream in real-time

    



    -i input.mkv


    



    Input option and path to input file

    



    -c:v libx264


    



    Use codec libx264 for conversion

    



    -maxrate 1000k -bufsize 2000k


    



    No idea, some options for conversion, seems to help

    



    -an -bsf:v h264_mp4toannexb


    



    Audio options I think, not sure really. Also seems to help

    



    -g 50


    



    Still no idea, maybe frame rateframerateframerateframerate ?

    



    http://localhost:8090/test.flv


    



    Output using http protocol to localhost on port 8090 as a file called test.flv

    



    Anyway the actual issue I have is that it begins to stream for about a second and then immediately ends.

    



    The mpeg command result :

    



    ffmpeg version N-80901-gfebc862 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, matroska,webm, from 'input.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.0
    creation_time   : 1970-01-01 00:00:02
  Duration: 00:01:32.26, start: 0.000000, bitrate: 4432 kb/s
    Stream #0:0(eng): Video: h264 (High 10), yuv420p10le, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(nor): Audio: flac, 48000 Hz, stereo, s16 (default)
[libx264 @ 0x2e1c380] using SAR=1/1
[libx264 @ 0x2e1c380] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x2e1c380] profile High, level 4.0
[libx264 @ 0x2e1c380] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=50 keyint_min=5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1000 vbv_bufsize=2000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
[flv @ 0x2e3f0a0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, flv, to 'http://localhost:8090/test.flv':
  Metadata:
    encoder         : Lavf57.41.100
    Stream #0:0(eng): Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 23.98 fps, 1k tbn, 23.98 tbc (default)
    Metadata:
      encoder         : Lavc57.48.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 1000000/0/0 buffer size: 2000000 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
Killed   26 fps= 26 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x  


    



    The ffserver outputs :

    



    Sat Aug 20 12:40:11 2016 File '/test.flv' not found
Sat Aug 20 12:40:11 2016 [SERVER IP] - - [POST] "/test.flv HTTP/1.1" 404 189


    



    The config file is :

    



    #Sample ffserver configuration file&#xA;&#xA;# Port on which the server is listening. You must select a different&#xA;# port from your standard HTTP web server if it is running on the same&#xA;# computer.&#xA;Port 8090&#xA;&#xA;# Address on which the server is bound. Only useful if you have&#xA;# several network interfaces.&#xA;BindAddress 0.0.0.0&#xA;&#xA;# Number of simultaneous HTTP connections that can be handled. It has&#xA;# to be defined *before* the MaxClients parameter, since it defines the&#xA;# MaxClients maximum limit.&#xA;MaxHTTPConnections 2000&#xA;&#xA;# Number of simultaneous requests that can be handled. Since FFServer&#xA;# is very fast, it is more likely that you will want to leave this high&#xA;# and use MaxBandwidth, below.&#xA;MaxClients 1000&#xA;&#xA;# This the maximum amount of kbit/sec that you are prepared to&#xA;# consume when streaming to clients.&#xA;MaxBandwidth 1000&#xA;&#xA;# Access log file (uses standard Apache log file format)&#xA;# &#x27;-&#x27; is the standard output.&#xA;CustomLog -&#xA;&#xA;# Suppress that if you want to launch ffserver as a daemon.&#xA;#NoDaemon&#xA;&#xA;&#xA;##################################################################&#xA;# Definition of the live feeds. Each live feed contains one video&#xA;# and/or audio sequence coming from an ffmpeg encoder or another&#xA;# ffserver. This sequence may be encoded simultaneously with several&#xA;# codecs at several resolutions.&#xA;&#xA;<feed>&#xA;&#xA;ACL allow 192.168.0.0 192.168.255.255&#xA;&#xA;# You must use &#x27;ffmpeg&#x27; to send a live feed to ffserver. In this&#xA;# example, you can type:&#xA;#&#xA;#ffmpeg http://localhost:8090/test.ffm&#xA;&#xA;# ffserver can also do time shifting. It means that it can stream any&#xA;# previously recorded live stream. The request should contain:&#xA;# "http://xxxx?date=[YYYY-MM-DDT][[HH:]MM:]SS[.m...]".You must specify&#xA;# a path where the feed is stored on disk. You also specify the&#xA;# maximum size of the feed, where zero means unlimited. Default:&#xA;# File=/tmp/feed_name.ffm FileMaxSize=5M&#xA;File /tmp/feed1.ffm&#xA;FileMaxSize 200m&#xA;&#xA;# You could specify&#xA;# ReadOnlyFile /saved/specialvideo.ffm&#xA;# This marks the file as readonly and it will not be deleted or updated.&#xA;&#xA;# Specify launch in order to start ffmpeg automatically.&#xA;# First ffmpeg must be defined with an appropriate path if needed,&#xA;# after that options can follow, but avoid adding the http:// field&#xA;#Launch ffmpeg&#xA;&#xA;# Only allow connections from localhost to the feed.&#xA;    ACL allow 127.0.0.1&#xA;&#xA;</feed>&#xA;&#xA;&#xA;##################################################################&#xA;# Now you can define each stream which will be generated from the&#xA;# original audio and video stream. Each format has a filename (here&#xA;# &#x27;test1.mpg&#x27;). FFServer will send this stream when answering a&#xA;# request containing this filename.&#xA;&#xA;<stream>&#xA;&#xA;# coming from live feed &#x27;feed1&#x27;&#xA;Feed feed1.ffm&#xA;&#xA;# Format of the stream : you can choose among:&#xA;# mpeg       : MPEG-1 multiplexed video and audio&#xA;# mpegvideo  : only MPEG-1 video&#xA;# mp2        : MPEG-2 audio (use AudioCodec to select layer 2 and 3 codec)&#xA;# ogg        : Ogg format (Vorbis audio codec)&#xA;# rm         : RealNetworks-compatible stream. Multiplexed audio and video.&#xA;# ra         : RealNetworks-compatible stream. Audio only.&#xA;# mpjpeg     : Multipart JPEG (works with Netscape without any plugin)&#xA;# jpeg       : Generate a single JPEG image.&#xA;# asf        : ASF compatible streaming (Windows Media Player format).&#xA;# swf        : Macromedia Flash compatible stream&#xA;# avi        : AVI format (MPEG-4 video, MPEG audio sound)&#xA;Format mpeg&#xA;&#xA;# Bitrate for the audio stream. Codecs usually support only a few&#xA;# different bitrates.&#xA;AudioBitRate 32&#xA;&#xA;# Number of audio channels: 1 = mono, 2 = stereo&#xA;AudioChannels 2&#xA;&#xA;# Sampling frequency for audio. When using low bitrates, you should&#xA;# lower this frequency to 22050 or 11025. The supported frequencies&#xA;# depend on the selected audio codec.&#xA;AudioSampleRate 44100&#xA;&#xA;# Bitrate for the video stream&#xA;VideoBitRate 64&#xA;&#xA;# Ratecontrol buffer size&#xA;VideoBufferSize 40&#xA;&#xA;# Number of frames per second&#xA;VideoFrameRate 3&#xA;&#xA;# Size of the video frame: WxH (default: 160x128)&#xA;# The following abbreviations are defined: sqcif, qcif, cif, 4cif, qqvga,&#xA;# qvga, vga, svga, xga, uxga, qxga, sxga, qsxga, hsxga, wvga, wxga, wsxga,&#xA;# wuxga, woxga, wqsxga, wquxga, whsxga, whuxga, cga, ega, hd480, hd720,&#xA;# hd1080&#xA;VideoSize hd1080&#xA;&#xA;# Transmit only intra frames (useful for low bitrates, but kills frame rate).&#xA;#VideoIntraOnly&#xA;&#xA;# If non-intra only, an intra frame is transmitted every VideoGopSize&#xA;# frames. Video synchronization can only begin at an intra frame.&#xA;VideoGopSize 12&#xA;&#xA;# More MPEG-4 parameters&#xA;# VideoHighQuality&#xA;# Video4MotionVector&#xA;&#xA;# Choose your codecs:&#xA;#AudioCodec mp2&#xA;#VideoCodec mpeg1video&#xA;&#xA;# Suppress audio&#xA;#NoAudio&#xA;&#xA;# Suppress video&#xA;#NoVideo&#xA;&#xA;#VideoQMin 3&#xA;#VideoQMax 31&#xA;&#xA;# Set this to the number of seconds backwards in time to start. Note that&#xA;# most players will buffer 5-10 seconds of video, and also you need to allow&#xA;# for a keyframe to appear in the data stream.&#xA;#Preroll 15&#xA;&#xA;# ACL:&#xA;&#xA;# You can allow ranges of addresses (or single addresses)&#xA;ACL ALLOW localhost&#xA;&#xA;# You can deny ranges of addresses (or single addresses)&#xA;#ACL DENY <first address="address"> &#xA;&#xA;# You can repeat the ACL allow/deny as often as you like. It is on a per&#xA;# stream basis. The first match defines the action. If there are no matches,&#xA;# then the default is the inverse of the last ACL statement.&#xA;#&#xA;# Thus &#x27;ACL allow localhost&#x27; only allows access from localhost.&#xA;# &#x27;ACL deny 1.0.0.0 1.255.255.255&#x27; would deny the whole of network 1 and&#xA;# allow everybody else.&#xA;&#xA;</first></stream>&#xA;&#xA;&#xA;##################################################################&#xA;# Example streams&#xA;&#xA;&#xA;# Multipart JPEG&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format mpjpeg&#xA;#VideoFrameRate 2&#xA;#VideoIntraOnly&#xA;#NoAudio&#xA;#Strict -1&#xA;#</stream>&#xA;&#xA;&#xA;# Single JPEG&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format jpeg&#xA;#VideoFrameRate 2&#xA;#VideoIntraOnly&#xA;##VideoSize 352x240&#xA;#NoAudio&#xA;#Strict -1&#xA;#</stream>&#xA;&#xA;&#xA;# Flash&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format swf&#xA;#VideoFrameRate 2&#xA;#VideoIntraOnly&#xA;#NoAudio&#xA;#</stream>&#xA;&#xA;&#xA;# ASF compatible&#xA;&#xA;<stream>&#xA;Feed feed1.ffm&#xA;Format asf&#xA;VideoFrameRate 15&#xA;VideoSize 352x240&#xA;VideoBitRate 256&#xA;VideoBufferSize 40&#xA;VideoGopSize 30&#xA;AudioBitRate 64&#xA;StartSendOnKey&#xA;</stream>&#xA;&#xA;&#xA;# MP3 audio&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format mp2&#xA;#AudioCodec mp3&#xA;#AudioBitRate 64&#xA;#AudioChannels 1&#xA;#AudioSampleRate 44100&#xA;#NoVideo&#xA;#</stream>&#xA;&#xA;&#xA;# Ogg Vorbis audio&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Title "Stream title"&#xA;#AudioBitRate 64&#xA;#AudioChannels 2&#xA;#AudioSampleRate 44100&#xA;#NoVideo&#xA;#</stream>&#xA;&#xA;&#xA;# Real with audio only at 32 kbits&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format rm&#xA;#AudioBitRate 32&#xA;#NoVideo&#xA;#NoAudio&#xA;#</stream>&#xA;&#xA;&#xA;# Real with audio and video at 64 kbits&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format rm&#xA;#AudioBitRate 32&#xA;#VideoBitRate 128&#xA;#VideoFrameRate 25&#xA;#VideoGopSize 25&#xA;#NoAudio&#xA;#</stream>&#xA;&#xA;&#xA;##################################################################&#xA;# A stream coming from a file: you only need to set the input&#xA;# filename and optionally a new format. Supported conversions:&#xA;#    AVI -> ASF&#xA;&#xA;#<stream>&#xA;#File "/usr/local/httpd/htdocs/tlive.rm"&#xA;#NoAudio&#xA;#</stream>&#xA;&#xA;#<stream>&#xA;#File "/usr/local/httpd/htdocs/test.asf"&#xA;#NoAudio&#xA;#Author "Me"&#xA;#Copyright "Super MegaCorp"&#xA;#Title "Test stream from disk"&#xA;#Comment "Test comment"&#xA;#</stream>&#xA;&#xA;&#xA;##################################################################&#xA;# RTSP examples&#xA;#&#xA;# You can access this stream with the RTSP URL:&#xA;#   rtsp://localhost:5454/test1-rtsp.mpg&#xA;#&#xA;# A non-standard RTSP redirector is also created. Its URL is:&#xA;#   http://localhost:8090/test1-rtsp.rtsp&#xA;&#xA;#<stream>&#xA;#Format rtp&#xA;#File "/usr/local/httpd/htdocs/test1.mpg"&#xA;#</stream>&#xA;&#xA;&#xA;# Transcode an incoming live feed to another live feed,&#xA;# using libx264 and video presets&#xA;&#xA;#<stream>&#xA;#Format rtp&#xA;#Feed feed1.ffm&#xA;#VideoCodec libx264&#xA;#VideoFrameRate 24&#xA;#VideoBitRate 100&#xA;#VideoSize 480x272&#xA;#AVPresetVideo default&#xA;#AVPresetVideo baseline&#xA;#AVOptionVideo flags &#x2B;global_header&#xA;#&#xA;#AudioCodec libfaac&#xA;#AudioBitRate 32&#xA;#AudioChannels 2&#xA;#AudioSampleRate 22050&#xA;#AVOptionAudio flags &#x2B;global_header&#xA;#</stream>&#xA;&#xA;##################################################################&#xA;# SDP/multicast examples&#xA;#&#xA;# If you want to send your stream in multicast, you must set the&#xA;# multicast address with MulticastAddress. The port and the TTL can&#xA;# also be set.&#xA;#&#xA;# An SDP file is automatically generated by ffserver by adding the&#xA;# &#x27;sdp&#x27; extension to the stream name (here&#xA;# http://localhost:8090/test1-sdp.sdp). You should usually give this&#xA;# file to your player to play the stream.&#xA;#&#xA;# The &#x27;NoLoop&#x27; option can be used to avoid looping when the stream is&#xA;# terminated.&#xA;&#xA;#<stream>&#xA;#Format rtp&#xA;#File "/usr/local/httpd/htdocs/test1.mpg"&#xA;#MulticastAddress 224.124.0.1&#xA;#MulticastPort 5000&#xA;#MulticastTTL 16&#xA;#NoLoop&#xA;#</stream>&#xA;&#xA;&#xA;##################################################################&#xA;# Special streams&#xA;&#xA;# Server status&#xA;&#xA;<stream>&#xA;Format status&#xA;&#xA;# Only allow local people to get the status&#xA;ACL allow localhost&#xA;ACL allow 192.168.0.0 192.168.255.255&#xA;&#xA;#FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico&#xA;</stream>&#xA;&#xA;&#xA;# Redirect index.html to the appropriate site&#xA;&#xA;<redirect>&#xA;URL http://www.ffmpeg.org/&#xA;</redirect>&#xA;&#xA;&#xA;#http://www.ffmpeg.org/&#xA;

    &#xA;&#xA;

    Any help is greatly appreciated, I will do my best draw a picture of the best answer based on their username.

    &#xA;

  • Invalid data stream in media could not be discarded by FFMPEG. Why is it staying and how to discard it ?

    5 décembre 2020, par Link-akro

    I have downloaded a [short media][1] i intend to convert then i will use the result as basis to practice and test any and all FFMPEG commands i learn or use later.

    &#xA;

    That video seems to have an unknown invalid stream which never disappears no matter everything i tried to discard it. When i try to work with it later i get various problems like missing codec or no stream which is not the focus here but the reason why i got stubborn to remove the things i cannot deal with.

    &#xA;

    The following probing prints a warning in yellow color on last row.

    &#xA;

     > ffprobe -hide_banner -show_streams Movie_Countdown-youtube_I1vMKZ1kvg0.mov&#xA;&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;Movie_Countdown-youtube_I1vMKZ1kvg0.mov&#x27;:&#xA;  Metadata:&#xA;    major_brand     : qt&#xA;    minor_version   : 537199360&#xA;    compatible_brands: qt&#xA;    creation_time   : 2015-05-20T13:45:55.000000Z&#xA;  Duration: 00:00:10.00, start: 0.000000, bitrate: 11474 kb/s&#xA;    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 9930 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2015-05-20T13:45:55.000000Z&#xA;      handler_name    : Apple Video Media Handler&#xA;      encoder         : H.264&#xA;      timecode        : 00:00:00:00&#xA;    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2015-05-20T13:45:56.000000Z&#xA;      handler_name    : Apple Sound Media Handler&#xA;      timecode        : 00:00:00:00&#xA;    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2015-05-20T13:46:11.000000Z&#xA;      handler_name    : Time Code Media Handler&#xA;      timecode        : 00:00:00:00&#xA;Unsupported codec with id 0 for input stream 2&#xA;

    &#xA;

    Below the streams output. I split the text so you see the warning without searching in the middle.

    &#xA;

    [STREAM]&#xA;index=0&#xA;codec_name=h264&#xA;codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10&#xA;profile=Main&#xA;codec_type=video&#xA;codec_time_base=1/50&#xA;codec_tag_string=avc1&#xA;codec_tag=0x31637661&#xA;width=1920&#xA;height=1080&#xA;coded_width=1920&#xA;coded_height=1088&#xA;closed_captions=0&#xA;has_b_frames=0&#xA;sample_aspect_ratio=1:1&#xA;display_aspect_ratio=16:9&#xA;pix_fmt=yuv420p&#xA;level=40&#xA;color_range=tv&#xA;color_space=bt709&#xA;color_transfer=bt709&#xA;color_primaries=bt709&#xA;chroma_location=left&#xA;field_order=unknown&#xA;timecode=N/A&#xA;refs=1&#xA;is_avc=true&#xA;nal_length_size=4&#xA;id=N/A&#xA;r_frame_rate=25/1&#xA;avg_frame_rate=25/1&#xA;time_base=1/25&#xA;start_pts=0&#xA;start_time=0.000000&#xA;duration_ts=250&#xA;duration=10.000000&#xA;bit_rate=9930739&#xA;max_bit_rate=N/A&#xA;bits_per_raw_sample=8&#xA;nb_frames=250&#xA;nb_read_frames=N/A&#xA;nb_read_packets=N/A&#xA;DISPOSITION:default=1&#xA;DISPOSITION:dub=0&#xA;DISPOSITION:original=0&#xA;DISPOSITION:comment=0&#xA;DISPOSITION:lyrics=0&#xA;DISPOSITION:karaoke=0&#xA;DISPOSITION:forced=0&#xA;DISPOSITION:hearing_impaired=0&#xA;DISPOSITION:visual_impaired=0&#xA;DISPOSITION:clean_effects=0&#xA;DISPOSITION:attached_pic=0&#xA;DISPOSITION:timed_thumbnails=0&#xA;TAG:creation_time=2015-05-20T13:45:55.000000Z&#xA;TAG:language=eng&#xA;TAG:handler_name=Apple Video Media Handler&#xA;TAG:encoder=H.264&#xA;TAG:timecode=00:00:00:00&#xA;[/STREAM]&#xA;[STREAM]&#xA;index=1&#xA;codec_name=pcm_s16le&#xA;codec_long_name=PCM signed 16-bit little-endian&#xA;profile=unknown&#xA;codec_type=audio&#xA;codec_time_base=1/48000&#xA;codec_tag_string=sowt&#xA;codec_tag=0x74776f73&#xA;sample_fmt=s16&#xA;sample_rate=48000&#xA;channels=2&#xA;channel_layout=stereo&#xA;bits_per_sample=16&#xA;id=N/A&#xA;r_frame_rate=0/0&#xA;avg_frame_rate=0/0&#xA;time_base=1/48000&#xA;start_pts=0&#xA;start_time=0.000000&#xA;duration_ts=480000&#xA;duration=10.000000&#xA;bit_rate=1536000&#xA;max_bit_rate=N/A&#xA;bits_per_raw_sample=N/A&#xA;nb_frames=480000&#xA;nb_read_frames=N/A&#xA;nb_read_packets=N/A&#xA;DISPOSITION:default=1&#xA;DISPOSITION:dub=0&#xA;DISPOSITION:original=0&#xA;DISPOSITION:comment=0&#xA;DISPOSITION:lyrics=0&#xA;DISPOSITION:karaoke=0&#xA;DISPOSITION:forced=0&#xA;DISPOSITION:hearing_impaired=0&#xA;DISPOSITION:visual_impaired=0&#xA;DISPOSITION:clean_effects=0&#xA;DISPOSITION:attached_pic=0&#xA;DISPOSITION:timed_thumbnails=0&#xA;TAG:creation_time=2015-05-20T13:45:56.000000Z&#xA;TAG:language=eng&#xA;TAG:handler_name=Apple Sound Media Handler&#xA;TAG:timecode=00:00:00:00&#xA;[/STREAM]&#xA;[STREAM]&#xA;index=2&#xA;codec_name=unknown&#xA;codec_long_name=unknown&#xA;profile=unknown&#xA;codec_type=data&#xA;codec_tag_string=tmcd&#xA;codec_tag=0x64636d74&#xA;id=N/A&#xA;r_frame_rate=0/0&#xA;avg_frame_rate=25/1&#xA;time_base=1/25&#xA;start_pts=0&#xA;start_time=0.000000&#xA;duration_ts=250&#xA;duration=10.000000&#xA;bit_rate=3&#xA;max_bit_rate=N/A&#xA;bits_per_raw_sample=N/A&#xA;nb_frames=1&#xA;nb_read_frames=N/A&#xA;nb_read_packets=N/A&#xA;DISPOSITION:default=1&#xA;DISPOSITION:dub=0&#xA;DISPOSITION:original=0&#xA;DISPOSITION:comment=0&#xA;DISPOSITION:lyrics=0&#xA;DISPOSITION:karaoke=0&#xA;DISPOSITION:forced=0&#xA;DISPOSITION:hearing_impaired=0&#xA;DISPOSITION:visual_impaired=0&#xA;DISPOSITION:clean_effects=0&#xA;DISPOSITION:attached_pic=0&#xA;DISPOSITION:timed_thumbnails=0&#xA;TAG:creation_time=2015-05-20T13:46:11.000000Z&#xA;TAG:language=eng&#xA;TAG:handler_name=Time Code Media Handler&#xA;TAG:timecode=00:00:00:00&#xA;[/STREAM]&#xA;

    &#xA;

    I scaled it down and recoded it for starters and i tried to discard the data stream with -dn and failed other methods i will mention at the end.&#xA;The output so far suggests that discarding should have worked since alternative datas are 0kB and no stream 2 is listed.

    &#xA;

     > ffmpeg -hide_banner -dn -i C:\Users\admin-dix\Downloads\Movie_Countdown-youtube_I1vMKZ1kvg0.mov -vf "scale=h=450:w=800" -f mp4 -c:a aac -c:v libx264 mov_countdown.mp4&#xA;&#xA;Output #0, mp4, to &#x27;mov_countdown.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : qt&#xA;    minor_version   : 537199360&#xA;    compatible_brands: qt&#xA;    encoder         : Lavf58.45.100&#xA;    Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 800x450 [SAR 1:1 DAR 16:9], q=-1--1, 0.04 fps, 12800 tbn, 25 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2015-05-20T13:45:55.000000Z&#xA;      handler_name    : Apple Video Media Handler&#xA;      timecode        : 00:00:00:00&#xA;      encoder         : Lavc58.91.100 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A&#xA;    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2015-05-20T13:45:56.000000Z&#xA;      handler_name    : Apple Sound Media Handler&#xA;      timecode        : 00:00:00:00&#xA;      encoder         : Lavc58.91.100 aac&#xA;frame=  250 fps= 43 q=-1.0 Lsize=     342kB time=00:00:10.00 bitrate= 280.1kbits/s speed= 1.7x&#xA;video:175kB audio:159kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.710857%&#xA;

    &#xA;

    Then ffprobe disagrees, there is still the stream and the warning.

    &#xA;

    ffprobe mov_countdown.mp4&#xA;&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;mov_countdown.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.45.100&#xA;  Duration: 00:00:10.02, start: 0.000000, bitrate: 279 kb/s&#xA;    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x450 [SAR 1:1 DAR 16:9], 142 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : Apple Video Media Handler&#xA;      timecode        : 00:00:00:00&#xA;    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default)&#xA;    Metadata:&#xA;      handler_name    : Apple Sound Media Handler&#xA;    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s&#xA;    Metadata:&#xA;      handler_name    : Apple Video Media Handler&#xA;      timecode        : 00:00:00:00&#xA;Unsupported codec with id 0 for input stream 2&#xA;

    &#xA;

    I tried negative mapping as per this answer -map 0:d which failed. I did not understand -discard option as ffmpeg documentation refers to from the -vn,-an,-dn entries as it does not specify a stream.

    &#xA;

    Why does it do that and how can i remove that stream i do not know and do not want to care about in future tests ?

    &#xA;

    [1] : Clean Retro Movie Countdown - YouTube from Philippe Moesch https://www.youtube.com/watch?v=I1vMKZ1kvg0

    &#xA;

  • ALSA buffer xrun induced by low quality source in ffmpeg capture

    8 janvier 2021, par Peter Becich

    I am attempting to transfer some old Video 8 tapes to my computer, though an EasyCap USB stick and the motherboard's sound line-in, on Ubuntu. I believe the arguments are correctly laid out below to capture from two independent streams, and encode them both into the output MP4 file.

    &#xA;&#xA;

    Edit :

    &#xA;&#xA;

    I can simplify the question a bit, now.

    &#xA;&#xA;

    ALSA buffer overrun (or underrun ?) is induced by the unreliable/noisy audio source. For instance, if ffmpeg captures the beginning of tape playback, this causes "buffer xrun" far beyond when the tape gets up to speed and playback should be normal.

    &#xA;&#xA;

    It is interesting that the bitrate shown in the ffmpeg log shoots up higher than normal when it's producing a garbage output ! (Is this bitrate a sum of of audio and video bitrates ?)

    &#xA;&#xA;

    I've tried a couple of audio encoding codecs, and had the same problem.

    &#xA;&#xA;

    Using libfdk_aac :

    &#xA;&#xA;

      Metadata:&#xA;    encoder         : Lavf56.15.102&#xA;    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 640x480, q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc&#xA;    Metadata:&#xA;      encoder         : Lavc56.13.100 libx264&#xA;    Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, mono, s16, 128 kb/s&#xA;    Metadata:&#xA;      encoder         : Lavc56.13.100 libfdk_aac&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))&#xA;  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (libfdk_aac))&#xA;[alsa @ 0x22038a0] ALSA buffer xrun.  0kB time=00:00:00.00 bitrate=N/A    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.1934kB time=00:00:02.76 bitrate=5723.5kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.4795kB time=00:00:05.49 bitrate=7150.1kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.7668kB time=00:00:08.21 bitrate=7646.1kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.1475kB time=00:00:10.94 bitrate=8588.9kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.3822kB time=00:00:13.66 bitrate=8289.0kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.5388kB time=00:00:16.38 bitrate=7695.0kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.6896kB time=00:00:19.10 bitrate=7244.0kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.8980kB time=00:00:21.84 bitrate=7118.8kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.2032kB time=00:00:24.55 bitrate=7349.3kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.4612kB time=00:00:27.27 bitrate=7391.1kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.6660kB time=00:00:29.98 bitrate=7284.6kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.9123kB time=00:00:32.68 bitrate=7299.3kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.0641kB time=00:00:35.39 bitrate=7091.7kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.2601kB time=00:00:38.13 bitrate=7002.6kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.5828kB time=00:00:40.87 bitrate=7181.0kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.8481kB time=00:00:43.60 bitrate=7229.9kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.1461kB time=00:00:46.34 bitrate=7328.0kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.3982kB time=00:00:49.06 bitrate=7342.7kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.6565kB time=00:00:51.77 bitrate=7367.8kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.9718kB time=00:00:54.51 bitrate=7471.3kbits/s    &#xA;[alsa @ 0x22038a0] ALSA buffer xrun.2341kB time=00:00:57.25 bitrate=7489.2kbits/s    &#xA;^Cframe= 1760 fps= 29 q=-1.0 Lsize=   53946kB time=00:01:00.04 bitrate=7360.3kbits/s    &#xA;video:53880kB audio:53kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.022994%&#xA;[libx264 @ 0x2217ac0] frame I:8     Avg QP:24.00  size: 55686&#xA;[libx264 @ 0x2217ac0] frame P:1752  Avg QP:27.66  size: 31237&#xA;[libx264 @ 0x2217ac0] mb I  I16..4: 100.0%  0.0%  0.0%&#xA;[libx264 @ 0x2217ac0] mb P  I16..4: 15.0%  0.0%  0.0%  P16..4: 80.2%  0.0%  0.0%  0.0%  0.0%    skip: 4.8%&#xA;[libx264 @ 0x2217ac0] coded y,uvDC,uvAC intra: 45.3% 86.6% 59.4% inter: 65.7% 81.3% 11.5%&#xA;[libx264 @ 0x2217ac0] i16 v,h,dc,p: 40% 25% 26%  9%&#xA;[libx264 @ 0x2217ac0] i8c dc,h,v,p: 45% 24% 19% 12%&#xA;[libx264 @ 0x2217ac0] kb/s:7516.07&#xA;Received signal 2: terminating.&#xA;

    &#xA;&#xA;

    Using libvorbis :

    &#xA;&#xA;

      Metadata:&#xA;    encoder         : Lavf56.15.102&#xA;    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 640x480, q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc&#xA;    Metadata:&#xA;      encoder         : Lavc56.13.100 libx264&#xA;    Stream #0:1: Audio: vorbis (libvorbis) ([221][0][0][0] / 0x00DD), 48000 Hz, mono, fltp, 128 kb/s&#xA;    Metadata:&#xA;      encoder         : Lavc56.13.100 libvorbis&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))&#xA;  Stream #1:0 -> #0:1 (pcm_s16le (native) -> vorbis (libvorbis))&#xA;[alsa @ 0x1a948a0] ALSA buffer xrun.  0kB time=00:00:00.00 bitrate=N/A    &#xA;[alsa @ 0x1a948a0] ALSA buffer xrun. 402kB time=00:00:04.37 bitrate= 752.3kbits/s    &#xA;[alsa @ 0x1a948a0] ALSA buffer xrun.4122kB time=00:00:08.80 bitrate=3833.0kbits/s    &#xA;[alsa @ 0x1a948a0] ALSA buffer xrun.8722kB time=00:00:13.14 bitrate=5436.3kbits/s    &#xA;[alsa @ 0x1a948a0] ALSA buffer xrun.3903kB time=00:00:17.51 bitrate=6502.2kbits/s    &#xA;[alsa @ 0x1a948a0] ALSA buffer xrun.6625kB time=00:00:21.89 bitrate=6221.4kbits/s    &#xA;[alsa @ 0x1a948a0] ALSA buffer xrun.9548kB time=00:00:26.28 bitrate=6092.5kbits/s    &#xA;^Cframe=  851 fps= 26 q=-1.0 Lsize=   22018kB time=00:00:30.69 bitrate=5875.3kbits/s    &#xA;video:21996kB audio:12kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 0.044897%&#xA;[libx264 @ 0x1aa8ac0] frame I:4     Avg QP:23.50  size: 62405&#xA;[libx264 @ 0x1aa8ac0] frame P:847   Avg QP:25.58  size: 26297&#xA;[libx264 @ 0x1aa8ac0] mb I  I16..4: 100.0%  0.0%  0.0%&#xA;[libx264 @ 0x1aa8ac0] mb P  I16..4: 13.2%  0.0%  0.0%  P16..4: 72.0%  0.0%  0.0%  0.0%  0.0%    skip:14.8%&#xA;[libx264 @ 0x1aa8ac0] coded y,uvDC,uvAC intra: 40.6% 81.0% 58.6% inter: 58.8% 72.7% 8.6%&#xA;[libx264 @ 0x1aa8ac0] i16 v,h,dc,p: 41% 28% 22%  9%&#xA;[libx264 @ 0x1aa8ac0] i8c dc,h,v,p: 54% 19% 16% 11%&#xA;[libx264 @ 0x1aa8ac0] kb/s:6345.60&#xA;Received signal 2: terminating.&#xA;

    &#xA;&#xA;


    &#xA;&#xA;

    ffmpeg's detection of the ALSA stream is seemingly goofed up by the inconsistencies of the tape. In the failure case, only short blips of the tapes audio exist in the output MP4. The audio bitrate of the output file is less than 10 kbps, averaged out across the whole file. The output video seems to be fine, even though the low frames-per-second in the failure case log below.

    &#xA;&#xA;

    The audio and video streams can be captured fine for short amounts of time before a source error occurs ; this provides the success case log. The failure case log was created by intentionally making an error in the source streams — turning on the camera makes a brief noisy signal.

    &#xA;&#xA;

    Is there a setting that needs to be forced to keep ffmpeg recording the audio stream, even when the tape is blank or noisy ?

    &#xA;&#xA;

    Could it be that the libfdk_aac audio encoder is tripped up by the low quality source ?

    &#xA;&#xA;

    The relevant line ; rawvideo stream is piped to this in script at bottom :

    &#xA;&#xA;

    ffmpeg -pixel_format uyvy422 -s:v 720x480 -framerate 29.97 -f rawvideo \&#xA;-i $PIPE  -f alsa -i hw:0,0 -vf scale=w=720:h=540 -vcodec libx264 \&#xA;-preset ultrafast -shortest -c:a libfdk_aac -b:a 128k -af pan=1:c0=c0  \&#xA;-ar 96000 $OUTFILE&#xA;

    &#xA;&#xA;

    The ar argument was one attempt to force recording.

    &#xA;&#xA;

    ffmpeg log file for (short-lived) success ; high frames-per-second captured :

    &#xA;&#xA;

    ffmpeg version 2.5.3 Copyright (c) 2000-2015 the FFmpeg developers&#xA;  built on Jan 11 2015 17:53:45 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)&#xA;  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libpulse --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab&#xA;  libavutil      54. 15.100 / 54. 15.100&#xA;  libavcodec     56. 13.100 / 56. 13.100&#xA;  libavformat    56. 15.102 / 56. 15.102&#xA;  libavdevice    56.  3.100 / 56.  3.100&#xA;  libavfilter     5.  2.103 /  5.  2.103&#xA;  libavresample   2.  1.  0 /  2.  1.  0&#xA;  libswscale      3.  1.101 /  3.  1.101&#xA;  libswresample   1.  1.100 /  1.  1.100&#xA;  libpostproc    53.  3.100 / 53.  3.100&#xA;Input #0, rawvideo, from &#x27;/tmp/somagic-pipe&#x27;:&#xA;  Duration: N/A, start: 0.000000, bitrate: 165722 kb/s&#xA;    Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 720x480, 165722 kb/s, 29.97 tbr, 29.97 tbn, 29.97 tbc&#xA;Home directory not accessible: Permission denied&#xA;Guessed Channel Layout for  Input Stream #1.0 : stereo&#xA;Input #1, alsa, from &#x27;hw:0,0&#x27;:&#xA;  Duration: N/A, start: 1423202268.577088, bitrate: 1536 kb/s&#xA;    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s&#xA;No pixel format specified, yuv422p for H.264 encoding chosen.&#xA;Use -pix_fmt yuv420p for compatibility with outdated media players.&#xA;[Parsed_pan_0 @ 0x3335d60] This syntax is deprecated. Use &#x27;|&#x27; to separate the list items.&#xA;Single channel layout &#x27;1&#x27; is interpreted as a number of channels, switch to the syntax &#x27;1c&#x27; otherwise it will be interpreted as a channel layout number in a later version&#xA;[Parsed_pan_0 @ 0x3335d60] Pure channel mapping detected: 0&#xA;[libx264 @ 0x3364bc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64&#xA;[libx264 @ 0x3364bc0] profile High 4:2:2, level 3.1, 4:2:2 8-bit&#xA;[libx264 @ 0x3364bc0] 264 - core 142 r2389 956c8d8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0&#xA;Output #0, mp4, to &#x27;/home/peterbecich/easycap/Videos/fpv_video_02_05_2015_21_57_48.mp4&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf56.15.102&#xA;    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 720x540, q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc&#xA;    Metadata:&#xA;      encoder         : Lavc56.13.100 libx264&#xA;    Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 96000 Hz, mono, s16, 128 kb/s&#xA;    Metadata:&#xA;      encoder         : Lavc56.13.100 libfdk_aac&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))&#xA;  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (libfdk_aac))&#xA;Press [q] to stop, [?] for help&#xA;frame=   13 fps=0.0 q=26.0 size=     187kB time=00:00:00.30 bitrate=5102.7kbits/s    &#xA;frame=   29 fps= 29 q=26.0 size=     469kB time=00:00:00.83 bitrate=4607.6kbits/s    &#xA;frame=   44 fps= 29 q=26.0 size=     755kB time=00:00:01.33 bitrate=4635.2kbits/s    &#xA;frame=   59 fps= 29 q=26.0 size=    1024kB time=00:00:01.83 bitrate=4572.1kbits/s    &#xA;frame=   74 fps= 29 q=26.0 size=    1279kB time=00:00:02.33 bitrate=4486.5kbits/s    &#xA;frame=   89 fps= 29 q=26.0 size=    1516kB time=00:00:02.83 bitrate=4378.0kbits/s    &#xA;frame=  104 fps= 29 q=26.0 size=    1752kB time=00:00:03.33 bitrate=4301.0kbits/s    &#xA;frame=  119 fps= 29 q=26.0 size=    1991kB time=00:00:03.83 bitrate=4251.1kbits/s    &#xA;frame=  135 fps= 30 q=26.0 size=    2245kB time=00:00:04.37 bitrate=4207.5kbits/s    &#xA;frame=  150 fps= 30 q=26.0 size=    2524kB time=00:00:04.87 bitrate=4245.0kbits/s    &#xA;frame=  165 fps= 30 q=26.0 size=    2808kB time=00:00:05.37 bitrate=4282.0kbits/s    &#xA;frame=  180 fps= 30 q=26.0 size=    3091kB time=00:00:05.87 bitrate=4311.5kbits/s    &#xA;[rawvideo @ 0x3350640] Invalid buffer size, packet size 65536 &lt; expected frame_size 691200&#xA;Error while decoding stream #0:0: Invalid argument&#xA;frame=  183 fps= 29 q=-1.0 Lsize=    3247kB time=00:00:06.11 bitrate=4351.5kbits/s    &#xA;video:3142kB audio:96kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.254788%&#xA;[libx264 @ 0x3364bc0] frame I:1     Avg QP:20.00  size:  2289&#xA;[libx264 @ 0x3364bc0] frame P:182   Avg QP:25.99  size: 17664&#xA;[libx264 @ 0x3364bc0] mb I  I16..4: 100.0%  0.0%  0.0%&#xA;[libx264 @ 0x3364bc0] mb P  I16..4: 78.5%  0.0%  0.0%  P16..4: 20.2%  0.0%  0.0%  0.0%  0.0%    skip: 1.4%&#xA;[libx264 @ 0x3364bc0] coded y,uvDC,uvAC intra: 84.1% 71.5% 18.9% inter: 51.9% 63.5% 0.4%&#xA;[libx264 @ 0x3364bc0] i16 v,h,dc,p: 15%  8% 69%  8%&#xA;[libx264 @ 0x3364bc0] i8c dc,h,v,p: 50% 19% 24%  7%&#xA;[libx264 @ 0x3364bc0] kb/s:4215.02&#xA;

    &#xA;&#xA;

    ffmpeg log for failure ; low FPS captured :

    &#xA;&#xA;

    ffmpeg version 2.5.3 Copyright (c) 2000-2015 the FFmpeg developers&#xA;  built on Jan 11 2015 17:53:45 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)&#xA;  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libpulse --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab&#xA;  libavutil      54. 15.100 / 54. 15.100&#xA;  libavcodec     56. 13.100 / 56. 13.100&#xA;  libavformat    56. 15.102 / 56. 15.102&#xA;  libavdevice    56.  3.100 / 56.  3.100&#xA;  libavfilter     5.  2.103 /  5.  2.103&#xA;  libavresample   2.  1.  0 /  2.  1.  0&#xA;  libswscale      3.  1.101 /  3.  1.101&#xA;  libswresample   1.  1.100 /  1.  1.100&#xA;  libpostproc    53.  3.100 / 53.  3.100&#xA;Input #0, rawvideo, from &#x27;/tmp/somagic-pipe&#x27;:&#xA;  Duration: N/A, start: 0.000000, bitrate: 165722 kb/s&#xA;    Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 720x480, 165722 kb/s, 29.97 tbr, 29.97 tbn, 29.97 tbc&#xA;Home directory not accessible: Permission denied&#xA;Guessed Channel Layout for  Input Stream #1.0 : stereo&#xA;Input #1, alsa, from &#x27;hw:0,0&#x27;:&#xA;  Duration: N/A, start: 1423201999.226455, bitrate: 1536 kb/s&#xA;    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s&#xA;No pixel format specified, yuv422p for H.264 encoding chosen.&#xA;Use -pix_fmt yuv420p for compatibility with outdated media players.&#xA;[Parsed_pan_0 @ 0x21cad60] This syntax is deprecated. Use &#x27;|&#x27; to separate the list items.&#xA;Single channel layout &#x27;1&#x27; is interpreted as a number of channels, switch to the syntax &#x27;1c&#x27; otherwise it will be interpreted as a channel layout number in a later version&#xA;[Parsed_pan_0 @ 0x21cad60] Pure channel mapping detected: 0&#xA;[libx264 @ 0x21f9bc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64&#xA;[libx264 @ 0x21f9bc0] profile High 4:2:2, level 3.1, 4:2:2 8-bit&#xA;[libx264 @ 0x21f9bc0] 264 - core 142 r2389 956c8d8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0&#xA;Output #0, mp4, to &#x27;/home/peterbecich/easycap/Videos/fpv_video_02_05_2015_21_53_18.mp4&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf56.15.102&#xA;    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 720x540, q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc&#xA;    Metadata:&#xA;      encoder         : Lavc56.13.100 libx264&#xA;    Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 96000 Hz, mono, s16, 128 kb/s&#xA;    Metadata:&#xA;      encoder         : Lavc56.13.100 libfdk_aac&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))&#xA;  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (libfdk_aac))&#xA;Press [q] to stop, [?] for help&#xA;frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;frame=    1 fps=1.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;frame=    1 fps=0.7 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;frame=    1 fps=0.5 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;frame=    1 fps=0.4 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;frame=    1 fps=0.3 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;frame=    1 fps=0.3 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;frame=    1 fps=0.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;frame=    1 fps=0.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;frame=    1 fps=0.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;frame=    1 fps=0.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    &#xA;[alsa @ 0x21e5ac0] ALSA buffer xrun.&#xA;frame=    8 fps=1.3 q=19.0 size=      12kB time=00:00:06.03 bitrate=  15.9kbits/s    &#xA;frame=   23 fps=3.5 q=18.0 size=      12kB time=00:00:06.03 bitrate=  16.4kbits/s    &#xA;frame=   38 fps=5.4 q=18.0 size=      12kB time=00:00:06.03 bitrate=  16.7kbits/s    &#xA;frame=   53 fps=7.0 q=18.0 size=      12kB time=00:00:06.03 bitrate=  16.9kbits/s    &#xA;frame=   68 fps=8.4 q=26.0 size=     146kB time=00:00:06.03 bitrate= 198.8kbits/s    &#xA;frame=   83 fps=9.7 q=26.0 size=     375kB time=00:00:06.03 bitrate= 510.0kbits/s    &#xA;frame=   98 fps= 11 q=26.0 size=     608kB time=00:00:06.03 bitrate= 826.5kbits/s    &#xA;frame=  114 fps= 12 q=26.0 size=     875kB time=00:00:06.03 bitrate=1189.1kbits/s    &#xA;frame=  128 fps= 13 q=26.0 size=    1091kB time=00:00:06.03 bitrate=1481.6kbits/s    &#xA;frame=  144 fps= 14 q=26.0 size=    1339kB time=00:00:06.03 bitrate=1819.2kbits/s    &#xA;frame=  159 fps= 14 q=26.0 size=    1571kB time=00:00:06.03 bitrate=2134.6kbits/s    &#xA;frame=  174 fps= 15 q=26.0 size=    1796kB time=00:00:06.03 bitrate=2440.1kbits/s    &#xA;[alsa @ 0x21e5ac0] ALSA buffer xrun.&#xA;frame=  189 fps= 16 q=26.0 size=    2015kB time=00:00:12.04 bitrate=1370.4kbits/s    &#xA;frame=  204 fps= 16 q=26.0 size=    2238kB time=00:00:12.04 bitrate=1522.3kbits/s    &#xA;frame=  219 fps= 17 q=26.0 size=    2490kB time=00:00:12.04 bitrate=1694.2kbits/s    &#xA;frame=  235 fps= 17 q=26.0 size=    2728kB time=00:00:12.04 bitrate=1855.8kbits/s    &#xA;frame=  250 fps= 18 q=26.0 size=    2973kB time=00:00:12.04 bitrate=2022.4kbits/s    &#xA;[rawvideo @ 0x21e5640] Invalid buffer size, packet size 65536 &lt; expected frame_size 691200&#xA;Error while decoding stream #0:0: Invalid argument&#xA;frame=  261 fps= 18 q=-1.0 Lsize=    3269kB time=00:00:12.06 bitrate=2220.1kbits/s    &#xA;video:3263kB audio:4kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.081101%&#xA;[libx264 @ 0x21f9bc0] frame I:2     Avg QP:21.50  size: 21342&#xA;[libx264 @ 0x21f9bc0] frame P:259   Avg QP:24.22  size: 12734&#xA;[libx264 @ 0x21f9bc0] mb I  I16..4: 100.0%  0.0%  0.0%&#xA;[libx264 @ 0x21f9bc0] mb P  I16..4: 62.8%  0.0%  0.0%  P16..4: 14.2%  0.0%  0.0%  0.0%  0.0%    skip:22.9%&#xA;[libx264 @ 0x21f9bc0] coded y,uvDC,uvAC intra: 77.7% 61.2% 14.1% inter: 19.7% 24.8% 1.6%&#xA;[libx264 @ 0x21f9bc0] i16 v,h,dc,p: 17% 10% 65%  8%&#xA;[libx264 @ 0x21f9bc0] i8c dc,h,v,p: 52% 18% 24%  6%&#xA;[libx264 @ 0x21f9bc0] kb/s:3068.90&#xA;

    &#xA;&#xA;

    The whole script :

    &#xA;&#xA;

    #!/bin/sh&#xA;&#xA;PIPE=/tmp/somagic-pipe&#xA;OUTFILEDIR=~/easycap/Videos/&#xA;LOGDIR=~/.somagic-log/&#xA;NOW=`date &#x2B;"%m_%d_%Y_%H_%M_%S"`&#xA;&#xA;OUTFILE=${OUTFILEDIR}fpv_video_${NOW}.mp4&#xA;&#xA;mkdir $LOGDIR&#xA;&#xA;FFMPEG_LOG=${LOGDIR}ffmpeg.log&#xA;SOMAGIC_LOG=${LOGDIR}somagic.log&#xA;MPLAYER_LOG=${LOGDIR}mplayer.log&#xA;&#xA;rm $PIPE >/dev/null 2>&amp;1&#xA;rm $OUTFILE >/dev/null 2>&amp;1&#xA;&#xA;rm $FFMPEG_LOG&#xA;rm $SOMAGIC_LOG&#xA;rm $MPLAYER_LOG&#xA;&#xA;mkfifo $PIPE >/dev/null 2>&amp;1&#xA;&#xA;ffmpeg -pixel_format uyvy422 -s:v 720x480 -framerate 29.97 -f rawvideo \&#xA;-i $PIPE  -f alsa -i hw:0,0 -vf scale=w=720:h=540 -vcodec libx264 \&#xA;-preset ultrafast -shortest -c:a libfdk_aac -b:a 128k -af pan=1:c0=c0  \&#xA;-ar 96000 $OUTFILE > $FFMPEG_LOG 2>&amp;1 &amp;&#xA;&#xA;somagic-capture --ntsc -c --luminance=2 --lum-aperture=3 2> $SOMAGIC_LOG \&#xA;| tee $PIPE | \&#xA;mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo \&#xA;"ntsc:format=uyvy:fps=30000/1001" -aspect 4:3 - 2> $MPLAYER_LOG&#xA;&#xA;&#xA;rm $PIPE >/dev/null 2>&amp;1 &#xA;

    &#xA;&#xA;

    Modified from here : https://gist.github.com/Brick85/0b327ac2d3d45e23ed33

    &#xA;