Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of bounds Memory access #268

Open
fakerName opened this issue Jan 12, 2019 · 11 comments
Open

Out of bounds Memory access #268

fakerName opened this issue Jan 12, 2019 · 11 comments

Comments

@fakerName
Copy link

img_8538

In some IphoneX, have that error.

@jadaradix
Copy link

This is almost certainly to do with the data arriving down the websocket. Your ffmpeg command is probably not outputting an mpeg1 stream.

Can you show us how you are running ffmpeg?
Can you reproduce this issue in desktop Chrome? (so we can figure out if iOS Safari is the problem)

@dronematt
Copy link

I'm having the same problem even when I use a v4l2-loopback from a RTMP source. This could give a very low latency playback to several devices if it could be overcome. ffmpeg -y -i test.flv -vcodec copy -vbsf h264_mp4toannexb test.h264 might hold some of the key.

@fakerName
Copy link
Author

This is almost certainly to do with the data arriving down the websocket. Your ffmpeg command is probably not outputting an mpeg1 stream.

Can you show us how you are running ffmpeg?
Can you reproduce this issue in desktop Chrome? (so we can figure out if iOS Safari is the problem)

Can't reproduce in desktop Chrome;My ffmeg command is the default command in readme.Maybe Just in some IphoneX.

@johncoles
Copy link

I get the same issues as above on Chrome 72.0.3626.109 (Official Build) (64-bit) on macOS.

FFMPEG Command:
ffmpeg -re -stream_loop -1 -i testcard.mp4 -f mpegts http://127.0.0.1:81/mysecret

Chrome:
screenshot 2019-02-23 16 52 52

FFMPEG:
screenshot 2019-02-23 16 53 57

@jadaradix
Copy link

3038kbps bit rate is very high. Can you reproduce this at a lower bitrate?

It's good you're using the test card for consistency as we figure this out. 🙂

@phoboslab
Copy link
Owner

phoboslab commented Feb 25, 2019

Try increasing the videoBufferSize for large resolutions. E.g to set 4MB (instead of the default 512kb):

var player = new JSMpeg.Player(url, {videoBufferSize: 1024*1024*4});

@marcoXbresciani
Copy link

marcoXbresciani commented Feb 27, 2019

Got the same error, even using 14MB (1024x1024x14), with Bjork's video using ffmpeg -re -i samples\bjork-all-is-full-of-love.ts -f mpegts http://localhost:8081/password as command

ffmpeg version N-93234-g2e67f751b5 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20190212
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 47.102 / 58. 47.102
  libavformat    58. 26.101 / 58. 26.101
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, mpegts, from 'samples\bjork-all-is-full-of-love.ts':
  Duration: 00:04:08.89, start: 1.429089, bitrate: 1664 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg1video ([2][0][0][0] / 0x0002), yuv420p(tv), 960x540 [SAR 1:1 DAR 16:9], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
    Stream #0:1[0x101](und): Audio: mp2 ([3][0][0][0] / 0x0003), 44100 Hz, mono, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg1video (native) -> mpeg2video (native))
  Stream #0:1 -> #0:1 (mp2 (native) -> mp2 (native))
Press [q] to stop, [?] for help
Output #0, mpegts, to 'http://localhost:8081/password':
  Metadata:
    encoder         : Lavf58.26.101
    Stream #0:0: Video: mpeg2video (Main), yuv420p(progressive), 960x540 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.47.102 mpeg2video
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: mp2, 44100 Hz, mono, s16, 384 kb/s
    Metadata:
      encoder         : Lavc58.47.102 mp2
frame= 1571 fps= 25 q=31.0 size=    7742kB time=00:01:02.89 bitrate=1008.4kbits/s speed=   1x

@Edassap
Copy link

Edassap commented Mar 20, 2019

@marcoXbresciani
hey, do you solve it? if so , how?

@Edassap
Copy link

Edassap commented Mar 20, 2019

OK! I solve it ! the reason of this problem is the wrong output format of stream from ffmpeg!
And I change the command (in readme file) to this :
ffmpeg -i "inputData" -f mpegts
-vcodec mpeg1video -s 960x540 -b:v 1000k -r 30 -bf 0
-codec:a mp2 -ar 44100 -ac 1 -b:a 128k
"output http stream"
hope it can also work for other guys

@haoolii
Copy link

haoolii commented Jun 13, 2019

OK! I solve it ! the reason of this problem is the wrong output format of stream from ffmpeg!
And I change the command (in readme file) to this :
ffmpeg -i "inputData" -f mpegts
-vcodec mpeg1video -s 960x540 -b:v 1000k -r 30 -bf 0
-codec:a mp2 -ar 44100 -ac 1 -b:a 128k
"output http stream"
hope it can also work for other guys

thanks for sharing!!
I solved too

@felipecrs
Copy link

felipecrs commented Mar 10, 2022

In my case it works sometimes, so I guess there is nothing wrong with the feed. My stack trace is a bit different than yours though:

image

It either throws at MPEG1WASM.initializeWasmDecoder or at MPEG1WASM.bufferWrite. Also, videoBufferSize is already high (1024*1024*4) and video resolution is low ~360p (and it works sometimes anyway).

mmdjiji added a commit to jmpsvr/backend that referenced this issue Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants