popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.01k stars 334 forks source link

Videos play without audio and at least 2x speed when using bluetooth audio #636

Open DarknightDS opened 6 years ago

DarknightDS commented 6 years ago

When connected to a bluetooth speaker and I run omxplayer with --adev alsa to send audio over bluetooth, no audio can be heard when the Pi is also using the USB port for file transfers over usb ethernet. I have an HDMI plugged into the Pi. All video files were created using handbrake's Super HQ 480p profile. Once converted, I then convert the files to MKV as MP4 files would have this issue about 1 in 3 playbacks using omxplayer without any writes to disk or ethernet transfers etc. When videos play back at normal speed, the audio on bluetooth is good.

Raspbian stretch is installed, fully updated.

I'm using a raspberry pi zero w

Omxplayer was installed via the make instructions on github: Build date: Sun, 27 May 2018 12:23:25 -0400 Version : 9680057 [master] Repository: https://github.com/popcornmix/omxplayer.git

Media Info: Format : Matroska Format version : Version 4 / Version 2 File size : 915 MiB Duration : 26 min 21 s Overall bit rate : 4 853 kb/s Encoded date : UTC 2018-05-29 05:32:30 Writing application : mkvmerge v23.0.0 ('The Bride Said No') 64-bit Writing library : libebml v1.3.6 + libmatroska v1.4.9

Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.1 Format settings : CABAC / 5 Ref Frames Format settings, CABAC : Yes Format settings, RefFrames : 5 frames Codec ID : V_MPEG4/ISO/AVC Duration : 26 min 21 s Bit rate : 4 499 kb/s Width : 538 pixels Height : 480 pixels Display aspect ratio : 4:3 Original display aspect ratio : 4:3 Frame rate mode : Constant Frame rate : 23.976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.727 Stream size : 849 MiB (93%) Writing library : x264 core 148 r2708 86b7198 Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=5 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=17500 / vbv_bufsize=17500 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00 Default : Yes Forced : No Color range : Limited Color primaries : BT.601 NTSC Transfer characteristics : BT.709 Matrix coefficients : BT.601

Audio #1 ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : A_AAC-2 Duration : 26 min 21 s Bit rate : 159 kb/s Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Delay relative to video : 11 ms Stream size : 30.0 MiB (3%) Language : English Default : Yes Forced : No

Audio #2 ID : 3 Format : AC-3 Format/Info : Audio Coding 3 Codec ID : A_AC3 Duration : 26 min 21 s Bit rate mode : Constant Bit rate : 192 kb/s Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 SPF) Bit depth : 16 bits Compression mode : Lossy Delay relative to video : 33 ms Stream size : 36.2 MiB (4%) Language : English Service kind : Complete Main Default : No Forced : No

DarknightDS commented 6 years ago

Just noticed that when the file plays without audio, if I set the playback speed to 0.975 the video plays back at the correct speed and I get audio output over Bluetooth properly. This isn't a fix for my issue as the video should playback correctly without me having to slow it down manually. In the project I plan to use this in, I don't want to wire 2 more buttons to step the speed up and down. Video randomly speeds up in middle of video playback as well.

gpmaxx commented 5 years ago

Hi. Is there an update, resolution or confirmation of this issue? I'm facing the same problem. Video and sound work fine when playing over HDMI audio. However, when trying to play via bluetooth using the -o alsa option the video plays too fast with no sound. Slowing the video down (hitting 1) corrects the fast play and the sound starts. Even more confusing is that perhaps 1 out of every 5 times everything works fine from startup. Using the alsa option to play via i2s works fine. This is on Raspberry Pi Stretch.

vectorstudio commented 4 years ago

sudo omxplayer -o hdmi /mnt/disk/movie.mp4 using keyborad to change speed

When it's played in normal speed,everything is fine. When it's played in slower or faster speed, the video is fine, but no audio.

ole1986 commented 4 years ago

two years and no fix for it when using alsa audio device?

popcornmix commented 4 years ago

Have you tried using VLC? omxplayer is being deprecated and VLC is the recommended alternative.