VNC is Getting disconnected in aerokube moon - kubernetes

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

Related

Streaming to Facebook Live from ffmpeg gets terminated

I am trying to capture the canvas on browser (canvas.captureStream), add audio ( captured using getUserMedia and added to stream using canvasStream.addTracks) and send it to server. Server sends the stream ( after encoding with H264 ) to facebook live using ffmpeg. However the stream is not stable and gets disconnected within minutes.
If the video along with audio tracks (using getMediaUser) is directly(without canvas.captureStream) sent it works fine. I am suspecting it has to do with the audio track not being proper and hence facebook rejecting it ( no particular error from ffmpeg, it just exits with IO error). Need help in figuring out the right way to send canvas stream along with audio.
Current ffmpeg command is as below
ffmpeg -i - -c:v libx264 -crf 23 -preset ultrafast \
-tune zerolatency -max_muxing_queue_size 1000 \
-vsync cfr -async 1 -bufsize 2M -r 30 -g 60 -keyint_min 30 \
-x264opts keyint=30 -pix_fmt yuv420p -level 3 \
-c:a aac -b:a 96k -ar 96000 \
-f tee -map 0:v -map 0:a [f=flv] <rtmp url 1> | [f=flv] <rtmp url 2>
Note: In the above command <rtmp url 1> and <rtmp url 2> are replaced with actual urls ( including the session key required )
My settings to capture canvas and audio on browser are as below
canvasStream = canvas.captureStream(30);
audioTrack = stream.getTracks().filter( (track) => {
return track.kind === 'audio';
})[0];
canvasStream.addTrack(audioTrack);
Note: Audio constraints given in getUserMedia are as below
audio: {
sampleRate: 44100,
echoCancellation: true
}
Error given by ffmpeg while exiting is as below
FFMPEG:[flv # 0x5626ecf0f7c0] Failed to update header with correct duration.
[flv # 0x5626ecf0f7c0] Failed to update header with correct filesize.
FFMPEG:[tee # 0x5626ec8550c0] Slave muxer #1 failed, aborting.
av_interleaved_write_frame(): Broken pipe
FFMPEG:[flv # 0x5626ecbe8840] Failed to update header with correct duration.
FFMPEG:[flv # 0x5626ecbe8840] Failed to update header with correct filesize.
FFMPEG:frame= 2378 fps= 22 q=22.0 Lsize=N/A time=00:01:21.17 bitrate=N/A dup=2202 drop=5 speed=0.745x
video:18916kB audio:959kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
FFMPEG:[libx264 # 0x5626ec855b80] frame I:80 Avg QP:13.97 size:115968
[libx264 # 0x5626ec855b80] frame P:2298 Avg QP:16.77 size: 4392
[libx264 # 0x5626ec855b80] mb I I16..4: 100.0% 0.0% 0.0%
FFMPEG:[libx264 # 0x5626ec855b80] mb P I16..4: 3.8% 0.0% 0.0% P16..4: 9.5% 0.0% 0.0% 0.0% 0.0% skip:86.7%
[libx264 # 0x5626ec855b80] coded y,uvDC,uvAC intra: 26.3% 42.2% 13.6% inter: 2.9% 6.1% 0.1%
[libx264 # 0x5626ec855b80] i16 v,h,dc,p: 34% 26% 23% 17%
[libx264 # 0x5626ec855b80] i8c dc,h,v,p: 46% 27% 20% 7%
[libx264 # 0x5626ec855b80] kb/s:1954.96
[aac # 0x5626ec84d200] Qavg: 122.161
Conversion failed!
Appreciate any help with this.
I am suspecting it has to do with the audio track not being proper and hence facebook rejecting it
Yes, this is correct. Facebook requires an audio track and will drop your stream if it isn't present.
For starters, drop -ar 96000 from your FFmpeg command. This would be setting a sample rate of 96 kHz, which Facebook isn't going to want. You really don't want to resample at FFmpeg anyway... just let it use whatever sample rate it gets from the browser.
Next, set your audio sample rate to 48 kHz rather than 44.1 kHz on your getUserMedia constraints. Facebook doesn't handle 44.1 kHz audio on the RTMP ingest well. (Generally these days, you want to use 48 kHz for everything unless you're targeting CD audio, which would be 44.1 kHz.)
Next, your FFmpeg audio command is outputting to two RTMP URLs. If one fails, they will both fail. If one gets behind, they will both be stalled. This is probably not what you want. :-) Drop one of them.
Now, make sure you have a decent and consistent frame rate. Facebook is very picky about this and will drop your stream.
To test/debug, replace your RTMP URL output with a simple FLV file on disk, to ensure things are working from the browser up through FFmpeg. Once you have that all smooth and working, you can reconnect to Facebook and go from there.

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 create virtual display under Raspbian using xrandr?

Could anybody help me out to understand how to create virtual display for Raspberry Pi 3 B running Raspbian using xrandr?
I saw that it is possible to do this, for example, for Ubuntu and Linux Mint by executing these commands:
#!/bin/bash
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VIRTUAL1 1920x1080_60.00
sleep 2
xrandr --output VIRTUAL1 --mode 1920x1080_60.00 --left-of HDMI1 --primary
xinput map-to-output $(xinput | grep -v 'XTEST.*pointer' |grep 'slave.*pointer' | grep -o 'id=*[0-9]*[0-9]' | cut -d'=' -f2) HDMI1
But under raspberry this script is not able to find VIRTUAL1 output.
When I simply run xrandr I get the following result:
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 320 x 240, current 1360 x 768, maximum 1360 x 768
default connected 1360x768+0+0 0mm x 0mm
1360x768 60.00*
1024x768 60.00
800x600 60.00 56.00
640x480 60.00
680x384 60.00
512x384 60.00
400x300 60.00 56.00
320x240 60.00
1920x1080_60.00 (0x2af) 172.800MHz -HSync +VSync
h: width 1920 start 2040 end 2248 total 2576 skew 0 clock 67.08KHz
v: height 1080 start 1081 end 1084 total 1118 clock 60.00Hz
with no VIRTUAL1 and HDMI1 listed, only default. Can't figure out what steps should be taken for these outputs to appear in the given list?
Or if it is not possible then how can I create virtual display using other tools?
You wont be creating a virtual display for use with RPI. What you need to do is link your display to xrandr. This is done with the following code in terminal.
DISPLAY=:0 xrandr
Once you have done this it will be linked to xrandr and you'll be able to use it as if on Linux. However, you will need to do this on every boot or create a script that will run on boot and do this for you.
Also using xrand are will not resize your frame-buffer, this will need to be done as well.

*Excruciatingly* slow (over ten seconds for `(+ 1 1)`) with language "How To Design Programs - Beginning Student"

I just installed DrRacket, and tried out the language "How To Design Programs - Beginning Student".
Racket - A programmable programming language
Racket - Getting Started
I run (+ 1 1), and it takes over ten seconds for this to show up:
Welcome to DrRacket, version 6.5 [3m].
Language: Beginning Student; memory limit: 128 MB.
2
>
As far as I can tell, my installation is pretty much "out of the box".
What I'm wondering is if my experience is unusual,
and if there's any obvious way to troubleshoot it if so
(I've looked around the settings and didn't find anything obvious to tweak),
or if maybe the whole HTDP language was quietly abandoned or something...?
EDIT 1
I have these files:
/usr/share/racket $
find -iname "*htdp*.zo"
./pkgs/htdp-lib/lang/private/compiled/create-htdp-executable_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-reader_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-beginner-abbr-reader_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-langs-save-file-prefix_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-advanced-reader_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-intermediate-lambda-reader_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-advanced_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-beginner-abbr_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-intermediate_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-intermediate-reader_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-langs_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-beginner_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-intermediate-lambda_rkt.zo
./pkgs/htdp-lib/lang/compiled/htdp-beginner-reader_rkt.zo
./pkgs/htdp-doc/scribblings/htdp-langs/compiled/htdp-langs_scrbl.zo
./pkgs/htdp-doc/scribblings/htdp-langs/compiled/htdp-ptr_scrbl.zo
./pkgs/htdp-doc/htdp/compiled/htdp_scrbl.zo
./pkgs/htdp-doc/htdp/compiled/htdp-lib_scrbl.zo
./pkgs/htdp-doc/teachpack/htdp/scribblings/compiled/htdp_scrbl.zo
./pkgs/htdp-doc/teachpack/2htdp/scribblings/compiled/2htdp_scrbl.zo
EDIT 2 - cpu and harddrive specs
CPU
$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 28
model name : Intel(R) Atom(TM) CPU N450 # 1.66GHz
stepping : 10
microcode : 0x107
cpu MHz : 1000.000
cache size : 512 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm dtherm
bugs :
bogomips : 3325.00
clflush size : 64
cache_alignment : 64
address sizes : 32 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 28
model name : Intel(R) Atom(TM) CPU N450 # 1.66GHz
stepping : 10
microcode : 0x107
cpu MHz : 1000.000
cache size : 512 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm dtherm
bugs :
bogomips : 3325.00
clflush size : 64
cache_alignment : 64
address sizes : 32 bits physical, 48 bits virtual
power management:
HD
$ sudo hdparm -I /dev/sda
/dev/sda:
ATA device, with non-removable media
Model Number: Hitachi HTS545016B9A300
Serial Number: 100324PBPB06ECC0K6XL
Firmware Revision: PBBOC60F
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6; Revision: ATA8-AST T13 Project D1697 Revision 0b
Standards:
Used: unknown (minor revision code 0x0028)
Supported: 8 7 6 5
Likely used: 8
Configuration:
Logical max current
cylinders 16383 16383
heads 16 16
sectors/track 63 63
--
CHS current addressable sectors: 16514064
LBA user addressable sectors: 268435455
LBA48 user addressable sectors: 312581808
Logical/Physical Sector size: 512 bytes
device size with M = 1024*1024: 152627 MBytes
device size with M = 1000*1000: 160041 MBytes (160 GB)
cache/buffer size = 7208 KBytes (type=DualPortCache)
Form Factor: 2.5 inch
Nominal Media Rotation Rate: 5400
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Vendor, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = 16
Advanced power management level: 254
Recommended acoustic management value: 128, current value: 254
DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
Enabled Supported:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* Host Protected Area feature set
* WRITE_BUFFER command
* READ_BUFFER command
* NOP cmd
* DOWNLOAD_MICROCODE
* Advanced Power Management feature set
Power-Up In Standby feature set
* SET_FEATURES required to spinup after power up
SET_MAX security extension
Automatic Acoustic Management feature set
* 48-bit Address feature set
* Device Configuration Overlay feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
* General Purpose Logging feature set
* WRITE_{DMA|MULTIPLE}_FUA_EXT
* 64-bit World wide name
* IDLE_IMMEDIATE with UNLOAD
* WRITE_UNCORRECTABLE_EXT command
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Native Command Queueing (NCQ)
* Host-initiated interface power management
* Phy event counters
* NCQ priority information
Non-Zero buffer offsets in DMA Setup FIS
* DMA Setup Auto-Activate optimization
Device-initiated interface power management
In-order data delivery
* Software settings preservation
* SMART Command Transport (SCT) feature set
* SCT Write Same (AC2)
* SCT Error Recovery Control (AC3)
* SCT Features Control (AC4)
* SCT Data Tables (AC5)
Security:
Master password revision code = 65534
supported
not enabled
not locked
frozen
not expired: security count
supported: enhanced erase
64min for SECURITY ERASE UNIT. 66min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000cca5ffc040a7
NAA : 5
IEEE OUI : 000cca
Unique ID : 5ffc040a7
Checksum: correct
EDIT 3 command-line times
ran (+ 1 1) in HTDP-beginner 3 times -- Over 5 seconds.
$ time racket -t racket_HTDP_beginner.rkt
2
5.60user 1.04system 0:08.46elapsed 78%CPU (0avgtext+0avgdata 127968maxresident)k
5496inputs+0outputs (46major+40955minor)pagefaults 0swaps
$ time racket -t racket_HTDP_beginner.rkt
2
5.51user 0.67system 0:06.71elapsed 92%CPU (0avgtext+0avgdata 128124maxresident)k
24inputs+0outputs (0major+41790minor)pagefaults 0swaps
$ time racket -t racket_HTDP_beginner.rkt
2
5.41user 0.67system 0:06.55elapsed 92%CPU (0avgtext+0avgdata 128180maxresident)k
0inputs+0outputs (0major+36683minor)pagefaults 0swaps
ran (+ 1 1) in #lang racket 3 times -- A bit over 2 seconds.
$ time racket -t racket_lang_racket.rkt
2
2.13user 0.25system 0:02.71elapsed 87%CPU (0avgtext+0avgdata 64996maxresident)k
0inputs+0outputs (0major+12437minor)pagefaults 0swaps
$ time racket -t racket_lang_racket.rkt
2
2.15user 0.25system 0:02.63elapsed 91%CPU (0avgtext+0avgdata 61700maxresident)k
0inputs+0outputs (0major+15853minor)pagefaults 0swaps
$ time racket -t racket_lang_racket.rkt
2
2.28user 0.29system 0:02.89elapsed 89%CPU (0avgtext+0avgdata 61500maxresident)k
0inputs+0outputs (0major+15015minor)pagefaults 0swaps
EDIT 4
Running free -h every second while DrRacket is running (+ 1 1) in lang HTDP-beginner
(not running any other applications besides DrRacket and my basic system (ie window manager etc))
(this is fish shell, by the way):
http://pastebin.com/2RdZAuXj
At that point I had to kill DrRacket cuz everything was freezing up.
Anyway, yeah, it's leaking, obviously.
Everytime I re-ran the code in DrRacket, memory usage went up and stayed up.
I had only run it about twenty...two-ish (?) more times
(so maybe thirty-ish in total?)
by the point where it started getting near the limit
and I killed it to unfreeze the system.
I guess I should try this with normal #lang racket and see what happens...
EDIT 5
Yup, it leaks the same way:
http://pastebin.com/373PNnY7
I am 90% sure that the reason you had to wait was that your installation of Racket wasn't done properly.
During installation the program setup-plt needs to be run. It precompiles all racket files (.rkt) into so-called zo-files. If this step is omitted, then
DrRacket do the compilation for you the first time a file is needed.
In your case (I am guessing) it it your first time using the Beginner language, so all files relating to it needs to be compiled. And that takes a while.
The best solution is to use the official installers from http://download.racket-lang.org/ they all include precompiled zo-files.
If you happen to have used such an installer, then try again - and if the problem persist - do file a bug report (use the bug report in the Help menu in DrRacket).

Encoding for HLS using FFMPEG results in have a decreasing DTS

I am trying to encode video for HTS live streaming, but am having problems with validating the stream using Apple Media Validator (mediastreamvalidator).
(my test file: http://dominicansinteractive.idoms.org/media/9536/playlist.m3u8)
The output is:
--------------------------------------------------------------------------------
http://dominicansinteractive.idoms.org/media/9536/199/prog_index.m3u8
--------------------------------------------------------------------------------
Playlist Validation:
OK
Segments:
segment_00000.ts:
ERROR: (-1) Decreasing DTS were detected in track 0
ERROR: (-1) Decreasing DTS were detected in track 1
Average segment duration: 8.07 seconds
Average segment bitrate: 2155094.67 bps
Average segment structural overhead: 206525.83 bps (9.58 %)
The second segment doesn't seem to have the problem:
[mpegts # 0x1d78120] Format mpegts probed with size=2048 and score=100
[mpegts # 0x1d78120] stream=0 stream_type=1b pid=100 prog_reg_desc=
[mpegts # 0x1d78120] stream=1 stream_type=f pid=101 prog_reg_desc=
[mpegts # 0x1d78120] File position before avformat_find_stream_info() is 0
[h264 # 0x1d7c1c0] Current profile doesn't provide more RBSP data in PPS, skipping
[h264 # 0x1d7c1c0] no picture
[h264 # 0x1d7c1c0] Current profile doesn't provide more RBSP data in PPS, skipping
Last message repeated 3 times
[mpegts # 0x1d78120] max_analyze_duration 5000000 reached at 5013333
[mpegts # 0x1d78120] File position after avformat_find_stream_info() is 0
This seems to be a serious problem for HLS, so I am looking if there is a way to fix this.
When looking with FFMPEG at the encoded file I get (encoder output/command at the bottom of the email):
ffmpeg -loglevel 99 -i encoded.ts
ffmpeg version N-37783-gdf3a96c Copyright (c) 2000-2012 the FFmpeg developers
built on Jul 4 2012 07:44:52 with gcc 4.4.5
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvpx --enable-libfaac --enable-nonfree
libavutil 51. 63.100 / 51. 63.100
libavcodec 54. 32.100 / 54. 32.100
libavformat 54. 14.100 / 54. 14.100
libavdevice 54. 0.100 / 54. 0.100
libavfilter 3. 0.101 / 3. 0.101
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
[mpegts # 0x2023120] Format mpegts probed with size=2048 and score=100
[mpegts # 0x2023120] stream=0 stream_type=1b pid=100 prog_reg_desc=
[mpegts # 0x2023120] stream=1 stream_type=f pid=101 prog_reg_desc=
[mpegts # 0x2023120] File position before avformat_find_stream_info() is 0
[h264 # 0x20271c0] Current profile doesn't provide more RBSP data in PPS, skipping
[h264 # 0x20271c0] no picture
[mpegts # 0x2023120] first_dts 124080 not matching first dts 143280 in que
Last message repeated 6 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 158640 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 175920 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 193200 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 210480 in que
Last message repeated 7 times
[h264 # 0x20271c0] Current profile doesn't provide more RBSP data in PPS, skipping
[mpegts # 0x2023120] first_dts 124080 not matching first dts 227760 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 245040 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 262320 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 279600 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 296880 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 314160 in que
Last message repeated 7 times
[h264 # 0x20271c0] Current profile doesn't provide more RBSP data in PPS, skipping
[mpegts # 0x2023120] first_dts 124080 not matching first dts 331440 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 348720 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 366000 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 383280 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 400560 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 417840 in que
Last message repeated 6 times
[h264 # 0x20271c0] Current profile doesn't provide more RBSP data in PPS, skipping
[mpegts # 0x2023120] first_dts 124080 not matching first dts 433200 in que
Last message repeated 6 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 448560 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 465840 in que
Last message repeated 6 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 481200 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 498480 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 515760 in que
Last message repeated 7 times
[mpegts # 0x2023120] first_dts 124080 not matching first dts 533040 in que
Last message repeated 6 times
[h264 # 0x20271c0] Current profile doesn't provide more RBSP data in PPS, skipping
[mpegts # 0x2023120] first_dts 124080 not matching first dts 548400 in que
Last message repeated 7 times
[mpegts # 0x2023120] max_analyze_duration 5000000 reached at 5000000
[mpegts # 0x2023120] File position after avformat_find_stream_info() is 0
And when at the first segmented file:
ffmpeg -loglevel 99 -i segment_00000.ts
ffmpeg version N-37783-gdf3a96c Copyright (c) 2000-2012 the FFmpeg developers
built on Jul 4 2012 07:44:52 with gcc 4.4.5
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvpx --enable-libfaac --enable-nonfree
libavutil 51. 63.100 / 51. 63.100
libavcodec 54. 32.100 / 54. 32.100
libavformat 54. 14.100 / 54. 14.100
libavdevice 54. 0.100 / 54. 0.100
libavfilter 3. 0.101 / 3. 0.101
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
[mpegts # 0x1a0b120] Format mpegts probed with size=2048 and score=100
[mpegts # 0x1a0b120] stream=0 stream_type=1b pid=100 prog_reg_desc=
[mpegts # 0x1a0b120] stream=1 stream_type=f pid=101 prog_reg_desc=
[mpegts # 0x1a0b120] File position before avformat_find_stream_info() is 0
[mpegts # 0x1a0b120] Invalid timestamps stream=0, pts=1920, dts=8589929312, size=2355
[mpegts # 0x1a0b120] Invalid timestamps stream=0, pts=16320, dts=8589932912, size=3203
[h264 # 0x1a0f1c0] Current profile doesn't provide more RBSP data in PPS, skipping
[h264 # 0x1a0f1c0] no picture
[h264 # 0x1a0f1c0] Current profile doesn't provide more RBSP data in PPS, skipping
Last message repeated 3 times
[mpegts # 0x1a0b120] max_analyze_duration 5000000 reached at 5013333
[mpegts # 0x1a0b120] File position after avformat_find_stream_info() is 0
This problem does not occur with the BASELINE profile, but does with MAIN.
The command I use for encoding is:
ffmpeg, -i, [path]/test.mov, -y, -f, mpegts, -acodec, aac, -strict, -2, -ar, 48000, -b:a, 128000, -s, 960x540, -vcodec, libx264, -b:v, 1200000, -aspect, 960:540, -r, 25, -level, 3.1, -vprofile, main, -flags, +loop, -cmp, +chroma, -partitions, +parti4x4+partp8x8+partb8x8, -subq, 5, -trellis, 1, -refs, 1, -coder, 0, -me_range, 16, -keyint_min, 25, -sc_threshold, 40, -i_qfactor, 0.71, -bt, 200k, -maxrate, 1200000, -bufsize, 1200000, -rc_eq, 'blurCplx^(1-qComp)', -qcomp, 0.6, -qmin, 10, -qmax, 51, -qdiff, 4, -level, 30, -g, 30, -async, 2, [path]/encoded.ts
08:40:29,843 DEBUG ~ FFMPEG(1): libavutil 51. 63.100 / 51. 63.100
08:40:29,843 DEBUG ~ FFMPEG(1): libavcodec 54. 32.100 / 54. 32.100
08:40:29,843 DEBUG ~ FFMPEG(1): libavformat 54. 14.100 / 54. 14.100
08:40:29,843 DEBUG ~ FFMPEG(1): libavdevice 54. 0.100 / 54. 0.100
08:40:29,843 DEBUG ~ FFMPEG(1): libavfilter 3. 0.101 / 3. 0.101
08:40:29,844 DEBUG ~ FFMPEG(1): libswscale 2. 1.100 / 2. 1.100
08:40:29,844 DEBUG ~ FFMPEG(1): libswresample 0. 15.100 / 0. 15.100
08:40:29,844 DEBUG ~ FFMPEG(1): libpostproc 52. 0.100 / 52. 0.100
08:40:30,033 DEBUG ~ FFMPEG(1): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '[path]/test.mov':
08:40:30,033 DEBUG ~ FFMPEG(1): Metadata:
08:40:30,033 DEBUG ~ FFMPEG(1): major_brand : qt
08:40:30,033 DEBUG ~ FFMPEG(1): minor_version : 537199360
08:40:30,035 DEBUG ~ FFMPEG(1): compatible_brands: qt
08:40:30,035 DEBUG ~ FFMPEG(1): creation_time : 2011-12-05 10:54:24
08:40:30,036 DEBUG ~ FFMPEG(1): timecode : 00:00:00:00
08:40:30,036 DEBUG ~ FFMPEG(1): Duration: 00:00:24.20, start: 0.000000, bitrate: 9912 kb/s
08:40:30,037 DEBUG ~ FFMPEG(1): Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 9777 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
08:40:30,037 DEBUG ~ FFMPEG(1): Metadata:
08:40:30,037 DEBUG ~ FFMPEG(1): creation_time : 2011-12-05 10:56:28
08:40:30,037 DEBUG ~ FFMPEG(1): handler_name : Apple Video Media Handler
08:40:30,038 DEBUG ~ FFMPEG(1): Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 129 kb/s
08:40:30,038 DEBUG ~ FFMPEG(1): Metadata:
08:40:30,038 DEBUG ~ FFMPEG(1): creation_time : 2011-12-05 10:56:28
08:40:30,038 DEBUG ~ FFMPEG(1): handler_name : Apple Sound Media Handler
08:40:30,038 DEBUG ~ FFMPEG(1): Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
08:40:30,038 DEBUG ~ FFMPEG(1): Metadata:
08:40:30,038 DEBUG ~ FFMPEG(1): creation_time : 2011-12-05 10:56:28
08:40:30,039 DEBUG ~ FFMPEG(1): handler_name : Time Code Media Handler
08:40:30,039 DEBUG ~ FFMPEG(1): timecode : 00:00:00:00
08:40:30,092 DEBUG ~ FFMPEG(1): [graph 0 input from stream 0:0 # 0x1c17180] w:1920 h:1080 pixfmt:yuv420p tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
08:40:30,092 DEBUG ~ FFMPEG(1): [output stream 0:0 # 0x1c033a0] No opaque field provided
08:40:30,110 DEBUG ~ FFMPEG(1): [scaler for output stream 0:0 # 0x1c18040] w:1920 h:1080 fmt:yuv420p sar:0/1 -> w:960 h:540 fmt:yuv420p sar:0/1 flags:0x4
08:40:30,110 DEBUG ~ FFMPEG(1): [graph 1 input from stream 0:1 # 0x1c53440] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x3
08:40:30,110 DEBUG ~ FFMPEG(1): -async is forwarded to lavfi similarly to -af aresample=min_comp=0.001:min_hard_comp=0.100000:max_soft_comp=0.000042.
08:40:30,122 DEBUG ~ FFMPEG(1): [graph 1 aresample for input stream 0:1 # 0x1c36880] chl:stereo fmt:s16 r:48000Hz -> chl:stereo fmt:flt r:48000Hz
08:40:30,142 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] using SAR=1/1
08:40:30,142 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] frame MB size (60x34) > level limit (1620)
08:40:30,142 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] DPB size (4 frames, 3133440 bytes) > level limit (3 frames, 3110400 bytes)
08:40:30,142 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] MB rate (51000) > level limit (40500)
08:40:30,170 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] using cpu capabilities: MMX2 SSE2Slow SlowCTZ
08:40:30,182 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] profile Main, level 3.0
08:40:30,235 DEBUG ~ FFMPEG(1): [mpegts # 0x1be3540] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
08:40:30,235 DEBUG ~ FFMPEG(1): Output #0, mpegts, to '[path]/encoded.ts':
08:40:30,235 DEBUG ~ FFMPEG(1): Metadata:
08:40:30,235 DEBUG ~ FFMPEG(1): major_brand : qt
08:40:30,235 DEBUG ~ FFMPEG(1): minor_version : 537199360
08:40:30,235 DEBUG ~ FFMPEG(1): compatible_brands: qt
08:40:30,235 DEBUG ~ FFMPEG(1): timecode : 00:00:00:00
08:40:30,235 DEBUG ~ FFMPEG(1): encoder : Lavf54.14.100
08:40:30,235 DEBUG ~ FFMPEG(1): Stream #0:0(eng): Video: h264, yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=10-51, 1200 kb/s, 90k tbn, 25 tbc
08:40:30,235 DEBUG ~ FFMPEG(1): Metadata:
08:40:30,235 DEBUG ~ FFMPEG(1): creation_time : 2011-12-05 10:56:28
08:40:30,235 DEBUG ~ FFMPEG(1): handler_name : Apple Video Media Handler
08:40:30,236 DEBUG ~ FFMPEG(1): Stream #0:1(eng): Audio: aac, 48000 Hz, stereo, flt, 128 kb/s
08:40:30,236 DEBUG ~ FFMPEG(1): Metadata:
08:40:30,236 DEBUG ~ FFMPEG(1): creation_time : 2011-12-05 10:56:28
08:40:30,236 DEBUG ~ FFMPEG(1): handler_name : Apple Sound Media Handler
08:40:30,236 DEBUG ~ FFMPEG(1): Stream mapping:
08:40:30,236 DEBUG ~ FFMPEG(1): Stream #0:0 -> #0:0 (h264 -> libx264)
08:40:30,236 DEBUG ~ FFMPEG(1): Stream #0:1 -> #0:1 (aac -> aac)
[...]
08:40:55,398 DEBUG ~ FFMPEG(1): video:3121kB audio:359kB subtitle:0 global headers:0kB muxing overhead 11.132085%
08:40:55,407 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] frame I:21 Avg QP:21.57 size: 88153
08:40:55,407 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] frame P:233 Avg QP:22.74 size: 5560
08:40:55,407 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] frame B:351 Avg QP:27.45 size: 141
08:40:55,407 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] consecutive B-frames: 21.7% 2.0% 3.0% 73.4%
08:40:55,407 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] mb I I16..4: 54.5% 0.0% 45.5%
08:40:55,422 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] mb P I16..4: 4.7% 0.0% 1.3% P16..4: 24.6% 3.5% 0.8% 0.0% 0.0% skip:65.1%
08:40:55,422 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] mb B I16..4: 0.1% 0.0% 0.1% B16..8: 0.5% 0.1% 0.0% direct: 0.6% skip:98.6% L0:32.3% L1:47.1% BI:20.6%
08:40:55,422 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] coded y,uvDC,uvAC intra: 59.4% 5.8% 0.4% inter: 5.4% 3.0% 0.0%
08:40:55,422 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] i16 v,h,dc,p: 58% 16% 21% 4%
08:40:55,422 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 21% 17% 5% 10% 7% 5% 5% 10%
08:40:55,422 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] i8c dc,h,v,p: 94% 3% 3% 0%
08:40:55,422 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] Weighted P-Frames: Y:13.7% UV:3.4%
08:40:55,422 DEBUG ~ FFMPEG(1): [libx264 # 0x1be3cc0] kb/s:1056.61
For segmenting is:
ffmpeg, -i,[path]encoded.ts, -y, -c, copy, -flags, global_header, -map, 0, -f, segment, -segment_time, 10, -segment_list, [path]/fileList.txt, -segment_format, mpegts, [path]/segment_%05d.ts]
Any help would really be appreciated!
The error reported by Apple Media Validator is legit. In fact, the TS file is broken left and right.
The problem file (segment_00000.ts) has H.264 at PID 0x100 and AAC at 0x0101. The PCR_PID is set to 0x0100, which is the AVC stream.
At the file offset 564, it has the following TS packet:
47 41 00 30
07 50 FF FF F5 B0 7E 00
00 00 01 E0 0D D8 80 C0 0A 31 00 01 0F 01 1F FF FF D6 C1 00
The second line is adaptation_field which signals PCR = 2576978793600. The 3rd line is PES packet which signals PTS = 576000 and DTS = 2576978793600 in 27Mhz tick.
As PTS is way off from PCR, we can say this TS packet is broken.
The following PCR is signaled at file offset 9212 and the PCR is 576000, PTS is 2736000, and DTS is 576000. Now, we have these observations.
PCR/PTS/DTS have now somewhat sensible values, but ...
Compared to the previous DTS, this new DTS is earlier, thus Apple Media Validator reports the error.
PCR is same as DTS, which indicates T-STD underflow error.
Unfortunately, I am not familiar with ffmpeg so I don't know how to fix it. However, by just looking at this output file, I got impression that the TS multiplexer in use is not at the highest quality yet.
http://developer.android.com/guide/appendix/media-formats.html
Recommended video codec for all video qualities is H.264 Baseline Profile (which is actually pretty bad) so maybe this is suggested because of the above reason, or better said, because of some type of incompatibility inside those formats, contents etc.
For HLS you should use the hls muxer (-f hls), not the generic segment muxer. The generic segment muxer doesn't really produce TS files compatible with HLS.