Seize / joy4

Golang audio/video library and streaming server
MIT License
13 stars 4 forks source link

Warning: data is not aligned! This can lead to a speed loss #17

Closed moneyzmey closed 5 years ago

moneyzmey commented 5 years ago

Hi ! I try to use your example of video transcoding and got warning:

[swscaler @ 0x984c200] Warning: data is not aligned! This can lead to a speed loss

on input bitrate is 6500 Kbs on output bitrate is 500 kbs

ffmpeg -version
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
libavutil      56. 22.100 / 56. 22.100
libavcodec     58. 35.100 / 58. 35.100
libavformat    58. 20.100 / 58. 20.100
libavdevice    58.  5.100 / 58.  5.100
libavfilter     7. 40.101 /  7. 40.101
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  3.100 /  5.  3.100
libswresample   3.  3.100 /  3.  3.100
libpostproc    55.  3.100 / 55.  3.100
go version go1.11.5 darwin/amd64

Do you have any idea ?

a-rose commented 5 years ago

Hi,

Thanks for reporting this issue. 🙂

If I remember correctly, this message means the input video width is not multiple of 16. Some encoders require that the width is multiple of 16, so ffmpeg (or the encoder itself) will have to move data around to make the conversion.

It shouldn't have too much impact on performance, and the transcoding process will work just fine. To fix this warning, I will probably need to adjust the stride there: https://github.com/Seize/joy4/blob/af8f0a6670b7726c8bfa400b31b7c01d87a81eda/cgo/ffmpeg/video.go#L137

moneyzmey commented 5 years ago

Thanks a lot. Its works