MP4 file won't stream into omxplayer,any idea why? - raspberry-pi

I have an MP4 that plays just fine using omxplayer
omxplayer F.mp4
If I use the -i flag, I get the following media information
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Duration: 00:03:24.55, start: 0.000000, bitrate: 270 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x480, 136 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandler
I'm experimenting with simple streaming into omxplayer, without success. e.g.
cat F.mp4 | omxplayer -o hdmi --no-keys pipe:0
omxplayer prints
Video codec omx-h264 width 640 height 480 profile -99 fps 30.000000
Audio codec aac channels 2 samplerate 44100 bitspersample 16
Subtitle count: 0, state: off, index: 1, delay: 0
It seems to have figured out the write demux and codec to use. But then nothing. No vid or sound. Just sits there without even the courtesy of an error message.
If I add -b then the screen blanks, so omxplayer is definitely able to send that change to the hdmi output
This may seem a bit pointless,but I am trying to understand the streaming mechanism with a view to replacing the cat with nc, or some other mechanism to provide streaming. I want hw accelerated video rendering so I figured omxplayer was the way to go.
Tried --genlog and it generated an omplayer.log as shown below, but I can't interpret it. Any ideas?
I'm running a model 1 rpi (2012 with 512K, medium overclock)
uname -a
Linux alice 5.10.103+ #1529 Tue Mar 8 12:19:18 GMT 2022 armv6l GNU/Linux
15:37:42 T:18446744071896302655 DEBUG: DllBcm: Using omx system library
15:37:42 T:18446744071896310619 DEBUG: DllOMX: Using omx system library
15:37:42 T:18446744071896316156 DEBUG: DllAvFormat: Using libavformat system library
15:37:42 T:18446744071896330767 DEBUG: DBus connection succeeded
15:37:42 T:18446744071896331310 DEBUG: DllAvUtilBase: Using libavutil system library
15:37:42 T:18446744071896331482 DEBUG: DllAvCodec: Using libavcodec system library
15:37:42 T:18446744071896331629 DEBUG: DllAvFormat: Using libavformat system library
15:37:43 T:18446744071896641670 DEBUG: COMXCoreComponent::Initialize OMX.broadcom.clock input port 80 output port 81 m_handle 0x190e3a0
15:37:43 T:18446744071896644473 DEBUG: OMXClock::OMXStop
15:37:43 T:18446744071896645461 DEBUG: OMXClock::OMXSetSpeed(0.00) pause_resume:1
15:37:43 T:18446744071896646725 DEBUG: DllAvUtilBase: Using libavutil system library
15:37:43 T:18446744071896647084 DEBUG: DllAvCodec: Using libavcodec system library
15:37:43 T:18446744071896647244 DEBUG: DllAvFormat: Using libavformat system library
15:37:43 T:18446744071896656635 DEBUG: COMXCoreComponent::Initialize OMX.broadcom.video_decode input port 130 output port 131 m_handle 0x190e2b0
15:37:43 T:18446744071896665681 DEBUG: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.video_decode) - port(130), nBufferCountMin(1), nBufferCountActual(60), nBufferSize(81920), nBufferAlignmen(16)
15:37:43 T:18446744071896718556 DEBUG: COMXVideo::Open - decoder_component(0x0x190e2b0), input_port(0x82), output_port(0x83) deinterlace 1 hdmiclocksync 0
15:37:43 T:18446744071896722676 DEBUG: OMXThread::Create - Thread with id -1390416192 started
15:37:43 T:18446744071896724920 DEBUG: OMXThread::Create - Thread with id -1398808896 started
15:37:43 T:18446744071896725390 DEBUG: DllAvUtilBase: Using libavutil system library
15:37:43 T:18446744071896725579 DEBUG: DllAvCodec: Using libavcodec system library
15:37:43 T:18446744071896725731 DEBUG: DllAvFormat: Using libavformat system library
15:37:43 T:18446744071896726018 DEBUG: DllAvUtilBase: Using libavutil system library
15:37:43 T:18446744071896726180 DEBUG: DllAvCodec: Using libavcodec system library
15:37:43 T:18446744071896726328 DEBUG: DllAvFormat: Using libswresample system library
15:37:43 T:18446744071896731219 DEBUG: DllAvUtilBase: Using libavutil system library
15:37:43 T:18446744071896731512 DEBUG: COMXAudio::SetCodingType OMX_AUDIO_CodingPCM
15:37:43 T:18446744071896731834 INFO: CPCMRemap: I channel map: FL,FR
15:37:43 T:18446744071896732139 INFO: CPCMRemap: O channel map: FL,FR
15:37:43 T:18446744071896732308 DEBUG: CPCMRemap: Downmix normalization is disabled
15:37:43 T:18446744071896732598 DEBUG: CPCMRemap: FL = FL(1.000000*)
15:37:43 T:18446744071896732858 DEBUG: CPCMRemap: FR = FR(1.000000*)
15:37:43 T:18446744071896749032 DEBUG: COMXCoreComponent::Initialize OMX.broadcom.audio_decode input port 120 output port 121 m_handle 0x191eb10
15:37:43 T:18446744071896758587 DEBUG: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.audio_decode) - port(120), nBufferCountMin(4), nBufferCountActual(16), nBufferSize(65536), nBufferAlignmen(16)
15:37:43 T:18446744071896782313 DEBUG: COMXAudio::Initialize Input bps 32 samplerate 44100 channels 2 buffer size 529200 bytes per second 352800
15:37:43 T:18446744071896785722 DEBUG: pcm->direction : input
15:37:43 T:18446744071896786081 DEBUG: pcm->nPortIndex : 120
15:37:43 T:18446744071896786246 DEBUG: pcm->eNumData : 0
15:37:43 T:18446744071896786400 DEBUG: pcm->eEndian : 1
15:37:43 T:18446744071896786552 DEBUG: pcm->bInterleaved : 1
15:37:43 T:18446744071896786707 DEBUG: pcm->nBitPerSample : 32
15:37:43 T:18446744071896786951 DEBUG: pcm->ePCMMode : 0
15:37:43 T:18446744071896787116 DEBUG: pcm->nChannels : 2
15:37:43 T:18446744071896787273 DEBUG: pcm->nSamplingRate : 44100
15:37:43 T:18446744071896787426 DEBUG: OMX_AUDIO_ChannelLF
15:37:43 T:18446744071896787573 DEBUG: OMX_AUDIO_ChannelRF
15:37:43 T:18446744071896787941 DEBUG: COMXAudio::Initialize device omx:hdmi passthrough 0 hwdecode 0
15:37:43 T:18446744071896790492 DEBUG: OMXThread::Create - Thread with id -1409540416 started
15:37:43 T:18446744071896792366 NOTICE: OMXClock using audio as reference
15:37:43 T:18446744071896795919 DEBUG: OMXClock::OMXReset audio / video : 1 / 1 wait mask 0->3 state : 2->1
15:37:43 T:18446744071896798962 DEBUG: Popped message member: NameAcquired interface: org.freedesktop.DBus type: 4 path: /org/freedesktop/DBus
15:37:43 T:18446744071896799494 WARNING: Unhandled dbus message, member: NameAcquired interface: org.freedesktop.DBus type: 4 path: /org/freedesktop/DBus
15:37:43 T:18446744071896800666 DEBUG: Normal M:0 (A:-4503599627370496 V:-4503599627370496) P:1 A:0.00 V:0.00/T:0.20 (0,0,0,0) A:0% V:0% (0.00,6.34)
15:37:43 T:18446744071896802089 INFO: COMXVideo::SubmitEOS
15:37:43 T:18446744071896804853 INFO: COMXAudio::SubmitEOS
15:37:43 T:18446744071896827226 DEBUG: Popped message member: NameAcquired interface: org.freedesktop.DBus type: 4 path: /org/freedesktop/DBus
15:37:43 T:18446744071896827595 WARNING: Unhandled dbus message, member: NameAcquired interface: org.freedesktop.DBus type: 4 path: /org/freedesktop/DBus
15:37:43 T:18446744071896828571 DEBUG: Normal M:0 (A:-4503599627370496 V:-4503599627370496) P:1 A:0.00 V:0.00/T:0.20 (0,0,0,0) A:0% V:0% (0.00,6.34)
15:37:43 T:18446744071896829028 DEBUG: Resume 0.00,0.00 (0,0,0,0) EOF:1 PKT:(nil)
15:37:43 T:18446744071896829226 DEBUG: OMXClock::OMXSetSpeed(1.00) pause_resume:1
15:37:43 T:18446744071896851193 DEBUG: Normal M:0 (A:-4503599627370496 V:-4503599627370496) P:0 A:0.00 V:0.00/T:0.20 (0,0,0,0) A:0% V:0% (0.00,6.34)

