Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (33)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (3684)

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

    



    Edit :

    



    I can simplify the question a bit, now.

    



    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.

    



    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 ?)

    



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

    



    Using libfdk_aac :

    



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


    



    Using libvorbis :

    



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


    




    



    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.

    



    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.

    



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

    



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

    



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

    



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


    



    The ar argument was one attempt to force recording.

    



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

    



    ffmpeg version 2.5.3 Copyright (c) 2000-2015 the FFmpeg developers
  built on Jan 11 2015 17:53:45 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  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
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, rawvideo, from '/tmp/somagic-pipe':
  Duration: N/A, start: 0.000000, bitrate: 165722 kb/s
    Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 720x480, 165722 kb/s, 29.97 tbr, 29.97 tbn, 29.97 tbc
Home directory not accessible: Permission denied
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:0,0':
  Duration: N/A, start: 1423202268.577088, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[Parsed_pan_0 @ 0x3335d60] This syntax is deprecated. Use '|' to separate the list items.
Single channel layout '1' is interpreted as a number of channels, switch to the syntax '1c' otherwise it will be interpreted as a channel layout number in a later version
[Parsed_pan_0 @ 0x3335d60] Pure channel mapping detected: 0
[libx264 @ 0x3364bc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
[libx264 @ 0x3364bc0] profile High 4:2:2, level 3.1, 4:2:2 8-bit
[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
Output #0, mp4, to '/home/peterbecich/easycap/Videos/fpv_video_02_05_2015_21_57_48.mp4':
  Metadata:
    encoder         : Lavf56.15.102
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 720x540, q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc56.13.100 libx264
    Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 96000 Hz, mono, s16, 128 kb/s
    Metadata:
      encoder         : Lavc56.13.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
frame=   13 fps=0.0 q=26.0 size=     187kB time=00:00:00.30 bitrate=5102.7kbits/s    
frame=   29 fps= 29 q=26.0 size=     469kB time=00:00:00.83 bitrate=4607.6kbits/s    
frame=   44 fps= 29 q=26.0 size=     755kB time=00:00:01.33 bitrate=4635.2kbits/s    
frame=   59 fps= 29 q=26.0 size=    1024kB time=00:00:01.83 bitrate=4572.1kbits/s    
frame=   74 fps= 29 q=26.0 size=    1279kB time=00:00:02.33 bitrate=4486.5kbits/s    
frame=   89 fps= 29 q=26.0 size=    1516kB time=00:00:02.83 bitrate=4378.0kbits/s    
frame=  104 fps= 29 q=26.0 size=    1752kB time=00:00:03.33 bitrate=4301.0kbits/s    
frame=  119 fps= 29 q=26.0 size=    1991kB time=00:00:03.83 bitrate=4251.1kbits/s    
frame=  135 fps= 30 q=26.0 size=    2245kB time=00:00:04.37 bitrate=4207.5kbits/s    
frame=  150 fps= 30 q=26.0 size=    2524kB time=00:00:04.87 bitrate=4245.0kbits/s    
frame=  165 fps= 30 q=26.0 size=    2808kB time=00:00:05.37 bitrate=4282.0kbits/s    
frame=  180 fps= 30 q=26.0 size=    3091kB time=00:00:05.87 bitrate=4311.5kbits/s    
[rawvideo @ 0x3350640] Invalid buffer size, packet size 65536 < expected frame_size 691200
Error while decoding stream #0:0: Invalid argument
frame=  183 fps= 29 q=-1.0 Lsize=    3247kB time=00:00:06.11 bitrate=4351.5kbits/s    
video:3142kB audio:96kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.254788%
[libx264 @ 0x3364bc0] frame I:1     Avg QP:20.00  size:  2289
[libx264 @ 0x3364bc0] frame P:182   Avg QP:25.99  size: 17664
[libx264 @ 0x3364bc0] mb I  I16..4: 100.0%  0.0%  0.0%
[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%
[libx264 @ 0x3364bc0] coded y,uvDC,uvAC intra: 84.1% 71.5% 18.9% inter: 51.9% 63.5% 0.4%
[libx264 @ 0x3364bc0] i16 v,h,dc,p: 15%  8% 69%  8%
[libx264 @ 0x3364bc0] i8c dc,h,v,p: 50% 19% 24%  7%
[libx264 @ 0x3364bc0] kb/s:4215.02


    



    ffmpeg log for failure ; low FPS captured :

    



    ffmpeg version 2.5.3 Copyright (c) 2000-2015 the FFmpeg developers
  built on Jan 11 2015 17:53:45 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  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
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, rawvideo, from '/tmp/somagic-pipe':
  Duration: N/A, start: 0.000000, bitrate: 165722 kb/s
    Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 720x480, 165722 kb/s, 29.97 tbr, 29.97 tbn, 29.97 tbc
Home directory not accessible: Permission denied
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:0,0':
  Duration: N/A, start: 1423201999.226455, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[Parsed_pan_0 @ 0x21cad60] This syntax is deprecated. Use '|' to separate the list items.
Single channel layout '1' is interpreted as a number of channels, switch to the syntax '1c' otherwise it will be interpreted as a channel layout number in a later version
[Parsed_pan_0 @ 0x21cad60] Pure channel mapping detected: 0
[libx264 @ 0x21f9bc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
[libx264 @ 0x21f9bc0] profile High 4:2:2, level 3.1, 4:2:2 8-bit
[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
Output #0, mp4, to '/home/peterbecich/easycap/Videos/fpv_video_02_05_2015_21_53_18.mp4':
  Metadata:
    encoder         : Lavf56.15.102
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 720x540, q=-1--1, 29.97 fps, 11988 tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc56.13.100 libx264
    Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 96000 Hz, mono, s16, 128 kb/s
    Metadata:
      encoder         : Lavc56.13.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=    1 fps=1.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=    1 fps=0.7 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=    1 fps=0.5 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=    1 fps=0.4 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=    1 fps=0.3 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=    1 fps=0.3 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=    1 fps=0.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=    1 fps=0.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=    1 fps=0.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=    1 fps=0.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
[alsa @ 0x21e5ac0] ALSA buffer xrun.
frame=    8 fps=1.3 q=19.0 size=      12kB time=00:00:06.03 bitrate=  15.9kbits/s    
frame=   23 fps=3.5 q=18.0 size=      12kB time=00:00:06.03 bitrate=  16.4kbits/s    
frame=   38 fps=5.4 q=18.0 size=      12kB time=00:00:06.03 bitrate=  16.7kbits/s    
frame=   53 fps=7.0 q=18.0 size=      12kB time=00:00:06.03 bitrate=  16.9kbits/s    
frame=   68 fps=8.4 q=26.0 size=     146kB time=00:00:06.03 bitrate= 198.8kbits/s    
frame=   83 fps=9.7 q=26.0 size=     375kB time=00:00:06.03 bitrate= 510.0kbits/s    
frame=   98 fps= 11 q=26.0 size=     608kB time=00:00:06.03 bitrate= 826.5kbits/s    
frame=  114 fps= 12 q=26.0 size=     875kB time=00:00:06.03 bitrate=1189.1kbits/s    
frame=  128 fps= 13 q=26.0 size=    1091kB time=00:00:06.03 bitrate=1481.6kbits/s    
frame=  144 fps= 14 q=26.0 size=    1339kB time=00:00:06.03 bitrate=1819.2kbits/s    
frame=  159 fps= 14 q=26.0 size=    1571kB time=00:00:06.03 bitrate=2134.6kbits/s    
frame=  174 fps= 15 q=26.0 size=    1796kB time=00:00:06.03 bitrate=2440.1kbits/s    
[alsa @ 0x21e5ac0] ALSA buffer xrun.
frame=  189 fps= 16 q=26.0 size=    2015kB time=00:00:12.04 bitrate=1370.4kbits/s    
frame=  204 fps= 16 q=26.0 size=    2238kB time=00:00:12.04 bitrate=1522.3kbits/s    
frame=  219 fps= 17 q=26.0 size=    2490kB time=00:00:12.04 bitrate=1694.2kbits/s    
frame=  235 fps= 17 q=26.0 size=    2728kB time=00:00:12.04 bitrate=1855.8kbits/s    
frame=  250 fps= 18 q=26.0 size=    2973kB time=00:00:12.04 bitrate=2022.4kbits/s    
[rawvideo @ 0x21e5640] Invalid buffer size, packet size 65536 < expected frame_size 691200
Error while decoding stream #0:0: Invalid argument
frame=  261 fps= 18 q=-1.0 Lsize=    3269kB time=00:00:12.06 bitrate=2220.1kbits/s    
video:3263kB audio:4kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.081101%
[libx264 @ 0x21f9bc0] frame I:2     Avg QP:21.50  size: 21342
[libx264 @ 0x21f9bc0] frame P:259   Avg QP:24.22  size: 12734
[libx264 @ 0x21f9bc0] mb I  I16..4: 100.0%  0.0%  0.0%
[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%
[libx264 @ 0x21f9bc0] coded y,uvDC,uvAC intra: 77.7% 61.2% 14.1% inter: 19.7% 24.8% 1.6%
[libx264 @ 0x21f9bc0] i16 v,h,dc,p: 17% 10% 65%  8%
[libx264 @ 0x21f9bc0] i8c dc,h,v,p: 52% 18% 24%  6%
[libx264 @ 0x21f9bc0] kb/s:3068.90


    



    The whole script :

    



    #!/bin/sh

PIPE=/tmp/somagic-pipe
OUTFILEDIR=~/easycap/Videos/
LOGDIR=~/.somagic-log/
NOW=`date +"%m_%d_%Y_%H_%M_%S"`

OUTFILE=${OUTFILEDIR}fpv_video_${NOW}.mp4

mkdir $LOGDIR

FFMPEG_LOG=${LOGDIR}ffmpeg.log
SOMAGIC_LOG=${LOGDIR}somagic.log
MPLAYER_LOG=${LOGDIR}mplayer.log

rm $PIPE >/dev/null 2>&1
rm $OUTFILE >/dev/null 2>&1

rm $FFMPEG_LOG
rm $SOMAGIC_LOG
rm $MPLAYER_LOG

mkfifo $PIPE >/dev/null 2>&1

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

somagic-capture --ntsc -c --luminance=2 --lum-aperture=3 2> $SOMAGIC_LOG \
| tee $PIPE | \
mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo \
"ntsc:format=uyvy:fps=30000/1001" -aspect 4:3 - 2> $MPLAYER_LOG


rm $PIPE >/dev/null 2>&1 


    



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

    


  • Understanding The Dreamcast GD-ROM Layout

    24 mars 2022, par Multimedia Mike — Sega Dreamcast

    I’m finally completing something I set out to comprehend over a decade ago. I wanted to understand how data is actually laid out on a Sega Dreamcast GD-ROM drive. I’m trying to remember why I even still care. There was something about how I wanted to make sure the contents of a set of Dreamcast demo discs was archived for study.


    Lot of 9 volumes of the Official Sega Dreamcast Magazine

    I eventually figured it out. Read on, if you are interested in the technical details. Or, if you would like to examine the fruits of this effort, check out the Dreamcast demo discs that I took apart and uploaded to the Internet Archive.

    If you care to read some geeky technical details of some of the artifacts on these sampler discs, check out this followup post on Dreamcast Finds.

    Motivation
    Why do I still care about this ? Well, see the original charter of this blog above. It’s mostly about studying multimedia formats, as well as the general operation of games and their non-multimedia data formats. It’s also something that has nagged at me ever since I extracted a bunch of Dreamcast discs years ago and tried to understand why the tracks were arranged the way they were, and how I could systematically split the files out of the filesystem. This turns out not to be as easy as it might sound, even if you can get past the obstacle of getting at the raw data.

    CD/CD-ROM Refresher
    As I laid out in my Grand Unified Theory of Compact Disc, every compact disc can be viewed conceptually as a string of sectors, where each sector is 2352 bytes long. The difference among the various CD types (audio CDs, various CD-ROM types) boils down to the format of contents of the 2352-byte sectors. For an audio CD, every sector’s 2352 bytes represents 1/75 of a second of CD-quality audio samples.

    Meanwhile, there are various sector layouts for different CD-ROM modes, useful for storing computer data. This post is most interested in “mode 1/form 1”, which uses 2048 of the 2352 bytes for data, while using the remaining bytes for error detection and correction codes. A filesystem (usually ISO-9660) is overlaid on these 2048-byte sectors in order to create data structures for organizing strings of sectors into files.

    A CD has between 1 and 99 tracks. A pure CD-ROM will have a single data track. Pure audio CDs tend to have numerous audio tracks, usually 1 per song. Mixed CDs are common. For software, this usually manifests as the first track being data and containing an ISO-9660 filesystem, followed by a series of audio tracks, sometimes for in-game music. For audio CDs, there is occasionally a data track at the end of the disc with some extra media types.

    GD-ROM Refresher
    The Dreamcast used optical discs called GD-ROMs, where the GD stands for “gigadisc”. These discs were designed to hold about 1 gigabyte of data, vs. the usual 650-700MB offered by standard CD solutions, while using the same laser unit as is used for CDs. I’m not sure how it achieved this exactly. I always assumed it was some sort of “double density” sector scheme. According to Wikipedia, the drive read the disc at a slower rate which allowed it to read more data (presumably the “pits” vs. “lands” which comprise the surface of an optical disc). This might be equivalent to my theory.

    The GD-ROM discs cannot be read in a standard optical drive. It is necessary to get custom software onto the Dreamcast which will ask the optical hardware to extract the sectors and exfiltrate them off of the unit somehow. There are numerous methods for this. Alternatively, just find rips that are increasingly plentiful around the internet. However, just because you might be able to find the data for a given disc does not mean that you can easily explore the contents.

    Typical Layout Patterns
    Going back to my study of the GD-ROM track layouts, 2 clear patterns emerge :

    All of the game data is packed into track 3 :


    GD-ROM Layout Type 1

    Track 3 has data, the last track has data, and the tracks in between contain standard CD audio :


    GD-ROM Layout Type 2

    Also, the disc is always, always 100% utilized.

    Track 1 always contains an ISO-9660 filesystem and can be read by any standard CD-ROM drive. And it usually has nothing interesting. Track 3 also contains what appears to be an ISO-9660 filesystem. However, if you have a rip of the track and try to mount the image with standard tools, it will not work. In the second layout, the data follows no obvious format.

    Cracking The Filesystem Code
    I figured out quite a few years ago that in the case of the consolidated data track 3, that’s simply a standard ISO-9660 filesystem that would work fine with standard ISO-9660 reading software… if the data track were located beginning at sector 45000. The filesystem data structures contain references to absolute sector numbers. Thus, if it were possible to modify some ISO-9660 software to assume the first sector is 45000, it ought to have no trouble interpreting the data.


    ISO-9660 In A Single Track

    How about the split data track format ? Actually, it works the same way. If all the data were sitting on its original disc, track 3 would have data structures pointing to strings of contiguous sectors (extents) in the final track, and those are the files.

    To express more succinctly : track 3 contains the filesystem root structure and the directory structures, while the final track contains the actual file data. How is the filesystem always 100% full ? Track 3 gets padded out with 0-sectors until the beginning of any audio sectors.


    ISO-9660 Spread Across 2 Tracks

    Why Lay Things Out Like This ?
    Why push the data as far out on the disc as possible ? A reasonable explanation for this would be for read performance. Compact discs operate on Constant Linear Velocity (CLV), vs. Constant Angular Velocity (CAV). The implication of this is that data on the outside of the disc is read faster than data on the inside. I once profiled this characteristic in order to prove it to myself, using both PC CD drives as well as a Dreamcast. By pushing the data to the outer sectors, graphical data gets loaded into RAM faster, and full motion videos, which require a certain minimum bitrate for a good experience, have a better guarantee that playback will be smooth.

    Implications For Repacking
    Once people figured out how to boot burned CDs in the Dreamcast, they had a new problem : Squeeze as much as 1 gigabyte down to around 650 megabytes at the most. It looks like the most straightforward strategy was to simply rework the filesystem to remove the often enormous amount of empty space in track 3.

    My understanding is that another major strategy is to re-encode certain large assets. Full motion video (FMV) assets are a good target here since the prevailing FMV middleware format used on Sega Dreamcast games was Sofdec, which is basically just MPEG-1 video. There is ample opportunity to transcode these files to lower bitrate settings to squeeze some bits (and a lot of visual quality) out of them.

    Further, if you don’t really care about the audio tracks, you could just replace them with brief spurts of silence.

    Making A Tool
    So I could make a tool that would process these collections of files representing a disc. I could also adapt it for various forms that a Dreamcast rip might take (I have found at least 3 so far). I could eventually expand it to handle lots of other disc formats (you know, something like Aaru does these days). And that would have been my modus operandi perhaps 10 or more years ago. And of course, the ambitious tool would have never seen daylight as I got distracted by other ideas.

    I wanted to get a solution up and running as quickly as possible this time. Here was my initial brainstorm : assemble all the tracks into a single, large disc while pretending the audio tracks consist of 2048-byte sectors. In doing so, I ought to be able to use fuseiso to mount the giant image, with a modification to look for the starting sector at a somewhat nonstandard location.

    To achieve the first part I wrote a quick Python script that processed the contents of a GDI file, which was stored alongside the ISO (data) and RAW (audio) track track rips from when I extracted the disc. The GDI is a very matter-of-fact listing of the tracks and their properties, e.g. :

    5
    1 0 4 2048 track01.iso 0
    2 721 0 2352 track02.raw 0
    3 45000 4 2048 track03.iso 0
    4 338449 0 2352 track04.raw 0
    5 349096 4 2048 track05.iso 0
    

    track number / starting sector / track type (4=data, 0=audio) / bytes per sector / filename / ??

    The script skips the first 2 filenames, instead writing 45000 zero sectors in order to simulate the CD-compatible area. Then, for each file, if it’s an ISO, append the data to the final data file ; if it’s audio, compute the number of sectors occupied, and then append that number of 2048-byte zero sectors to the final data file.

    Finally, to interpret the filesystem, I used an old tool that I’ve relied upon for a long time– fuseiso. This is a program that leverages Filesystem in Userspace (FUSE) to mount ISO-9660 filesystems as part of the local filesystem, without needing root privileges. The original source hasn’t been updated for 15 years, but I found a repo that attempts to modernize it slightly. I forked a version which fixes a few build issues.

    Anyway, I just had to update a table to ask it to start looking for the root ISO-9660 filesystem at a different location than normal. Suddenly, after so many years, I was able to freely browse a GD-ROM filesystem directly under Linux !

    Conclusion And Next Steps
    I had to hack the fuseiso3 tool a bit in order to make this work. I don’t think it’s especially valuable to make sure anyone can run with the same modifications since the tool assumes that a GD-ROM rip has been processed through the exact pipeline I described above.

    I have uploaded all of the North American Dreamcast demo discs to archive.org. See this post for a more granular breakdown of what this entails. In the course of this exercise, I also found some European demo discs that could use the same extraction.

    What else ? Should I perform the same extraction experiment for all known Dreamcast games ? Would anyone care ? Maybe if there’s a demand for it.

    Here is a followup on the interesting and weird things I have found on these discs so far.

    The post Understanding The Dreamcast GD-ROM Layout first appeared on Breaking Eggs And Making Omelettes.

  • How to Choose a GDPR Compliant Web Analytics Solution

    2 mars 2022, par Matthieu Aubry — Privacy

    Since the launch of GDPR, one big question has lingered around with uncertainty – is Google Analytics GDPR compliant ? The current GDPR enforcement trend happening across the EU is certainly shedding some light on this question.

    Starting with the Austrian Data Protection Authority’s ruling on Google Analytics and more recently, CNIL (the French Data Protection Authority) has followed suit by also ruling Google Analytics illegal to use. Organisations with EU-based web visitors are now scrambling to find a compliant solution.

    The French Data Protection Authority (CNIL) has already started delivering formal notices to websites using Google Analytics, so now is the time to act. According to CNIL, organisations have two options :

    1. Ceasing use of the Google Analytics functionality (under the current conditions) 
    2. Use a compliant web analytics tool that does not transfer data outside the EU

    Getting started 

    For organisations considering migrating to a compliant web analytics tool, I’ve outlined below the things you need to consider when weighing up compliant web analytics tools. Once you’ve made a choice, I’ve also included a step-by-step guide to migrating away from Google Analytics. This guide is useful regardless of which GDPR compliant analytics provider you choose.

    Before getting started, I recommend that you document your findings against the following considerations while reviewing GDPR compliant Google Analytics alternatives. This document can then be shared with your Data Protection Officer (DPO) to get their final recommendation.

    10 key considerations when selecting a GDPR compliant web analytics tools

    Many tools will claim to be GDPR compliant so it’s important that you do your due diligence and review tools against the following considerations. 

    1. Where does the tool store data ? 

    The rulings in France and Austria were based on the fact that Google Analytics stores data in the US, which does not have an adequate level of data protection. Your safest option is to find a tool that legally stores data in the EU.

    You should be able to find out where the data is stored in the organisation’s privacy policy. Generally, data storage information can be found under sections titled “Subprocessors” and “Third-party services”. Check out the Matomo Privacy Policy as an example. 

    If you’re unable to easily find this information or it’s unclear, reach out to the organisation for more information.

    2. Does the tool offer anonymous tracking ?

    Anonymous tracking comes with many benefits, including :

    • The ability to track visitors without a cookie consent screen. Due to the privacy-respecting aspect of cookieless tracking, you don’t need to worry about the extra steps involved with compliant cookie banners.
    • More accurate data. When visitors deny tracking cookies, you lose out on valuable data. With anonymous tracking there is no data lost as you don’t need consent to track.
    • Simplified GDPR compliance. With this enabled, there are fewer steps you need to take to get GDPR compliant and stay GDPR compliant.

    For those reasons, it may be important for you to select a tool that offers anonymous tracking functionalities. The level of anonymous tracking you require will depend on your situation but you should look out for tools that allow you to :

    • Disable fingerprinting 
    • Disable user profiles 
    • Anonymise data
    • Cookieless tracking

    If you want to read more about data anonymization, check out this guide on data anonymization in web analytics.

    3. Does the tool integrate with my existing tech stack ?

    You’ll want to ensure that a new web analytics tool will play well with other tools in your tech stack including things like your CMS (content management system), eCommerce shop, etc. You should list out all the existing tools that currently integrate with your Google Analytics and check that the same integrations can be re-created with the new tool, via integrations or APIs.

    If not, it could become costly trying to connect your existing tech stack to a new solution.

    4. Does the tool offer the same features and insights you are currently using in Google Analytics ? Or more, if necessary ? 

    Just because you are moving to a new web analytics platform, doesn’t mean you have to give up the insights, reports and features you’ve grown accustomed to with Google Analytics. Ensuring that a new platform provides the same features and reports that you value the most will result in a smoother transition away from Google Analytics.

    It’s unlikely that a new tool will have all of the same features as Google Analytics, so I’d recommend listing out and prioritising your business-critical features and reports. 

    If I had to guess, you probably set up Google Analytics years ago because it was the default option. Now is your chance to make the most of this switch from Google Analytics and find a tool that offers additional reports and features that better aligns with your business. If time permits, I’d highly recommend that you consider other features or reports that you might have been missing out on while using Google Analytics.

    Check out this comparison of Google Analytics vs Matomo to see side-by-side feature comparison.

    5. Does the tool accept Google Analytics data imports ? 

    The historical data in Google Analytics is a critical asset for many businesses. Fortunately, some tools accept Google Analytics data imports so you don’t lose all of the data you’ve generated over time.

    However, it’s important to note that any data you import from Google Analytics to a new tool needs to be compliant data. I’ll cover this more below.

    6. Does the tool provide conversion tracking exports ? 

    Do you invest in paid advertising ? If you do, then tracking the conversions from people clicking on these paid ads is critical in assessing your return on investment. Since sending IP addresses or other personal information to the US is illegal under GDPR, we can only assume that this will also apply to advertising pixel/conversion tracking (e.g., Facebook pixel, Google Ads conversion tracking, etc). 

    As an example, Matomo offers conversion tracking exports so you can get a better understanding of ad performance while meeting privacy laws and without requiring consent from users. See how it works with Matomo’s conversion tracking exports

    7. How will you train up your in-house team ? Or can you hire a contractor ?

    This is a common concern of many, and rightfully so. You’ll want to confirm what resources are readily available so you can hit the ground running with your new web analytics tool. If you’d prefer to train up your in-house team, check the provider’s site for training resources, videos, guides, etc.

    If you’d rather hire an external contractor, we recommend heading to LinkedIn, reaching out to your community or asking the provider if they have any recommendations for contractors.

    In addition, check that the provider offers technical support or a forum, in case you have specific questions and need help.   

    8. Does the tool offer self-hosting ? (optional)

    For organisations that want full control over their data and storage location, an on-premise web analytics tool will be the preferred option. From a GDPR perspective, this is also the easiest option for compliance.

    Keep in mind that this requires resources, regular maintenance, technical knowledge and/or technical consultants. If you’re unsure which option is best for your organisation, check out our on-premise vs cloud web analytics comparison breakdown.

    Find out more about self-hosting Matomo.

    9. Is the tool approved by the CNIL for tracking without consent ?

    This is an important step for websites with French users. This step will help narrow down your selection of tools. The CNIL offers a programme to identify web analytics solutions that can be used without tracking consent. The CNIL’s list of recommended web analytics tools can act as your starting point for solutions to review.

    While this step is specific to sites with French users, it can also be helpful for websites with visitors from any other EU country.

    Benefits of consent-free tracking

    There are many benefits of tracking without consent.

    For one, it simplifies GDPR compliance and reduces the chances of GDPR breaches and fines. Cookie consent screens have recently been the target for EU Data Protection Authorities because many websites are unknowingly serving cookie consent screens that do not meet GDPR requirements. 

    Yet another benefit, and quite possibly the most important is more accurate data. Even if a website displays a user-friendly, lawful consent screen, the majority of users will either ignore or reject cookie consent. Legally website owners can’t track anything unless the visitor gives consent. So not having a cookie consent screen ensures that every visit is tracked and your web analytics data is 100% accurate

    Lastly, many visitors have grown fatigued and frustrated with invasive cookie consent screens. Not having one on your site creates a user-friendly experience, which will likely result in longer user sessions and lower bounce rates.

    10. Does the tool offer a Data Processing Agreement (DPA) ? 

    Technically, any GDPR compliant web analytics tool should offer a DPA but for the sake of completeness, I’ve added this as a consideration. Double check that any tools you are looking at provide this legally binding document. This should be located in the Privacy Policy of the web analytics provider, if not reach out to request it.

    As an example, here’s Matomo’s Data Processing Agreement which can be found in our Privacy Policy under Subprocessors. 

    That wraps up the key considerations. When it comes to compliance, privacy and customer data, Matomo leads the way. We are looking forward to helping you achieve GDPR compliance easily. Start your free 21-day trial of Matomo now – no credit card required.

    A step-by-step guide to migrating from Google Analytics

    Once you’ve identified a tool that suits your needs and your Data Protection Officer (DPO) has approved, you’re ready to get started. Here’s a simple step-by-step guide with all the important steps for you to follow :

    1. Before getting started, you should sign or download the Data Processing Agreement (DPA) offered by your new web analytics provider.

    2. Register for the new tool and configure it for compliance. The provider should offer guides on how to configure for GDPR compliance. This will include things like giving your users an easy way to opt-out of all tracking, turning on cookieless tracking or asking users for consent and anonymizing data and IP addresses, for instance.

    3. Inform your organisation about the change. Whether your colleagues use the tool or not, it’s important that you share information about the new tool with your staff. Let them know what the tool will be used for, who will use the tool and how it complies with GDPR. 

    4. Let your DPO know that you’ve removed Google Analytics and have implemented the new tool.

    5. Update your records of processing activities to include the new tool.

    6. Update your privacy policy. You’ll need to include details about the web analytics provider, where the data is stored, what data is being collected, how long the data will be stored and why the data is being collected. The web analytics tool should readily have this information for you.

    As an example, if you decide to use Matomo as your web analytics tool, we provide a Privacy Policy template for you to use on your site and a guide on how to complete your privacy policy under GDPR with Matomo. Note that these are only applicable if you are using Matomo.

    In addition, if the tool has an opt-out feature, you will also need to put the opt-out into the privacy policy (e.g., when using cookieless tracking).

    7. Now, the exciting part. Add the tracking code to your site by following the steps provided by the web analytics tool. 

    If you’re not comfortable with this step, the provider should offer steps to do this and you can share this with your web developer.

    8. Once added, login to your tool and check to see if traffic is being tracked.

    9. If your tool does not offer Google Analytics data imports or you do not need the historical data in your new tool, go to step 11. 

    To plan for your Google Analytics data migration, you’ll first need to establish what historical data is compliant with GDPR.

    For example, you shouldn’t import any data stored beyond the retention period established in your Privacy Policy or any personally identifiable information (PII) like IP addresses that aren’t anonymised. Discuss this further with your DPO.

    10. Once you’ve established what data you can legally import, then you can begin the import. Follow the steps provided by your new web analytics solution provider.

    11. Remove Google Analytics tracking code from your site. This will stop the collection of your visitors data by Google as well as slightly increase the page load speed.

    If you still haven’t made a choice yet, try Matomo free for 21-days and see why over 1 million websites choose Matomo.