Related

VNC is Getting disconnected in aerokube moon

i deployed moon aerokube on my k8s cluster, i enabled vnc option on my code, but i am unable to see the test execution on the VNC in question, and i got the following error :
I would like to know why ?
in addtion, i will give the logs of each container of the pod related to the session lanched by my program:
vscode ➜ /workspaces/workdir $ kubectl -n moon logs -f chrome-88-0-09941471-c519-4562-a50c-15d028b67437 -c browser
Starting ChromeDriver 88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324#{#1784}) on port 4444
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
vscode ➜ /workspaces/workdir $
============================
scode ➜ /workspaces/workdir $ kubectl -n moon logs -f chrome-88-0-09941471-c519-4562-a50c-15d028b67437 -c defender
2022/10/07 11:58:38 headless mode: false
2022/10/07 11:58:38 listening on :4545
2022/10/07 11:58:38 waiting for webdriver
2022/10/07 11:58:39 webdriver started in 723.391863ms
2022/10/07 11:58:39 proxy POST to http://127.0.0.1:4444/session]
2022/10/07 11:58:40 proxy POST to http://127.0.0.1:4444/session/47fcc1192a20549578edd3f5142f02be/url]
2022/10/07 11:58:41 proxy GET to http://127.0.0.1:4444/session/47fcc1192a20549578edd3f5142f02be/title]
2022/10/07 11:58:41 proxy GET to http://127.0.0.1:4444/session/47fcc1192a20549578edd3f5142f02be/screenshot]
2022/10/07 12:00:21 received terminated (15) signal
2022/10/07 12:00:21 graceful shutdown in 30s
2022/10/07 12:00:21 http: Server closed
2022/10/07 12:00:21 exited
vscode ➜ /workspaces/workdir $
============================
vscode ➜ /workspaces/workdir $ kubectl -n moon logs -f chrome-88-0-09941471-c519-4562-a50c-15d028b67437 -c x-server
X.Org X Server 1.21.1.3
X Protocol Version 11, Revision 0
Current Operating System: Linux chrome-88-0-09941471-c519-4562-a50c-15d028b67437 5.4.0-1090-azure #95~18.04.1-Ubuntu SMP Sun Aug 14 20:09:27 UTC 2022 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-1090-azure root=UUID=11ae0071-786c-4dd3-96b1-7b92873c6b43 ro console=tty1 console=ttyS0 earlyprintk=ttyS0
xorg-server 2:21.1.3-2ubuntu2.1 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.40.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri Oct 7 11:58:38 2022
(++) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Openbox-Message: Unable to find a valid menu file "/var/lib/openbox/debian-menu.xml"
X connection to :0 broken (explicit kill or server shutdown).
(II) Server terminated successfully (0). Closing log file.
vscode ➜ /workspaces/workdir $
===============================
vscode ➜ /workspaces/workdir $ kubectl -n moon logs -f chrome-88-0-09941471-c519-4562-a50c-15d028b67437 -c vnc-server
07/10/2022 11:58:38 passing arg to libvncserver: -passwd
07/10/2022 11:58:38 passing arg to libvncserver: -rfbport
07/10/2022 11:58:38 passing arg to libvncserver: 5900
07/10/2022 11:58:38 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 12
07/10/2022 11:58:39 Using X display :0
07/10/2022 11:58:39 rootwin: 0x50e reswin: 0x200001 dpy: 0x86dbe670
07/10/2022 11:58:39
07/10/2022 11:58:39 ------------------ USEFUL INFORMATION ------------------
07/10/2022 11:58:39 X DAMAGE available on display, using it for polling hints.
07/10/2022 11:58:39 To disable this behavior use: '-noxdamage'
07/10/2022 11:58:39
07/10/2022 11:58:39 Most compositing window managers like 'compiz' or 'beryl'
07/10/2022 11:58:39 cause X DAMAGE to fail, and so you may not see any screen
07/10/2022 11:58:39 updates via VNC. Either disable 'compiz' (recommended) or
07/10/2022 11:58:39 supply the x11vnc '-noxdamage' command line option.
07/10/2022 11:58:39
07/10/2022 11:58:39 Wireframing: -wireframe mode is in effect for window moves.
07/10/2022 11:58:39 If this yields undesired behavior (poor response, painting
07/10/2022 11:58:39 errors, etc) it may be disabled:
07/10/2022 11:58:39 - use '-nowf' to disable wireframing completely.
07/10/2022 11:58:39 - use '-nowcr' to disable the Copy Rectangle after the
07/10/2022 11:58:39 moved window is released in the new position.
07/10/2022 11:58:39 Also see the -help entry for tuning parameters.
07/10/2022 11:58:39 You can press 3 Alt_L's (Left "Alt" key) in a row to
07/10/2022 11:58:39 repaint the screen, also see the -fixscreen option for
07/10/2022 11:58:39 periodic repaints.
07/10/2022 11:58:39
07/10/2022 11:58:39 XFIXES available on display, resetting cursor mode
07/10/2022 11:58:39 to: '-cursor most'.
07/10/2022 11:58:39 to disable this behavior use: '-cursor arrow'
07/10/2022 11:58:39 or '-noxfixes'.
07/10/2022 11:58:39 using XFIXES for cursor drawing.
07/10/2022 11:58:39 GrabServer control via XTEST.
07/10/2022 11:58:39
07/10/2022 11:58:39 Scroll Detection: -scrollcopyrect mode is in effect to
07/10/2022 11:58:39 use RECORD extension to try to detect scrolling windows
07/10/2022 11:58:39 (induced by either user keystroke or mouse input).
07/10/2022 11:58:39 If this yields undesired behavior (poor response, painting
07/10/2022 11:58:39 errors, etc) it may be disabled via: '-noscr'
07/10/2022 11:58:39 Also see the -help entry for tuning parameters.
07/10/2022 11:58:39 You can press 3 Alt_L's (Left "Alt" key) in a row to
07/10/2022 11:58:39 repaint the screen, also see the -fixscreen option for
07/10/2022 11:58:39 periodic repaints.
07/10/2022 11:58:39
07/10/2022 11:58:39 XKEYBOARD: number of keysyms per keycode 7 is greater
07/10/2022 11:58:39 than 4 and 51 keysyms are mapped above 4.
07/10/2022 11:58:39 Automatically switching to -xkb mode.
07/10/2022 11:58:39 If this makes the key mapping worse you can
07/10/2022 11:58:39 disable it with the "-noxkb" option.
07/10/2022 11:58:39 Also, remember "-remap DEAD" for accenting characters.
07/10/2022 11:58:39
07/10/2022 11:58:39 X FBPM extension not supported.
Xlib: extension "DPMS" missing on display ":0".
07/10/2022 11:58:39 X display is not capable of DPMS.
07/10/2022 11:58:39 --------------------------------------------------------
07/10/2022 11:58:39
07/10/2022 11:58:39 Default visual ID: 0x21
07/10/2022 11:58:39 Read initial data from X display into framebuffer.
07/10/2022 11:58:39 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/3584
07/10/2022 11:58:39
07/10/2022 11:58:39 X display :0 is 32bpp depth=24 true color
07/10/2022 11:58:39
07/10/2022 11:58:39 Listening for VNC connections on TCP port 5900
07/10/2022 11:58:39 Listening for VNC connections on TCP6 port 5900
07/10/2022 11:58:39 listen6: bind: Address already in use
07/10/2022 11:58:39 Not listening on IPv6 interface.
07/10/2022 11:58:39
07/10/2022 11:58:39 Xinerama is present and active (e.g. multi-head).
07/10/2022 11:58:39 Xinerama: number of sub-screens: 1
07/10/2022 11:58:39 Xinerama: no blackouts needed (only one sub-screen)
07/10/2022 11:58:39
X11 MIT Shared Memory Attach failed:
Is your DISPLAY=:0 on a remote machine?
Suggestion, use: x11vnc -display :0 ... for local display :0
caught X11 error:
07/10/2022 11:58:39 deleted 28 tile_row polling images.
X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 130 (MIT-SHM)
Minor opcode of failed request: 1 (X_ShmAttach)
Serial number of failed request: 52
Current serial number in output stream: 82
vscode ➜ /workspaces/workdir $
==========================
vscode ➜ /workspaces/workdir $ kubectl -n moon logs -f chrome-88-0-09941471-c519-4562-a50c-15d028b67437 -c video-recorder
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11.2.1 (Alpine 11.2.1_git20220219) 20220219
configuration: --prefix=/usr --pkg-config-flags=--static --extra-libs='-lpthread -lm -lz' --extra-ldexeflags=-static --enable-gpl --enable-static --enable-small --enable-avfilter --enable-libx264 --enable-libxcb --disable-ffplay --disable-ffprobe --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-w32threads --disable-alsa --disable-audiotoolbox --disable-cuda --disable-cuvid --disable-d3d11va --disable-dxva2 --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-librtmp --disable-devices --disable-debug --disable-asm --enable-indev=xcbgrab
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, x11grab, from '127.0.0.1:0':
Duration: N/A, start: 1665143919.415154, bitrate: 142442 kb/s
Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 896x414, 142442 kb/s, 12 fps, 12 tbr, 1000k tbn, 1000k tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
[libx264 # 0x7f2d3e8bab30] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0x7f2d3e8bab30] profile High, level 2.2, 4:2:0, 8-bit
[libx264 # 0x7f2d3e8bab30] 264 - core 163 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - 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=6 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=250 keyint_min=12 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/home/user/Downloads/test.mp4':
Metadata:
encoder : Lavf58.76.100
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, progressive), 896x414, q=2-31, 12 fps, 12288 tbn
Metadata:
encoder : Lavc58.134.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 1222 fps= 12 q=-1.0 Lsize= 97kB time=00:01:41.58 bitrate= 7.9kbits/s speed= 1x
video:82kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 18.394022%
[libx264 # 0x7f2d3e8bab30] frame I:7 Avg QP: 9.23 size: 6048
[libx264 # 0x7f2d3e8bab30] frame P:309 Avg QP: 6.46 size: 52
[libx264 # 0x7f2d3e8bab30] frame B:906 Avg QP:10.68 size: 28
[libx264 # 0x7f2d3e8bab30] consecutive B-frames: 1.0% 0.5% 0.0% 98.5%
[libx264 # 0x7f2d3e8bab30] mb I I16..4: 54.6% 40.4% 5.0%
[libx264 # 0x7f2d3e8bab30] mb P I16..4: 0.4% 0.0% 0.0% P16..4: 0.0% 0.0% 0.0% 0.0% 0.0% skip:99.6%
[libx264 # 0x7f2d3e8bab30] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.1% 0.0% 0.0% direct: 0.0% skip:99.9% L0:78.7% L1:21.3% BI: 0.0%
[libx264 # 0x7f2d3e8bab30] 8x8 transform intra:34.7% inter:1.7%
[libx264 # 0x7f2d3e8bab30] coded y,uvDC,uvAC intra: 3.8% 1.5% 1.2% inter: 0.0% 0.0% 0.0%
[libx264 # 0x7f2d3e8bab30] i16 v,h,dc,p: 76% 18% 5% 0%
[libx264 # 0x7f2d3e8bab30] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 57% 6% 0% 0% 0% 0% 0% 0%
[libx264 # 0x7f2d3e8bab30] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 35% 13% 2% 4% 5% 4% 3% 4%
[libx264 # 0x7f2d3e8bab30] i8c dc,h,v,p: 99% 1% 1% 0%
[libx264 # 0x7f2d3e8bab30] Weighted P-Frames: Y:0.3% UV:0.0%
[libx264 # 0x7f2d3e8bab30] ref P L0: 55.5% 0.0% 44.5%
[libx264 # 0x7f2d3e8bab30] ref B L0: 53.8% 46.2%
[libx264 # 0x7f2d3e8bab30] ref B L1: 96.0% 4.0%
[libx264 # 0x7f2d3e8bab30] kb/s:6.57
Exiting normally, received signal 15.
Uploading /home/user/Downloads/test.mp4 to s3://videos/automation/2022-10-07/test.mp4
upload: Downloads/test.mp4 to s3://videos/automation/2022-10-07/test.mp4
vscode ➜ /workspaces/workdir
============================
I have to change the image of x-server container to aerokube/xvfb-server

Stream audio from raspberry via VLC: access_alsa demux error: cannot restrict channels count: Invalid argument

I want to stream microphone audio from a raspberry pi (3) via VLC. The microphone is a respeaker with 4 channels - maybe this is causing the issues?
The hardware is detected properly:
pi#raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 2: seeed4micvoicec [seeed-4mic-voicecard], device 0: bcm2835-i2s-ac10x-codec0 ac10x-codec0-0 [bcm2835-i2s-ac10x-codec0 ac10x-codec0-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
Also creating a test record accessing the hw direcly works fine
pi#raspberrypi:~ $ arecord -D hw:2,0 -d 3 -f S32_LE test.wav -c 4
Recording WAVE 'test.wav' : Signed 32 bit Little Endian, Rate 8000 Hz, Channels 4
Same as with plughw:
pi#raspberrypi:~ $ arecord -D plughw:2,0 -d 3 test.wav -c 4
Recording WAVE 'test.wav' : Unsigned 8 bit, Rate 8000 Hz, Channels 4
Howver, trying to stream via VLC with
cvlc -vvv alsa://plughw:2,0 --sout '#transcode{acodec=mp3,ab=128}:rtp{mux=ts,dst=192.168.0.135,sdp=sap}'
does not work and gives: (short, full console output below)
[736060c0] access_alsa demux error: cannot restrict channels count: Invalid argument
[736060c0] main demux debug: no access_demux modules matched
[73617f90] main stream debug: creating access: alsa://plughw:2,0
[73617f90] main stream debug: looking for access module matching "alsa": 29 candidates
[73617f90] main stream debug: no access modules matched
[73500668] main input error: Your input can't be opened
What is the right command? Just adding channels=2 or something similar did not work.
Is there maybe another good approach to stream "live" audio from a raspberry?
full output:
pi#raspberrypi:~ $ cvlc -vvv alsa://plughw:2,0 --sout '#transcode{acodec=mp3,ab=128,channels=4}:rtp{mux=ts,dst=192.168.0.135,sdp=sap}'
VLC media player 3.0.17.4 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0035fb58] main libvlc debug: VLC media player - 3.0.17.4 Vetinari
[0035fb58] main libvlc debug: Copyright © 1996-2022 the VideoLAN team
[0035fb58] main libvlc debug: revision 3.0.13-8-g41878ff4f2
[0035fb58] main libvlc debug: configured with ./configure '--build=arm-linux-gnueabihf' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=${prefix}/lib/arm-linux-gnueabihf' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-debug' '--config-cache' '--disable-update-check' '--enable-fast-install' '--docdir=/usr/share/doc/vlc' '--with-binary-version=3.0.17.4-0+deb10u1' '--enable-a52' '--enable-aa' '--enable-aom' '--enable-aribsub' '--enable-avahi' '--enable-bluray' '--enable-caca' '--enable-chromaprint' '--enable-chromecast' '--enable-dbus' '--enable-dca' '--enable-dvbpsi' '--enable-dvdnav' '--enable-faad' '--enable-flac' '--enable-fluidsynth' '--enable-freetype' '--enable-fribidi' '--enable-gles2' '--enable-gnutls' '--enable-harfbuzz' '--enable-jack' '--enable-kate' '--enable-libass' '--enable-libmpeg2' '--enable-libxml2' '--enable-lirc' '--enable-live555' '--enable-mad' '--enable-matroska' '--enable-mod' '--enable-mpc' '--enable-mpg123' '--enable-mtp' '--enable-ncurses' '--enable-notify' '--enable-ogg' '--enable-opus' '--enable-pulse' '--enable-qt' '--enable-realrtsp' '--enable-samplerate' '--enable-sdl-image' '--enable-sftp' '--enable-shine' '--enable-shout' '--enable-skins2' '--enable-sndio' '--enable-soxr' '--enable-spatialaudio' '--enable-speex' '--enable-svg' '--enable-svgdec' '--enable-taglib' '--enable-theora' '--enable-twolame' '--enable-upnp' '--enable-vdpau' '--enable-vnc' '--enable-vorbis' '--enable-x264' '--enable-x265' '--enable-zvbi' '--with-kde-solid=/usr/share/solid/actions/' '--disable-d3d11va' '--disable-decklink' '--disable-directx' '--disable-dsm' '--disable-dxva2' '--disable-fdkaac' '--disable-fluidlite' '--disable-freerdp' '--disable-goom' '--disable-gst-decode' '--disable-libtar' '--disable-macosx' '--disable-macosx-avfoundation' '--disable-macosx-qtkit' '--disable-microdns' '--disable-mfx' '--disable-opencv' '--disable-projectm' '--disable-schroedinger' '--disable-sparkle' '--disable-srt' '--disable-telx' '--disable-vpx' '--disable-vsxu' '--disable-wasapi' '--enable-alsa' '--enable-dc1394' '--enable-dv1394' '--enable-libplacebo' '--enable-linsys' '--enable-nfs' '--enable-omxil' '--enable-udev' '--enable-v4l2' '--enable-wayland' '--enable-libva' '--enable-vcd' '--enable-smbclient' '--disable-oss' '--disable-crystalhd' '--disable-mmx' '--disable-sse' '--disable-neon' '--disable-altivec' 'build_alias=arm-linux-gnueabihf' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/vlc-2z7Jum/vlc-3.0.17.4=. -fstack-protector-strong -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fdebug-prefix-map=/build/vlc-2z7Jum/vlc-3.0.17.4=. -fstack-protector-strong -Wformat -Werror=format-security ' 'OBJCFLAGS=-g -O2 -fdebug-prefix-map=/build/vlc-2z7Jum/vlc-3.0.17.4=. -fstack-protector-strong -Wformat -Werror=format-security'
[0035fb58] main libvlc debug: searching plug-in modules
[0035fb58] main libvlc debug: loading plugins cache file /usr/lib/arm-linux-gnueabihf/vlc/plugins/plugins.dat
[0035fb58] main libvlc debug: recursively browsing `/usr/lib/arm-linux-gnueabihf/vlc/plugins'
[0035fb58] main libvlc debug: plug-ins loaded: 516 modules
[0035fb58] main libvlc debug: opening config file (/home/pi/.config/vlc/vlcrc)
[0035fd78] main logger debug: looking for logger module matching "any": 4 candidates
[0035fd78] main logger debug: using logger module "console"
[0035fb58] main libvlc debug: translation test: code is "C"
[003c7660] main keystore debug: looking for keystore module matching "memory": 4 candidates
[003c7660] main keystore debug: using keystore module "memory"
[0035fb58] main libvlc debug: CPU has capabilities ARM_NEON FPU
[003cb3c8] main input debug: Creating an input for 'Media Library'
[003cb3c8] main input debug: Input is a meta file: disabling unneeded options
[003cb3c8] main input debug: using timeshift granularity of 50 MiB
[003cb3c8] main input debug: using default timeshift path
[003cb3c8] main input debug: `file/directory:///home/pi/.local/share/vlc/ml.xspf' gives access `file' demux `directory' path `/home/pi/.local/share/vlc/ml.xspf'
[003bed90] main input source debug: creating demux: access='file' demux='directory' location='/home/pi/.local/share/vlc/ml.xspf' file='/home/pi/.local/share/vlc/ml.xspf'
[003bee78] main demux debug: looking for access_demux module matching "file": 17 candidates
[003bee78] main demux debug: no access_demux modules matched
[003c3a38] main stream debug: creating access: file:///home/pi/.local/share/vlc/ml.xspf
[003c3a38] main stream debug: (path: /home/pi/.local/share/vlc/ml.xspf)
[003c3a38] main stream debug: looking for access module matching "file": 29 candidates
[003c3a38] main stream debug: using access module "filesystem"
[003d2530] main stream debug: looking for stream_filter module matching "prefetch,cache_read": 26 candidates
[003d2530] cache_read stream debug: Using stream method for AStream*
[003d2530] cache_read stream debug: starting pre-buffering
[003d2530] cache_read stream debug: received first data after 0 ms
[003d2530] cache_read stream debug: pre-buffering done 296 bytes in 0s - 1670 KiB/s
[003d2530] main stream debug: using stream_filter module "cache_read"
[003d2da0] main stream debug: looking for stream_filter module matching "any": 26 candidates
[003d2da0] playlist stream debug: using XSPF playlist reader
[003d2da0] main stream debug: using stream_filter module "playlist"
[003d2da0] main stream debug: stream filter added to 0x3d2530
[003d4fb0] main stream debug: looking for stream_filter module matching "any": 26 candidates
[003d4fb0] main stream debug: no stream_filter modules matched
[003d3430] main stream_directory debug: looking for stream_directory module matching "any": 1 candidates
[003d3430] main stream_directory debug: no stream_directory modules matched
[003bed90] main input source debug: attachment of directory-extractor failed for file:///home/pi/.local/share/vlc/ml.xspf
[003d4fb0] main stream debug: looking for stream_filter module matching "record": 26 candidates
[003d4fb0] main stream debug: using stream_filter module "record"
[003bed90] main input source debug: creating demux: access='file' demux='directory' location='/home/pi/.local/share/vlc/ml.xspf' file='/home/pi/.local/share/vlc/ml.xspf'
[003bee78] main demux debug: looking for demux module matching "directory": 55 candidates
[003bee78] main demux debug: using demux module "directory"
[003d7b38] main demux meta debug: looking for meta reader module matching "any": 2 candidates
[003d7b38] lua demux meta debug: Trying Lua scripts in /home/pi/.local/share/vlc/lua/meta/reader
[003d7b38] lua demux meta debug: Trying Lua scripts in /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/reader
[003d7b38] lua demux meta debug: Trying Lua playlist script /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/reader/filename.luac
[003d7b38] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[003d7b38] main demux meta debug: no meta reader modules matched
[003cb3c8] main input debug: `file/directory:///home/pi/.local/share/vlc/ml.xspf' successfully opened
[003c7710] main xml reader debug: looking for xml reader module matching "any": 1 candidates
[003c7710] main xml reader debug: using xml reader module "xml"
[003cb3c8] main input debug: EOF reached
[003bee78] main demux debug: removing module "directory"
[003d4fb0] main stream debug: removing module "record"
[003d2da0] main stream debug: removing module "playlist"
[003d2530] main stream debug: removing module "cache_read"
[003c3a38] main stream debug: removing module "filesystem"
[003d9918] main playlist debug: creating audio output
[003db950] main audio output debug: looking for audio output module matching "any": 6 candidates
[003db950] vlcpulse audio output debug: using library version 12.2.0
[003db950] vlcpulse audio output debug: (compiled with version 12.2.0, protocol 32)
[003db950] vlcpulse audio output debug: connected locally to unix:/run/user/1000/pulse/native as client #46
[003db950] vlcpulse audio output debug: using protocol 32, server protocol 32
[003db950] pulse audio output debug: adding sink 0: alsa_output.platform-bcm2835_audio.digital-stereo (Built-in Audio Digital Stereo)
[003db950] pulse audio output debug: adding sink 1: alsa_output.platform-bcm2835_audio.analog-stereo (Built-in Audio Analog Stereo)
[003db950] main audio output debug: using audio output module "pulse"
[003d9918] main playlist debug: keeping audio output
[003d7b38] main interface debug: looking for interface module matching "dbus,none": 19 candidates
[003d7b38] dbus interface debug: listening on dbus as: org.mpris.MediaPlayer2.vlc
[003d7b38] main interface debug: using interface module "dbus"
[003e7b58] main interface debug: looking for interface module matching "hotkeys,none": 19 candidates
[003e7b58] main interface debug: using interface module "hotkeys"
[003e8230] main interface debug: looking for interface module matching "globalhotkeys,none": 19 candidates
[003e8230] main interface debug: using interface module "xcb_hotkeys"
[003e8c68] main interface debug: looking for interface module matching "dummy": 19 candidates
[003e8c68] dummy interface: using the dummy interface module...
[003e8c68] main interface debug: using interface module "dummy"
[003d9918] main playlist debug: processing request item: null, node: Playlist, skip: 0
[003d9918] main playlist debug: rebuilding array of current - root Playlist
[003d9918] main playlist debug: rebuild done - 1 items, index -1
[003d9918] main playlist debug: starting playback of new item
[003d9918] main playlist debug: resyncing on alsa://plughw:2
[003d9918] main playlist debug: alsa://plughw:2 is at 0
[003d9918] main playlist debug: creating new input thread
[73500668] main input debug: Creating an input for 'alsa://plughw:2'
[003d9918] main playlist debug: requesting art for new input thread
[736008a8] main stream output debug: using sout chain=`transcode{acodec=mp3,ab=128,channels=4}:rtp{mux=ts,dst=192.168.0.135,sdp=sap}'
[736008a8] main stream output debug: stream=`rtp'
[73600c48] main stream out debug: looking for sout stream module matching "rtp": 23 candidates
[62500638] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[62500638] lua meta fetcher debug: Trying Lua scripts in /home/pi/.local/share/vlc/lua/meta/fetcher
[62500638] lua meta fetcher debug: Trying Lua scripts in /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/fetcher
[62500638] lua meta fetcher debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
[62500638] main meta fetcher debug: no meta fetcher modules matched
[62500638] main art finder debug: looking for art finder module matching "any": 2 candidates
[73600c48] main stream out debug: set config option: sout-rtp-mux to ts
[73600c48] main stream out debug: set config option: sout-rtp-dst to 192.168.0.135
[73600c48] main stream out debug: set config option: sout-rtp-sdp to sap
[73602010] main mux debug: looking for sout mux module matching "ts": 11 candidates
[62500638] lua art finder debug: Trying Lua scripts in /home/pi/.local/share/vlc/lua/meta/art
[62500638] lua art finder debug: Trying Lua scripts in /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/art
[62500638] lua art finder debug: Trying Lua playlist script /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/art/00_musicbrainz.luac
[62500638] lua art finder debug: skipping script (unmatched scope) /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/art/00_musicbrainz.luac
[62500638] lua art finder debug: Trying Lua playlist script /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/art/01_googleimage.luac
[73602010] mux_ts mux debug: shaping=200000 pcr=70000 dts_delay=400000
[73602010] main mux debug: using sout mux module "mux_ts"
[736008a8] main stream output debug: muxer support adding stream at any time
[736008a8] main stream output debug: muxer prefers to wait for all ES before starting to mux
[73600c48] stream_out_rtp stream out warning: unknown protocol for SDP ((null))
[73600c48] stream_out_rtp stream out debug: maximum RTP packet size: 1400 bytes
[73600c48] main stream out debug: net: connecting to [192.168.0.135]:5004
[62500638] lua art finder debug: skipping script (unmatched scope) /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/art/01_googleimage.luac
[73600c48] main stream out debug: net: connecting to [192.168.0.135]:5005 from [192.168.0.135]:46230
[62500638] lua art finder debug: Trying Lua playlist script /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/art/02_frenchtv.luac
[73600c48] stream_out_rtp stream out debug: sdp=
v=0
o=- 16602235945714572343 16602235945714572343 IN IP4 raspberrypi
s=Unnamed
i=N/A
c=IN IP4 192.168.0.135
t=0 0
a=tool:vlc 3.0.17.4
a=recvonly
a=type:broadcast
a=charset:UTF-8
m=video 5004 RTP/AVP 33
b=RR:0
a=rtpmap:33 MP2T/90000
[73600c48] main stream out debug: using sout stream module "stream_out_rtp"
[736008a8] main stream output debug: stream=`transcode'
[73604710] main stream out debug: looking for sout stream module matching "transcode": 23 candidates
[62500638] lua art finder debug: skipping script (unmatched scope) /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/art/02_frenchtv.luac
[62500638] lua art finder debug: Trying Lua playlist script /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/art/03_lastfm.luac
[73604710] main stream out debug: set config option: sout-transcode-acodec to mp3
[73604710] main stream out debug: set config option: sout-transcode-ab to 128
[73604710] main stream out debug: set config option: sout-transcode-channels to 4
[62500638] lua art finder debug: skipping script (unmatched scope) /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/art/03_lastfm.luac
[73604710] stream_out_transcode stream out debug: Checking codec mapping for mp3 got mp3
[73604710] stream_out_transcode stream out warning: 4 channels invalid for mp2/mp3, forcing to 2
[73604710] stream_out_transcode stream out debug: codec audio=mp3 0Hz 2 channels 128Kb/s
[62500638] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[73604710] main stream out debug: using sout stream module "stream_out_transcode"
[62500638] main art finder debug: no art finder modules matched
[73500668] main input debug: using timeshift granularity of 50 MiB
[73500668] main input debug: using default timeshift path
[73500668] main input debug: `alsa://plughw:2,0' gives access `alsa' demux `any' path `plughw:2,0'
[73605fc0] main input source debug: creating demux: access='alsa' demux='any' location='plughw:2,0' file='(null)'
[736060c0] main demux debug: looking for access_demux module matching "alsa": 17 candidates
[62200638] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[62200638] lua meta fetcher debug: Trying Lua scripts in /home/pi/.local/share/vlc/lua/meta/fetcher
[62200638] lua meta fetcher debug: Trying Lua scripts in /usr/lib/arm-linux-gnueabihf/vlc/lua/meta/fetcher

Laggy video and longer duration than the original file

I'm trying to convert a file with this output in ffmpeg:
ffmpeg version 4.3.1-2021-01-01-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
Last message repeated 5 times
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
Last message repeated 1 times
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
Last message repeated 1 times
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
Last message repeated 1 times
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
Last message repeated 1 times
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
Last message repeated 1 times
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
Last message repeated 1 times
[mpeg2video # 000002e8de943080] Invalid frame dimensions 0x0.
[s302m # 000002e8de960780] S302 non PCM mode with data type 28 not supported
Last message repeated 4 times
[mpegts # 000002e8de93cbc0] decoding for stream 3 failed
[mpegts # 000002e8de93cbc0] Could not find codec parameters for stream 3 (Audio: s302m (BSSD / 0x44535342), stereo, s32 (20 bit), 2304 kb/s): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'G:\test\test.ts':
Duration: 03:27:29.61, start: 3.000000, bitrate: 39124 kb/s
Program 1
Stream #0:0[0x200]: Video: mpeg2video (4:2:2) ([2][0][0][0] / 0x0002), yuv422p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 450 tbr, 90k tbn, 50 tbc
Side data:
cpb: bitrate max/min/avg: 36898800/0/0 buffer size: 13271040 vbv_delay: N/A
Stream #0:1[0x1010]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s
Stream #0:2[0x1020]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s
Stream #0:3[0x1030]: Audio: s302m (BSSD / 0x44535342), stereo, s32 (20 bit), 2304 kb/s
But whatever setting i try the video ends up very laggy and the duration ends up much longer than the original file, even when I play it through VLC. It is a little hard to explain so I will provide a sample file here with the result after the conversion:
https://drive.google.com/file/d/1ADPF2POSnBCiJkgMES2vOn2wznyBst6W/view?usp=sharing
Is it something wrong with the file or with ffmpeg itself and how do I solve it?
Firstly I tried this command:
ffmpeg -i "G:\test\test.ts" -map 0:0 -map 0:1 -vcodec libx265 -crf 23 -filter:v yadif=1 -acodec ac3 -ab 384k "C:\Users\User name\Videos\test.mkv"
And then I tried this with the same result:
ffmpeg -i "G:\test\test.ts" -map 0:0 -map 0:1 -vcodec copy -acodec copy "C:\Users\User name\Videos\test.mkv"
The sample file is converted with the first command.

How to encode specific metadata version in FFMPEG?

I am batch converting lots of songs into shorter "Advert" songs for SHOUTcast and to be recognised as adverts by the server. The song must have ":Advert" for both the title and the artist metadata tags. When I use the following command:
ffmpeg -i "$i" -c copy -vn -map_metadata -1 -metadata title=":Advert" -metadata artist=":Advert" -t 120 "adverts/ADVERT_$i"
I would expect it to output the song with only ":Advert" as title and artist metadata but when I import it into the radio playout software (using ID3 1.x tagging) the metadata has not copied across and is therefore lost. Output from ffmpeg:
ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.37)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --disable-lzma --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
[mp3 # 0x7feba6800000] Skipping 0 bytes of junk at 230934.
[mjpeg # 0x7feba7000600] Changing bps to 8
Input #0, mp3, from 'Joakim Karud - Vibe With Me.mp3':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6mp41
encoder : Lavf56.40.101
artist : Joakim Karud
title : Vibe With Me
Duration: 00:02:53.06, start: 0.025056, bitrate: 138 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
Metadata:
encoder : Lavc56.60
Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc
Metadata:
comment : Cover (front)
Output #0, mp3, to 'adverts/ADVERT_Joakim Karud - Vibe With Me.mp3':
Metadata:
TIT2 : :Advert
TPE1 : :Advert
TSSE : Lavf57.25.100
Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size= 1876kB time=00:02:00.00 bitrate= 128.1kbits/s speed=1.44e+03x
video:0kB audio:1876kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.024837%
I believe this is happening because the tag names are different (e.g. title should be title, but is TIT2 when output. Please could someone specify how I could ensure that the metadata is encoded in the ID3 1.x format so that it is readable by the radio playout software. Many thanks.
FFmpeg, by default, writes only ID3v2.4 tags. ID3v1 has to be specified for writing.
Use
ffmpeg -i "$i" -c copy -vn -write_id3v1 true -map_metadata -1 -metadata title=":Advert" -metadata artist=":Advert" -t 120 "adverts/ADVERT_$i"

Terminate avconv streaming after X seconds

For an app I'm developing, I need avconv to stream from a link for a specified length of time. I've tried using -timelimit to no avail. What am I doing wrong? Is there a better way to do this? Why doesn't -timelimit work?
See, for example, the call below, which runs until terminated with ctrl-c.
stack#ThinkPad:~/app_dev$ avconv -timelimit 30 -i http://br-mp3-bayern2sued-m.akacast.akamaistream.net/7/731/256282/v1/gnl.akacast.akamaistream.net/br_mp3_bayern2sued_m stack_test.mp3
Which generates the following output.
avconv version 9.18-6:9.18-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
built on Mar 16 2015 13:19:10 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[mp3 # 0x765100] Header missing
[mp3 # 0x75f020] max_analyze_duration reached
[mp3 # 0x75f020] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, mp3, from 'http://br-mp3-bayern2sued-m.akacast.akamaistream.net/7/731/256282/v1/gnl.akacast.akamaistream.net/br_mp3_bayern2sued_m':
Duration: N/A, start: 0.000000, bitrate: 128 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
Output #0, mp3, to 'stack_test.mp3':
Metadata:
TSSE : Lavf54.20.4
Stream #0.0: Audio: libmp3lame, 44100 Hz, stereo, s16p
Stream mapping:
Stream #0:0 -> #0:0 (mp3 -> libmp3lame)
Press ctrl-c to stop encoding
[mp3 # 0x765100] Header missing
Error while decoding stream #0:0
[mp3 # 0x7639e0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: -2255 >= -2255
-t and -timelimit are different. More importantly, you need to use -t as an output option, not as an input option. Updating your example, the following should work (tested on ffmpeg).
ffmpeg -i http://br-mp3-bayern2sued-m.akacast.akamaistream.net/7/731/256282/v1/gnl.akacast.akamaistream.net/br_mp3_bayern2sued_m -t 30 stack_test.mp3