Commit Graph

129 Commits

Author SHA1 Message Date
ejurgensen
a8e6522a3c [xcode] Change workaround in commit a0ac66e for AIFF issue
This solution matches what we do for 'in' filter
2020-04-07 21:24:31 +02:00
ejurgensen
a0ac66e020 [xcode] Workaround for ffmpeg detecting channel_layout = 0 for AIF 2020-04-07 20:55:17 +02:00
ejurgensen
a4f9bb576d [xcode] Increase read timeout 15s -> 30s (ref. issue #728) 2019-11-02 08:56:10 -07:00
whatdoineed2do/Ray
c2ba1fdb63 [streaming,conf,xcode] review fixes 2019-09-22 22:58:32 +02:00
whatdoineed2do/Ray
554799ebc3 [streaming/xcode] configurable MP3 streaming bitrate 2019-09-22 22:58:32 +02:00
ejurgensen
a321667201 [xcode] Remove deprecated ffmpeg AVFormatContext filename field 2019-07-02 21:48:34 +02:00
ejurgensen
380f1358d5 [xcode] Disable reconnect_at_eof, does not work with m3u8 (fixes #745)
Only fixes #745 with newer versions of ffmpeg. With ffmpeg 3.4 playback
will still get interrupted because av_read_frame returns an error.
2019-05-21 21:19:03 +02:00
ejurgensen
7bf90eb8cb [xcode] Fix for reading mono sources (ref issue #742) 2019-05-19 22:45:39 +02:00
ejurgensen
b33e2665a1 [xcode] Hardcode png/jpeg pix formats (fix for #717)
ffmpeg changed the behaviour of avcodec_default_get_format() so that it picks
AV_PIX_FMT_MONOBLACK instead of AV_PIX_FMT_RGB24 for the png encoder. That
makes the function of no use to us, so now the pix formats are just hardcoded
in the settings instead.
2019-04-08 21:30:29 +02:00
ejurgensen
53780a7ef3 [xcode] Make sample rate + channels variable
This change is preparation to use ffmpeg's resampling capabilities to keep local
audio in sync (by up/downsampling slightly). This requires that sample rates are
not fixed for a transcode profile.

Added benefit of this is that we don't need quite as many xcode profiles.
2019-04-02 22:47:11 +02:00
ejurgensen
992ab90876 [xcode] Fix missing "&" 2019-03-18 23:06:08 +01:00
ejurgensen
9b31264a3c [xcode] Use av_get_bytes_per_sample instead of av_get_bits_per_sample
av_get_bits_per_sample(ctx->settings.audio_codec) may return 0 with some codecs
2019-03-18 23:06:08 +01:00
ejurgensen
1285128b9a [xcode] Fix incorrect source BPS detection + support for more audio qualities 2019-03-18 23:06:08 +01:00
ejurgensen
201c97fdf8 Fixup 3 - remove small risk of crash if encode_setup called incorrectly 2019-03-18 23:06:08 +01:00
ejurgensen
ad77a42dbb [xcode] Adapt to allow for new raw PCM input profiles, e.g. 48000/16 2019-03-18 23:06:08 +01:00
ejurgensen
9182597605 [input/xcode] Write to input buffer with the sources native sample rate/format
Still WIP at this point since the player and output can't use the use improved
quality yet, and because rtptimes etc. are likely incorrect
2019-03-18 23:06:08 +01:00
ejurgensen
d850c2e691 [xcode] Add OPUS encoding profile for RTP Chromecasting 2019-03-18 23:06:08 +01:00
ejurgensen
5ee0b69d39 [transcode] Set ffmpeg options so that it will attempt to reconnect streams 2018-08-12 19:50:54 +02:00
ejurgensen
ab1ded35e4 [config] Make user_agent configurable + don't use ffmpeg default (ref issue #562) 2018-08-12 19:49:23 +02:00
ejurgensen
3325b2d9ce [transcode] Use proper const for avfilter_get_by_name() result 2018-06-06 00:00:22 +02:00
ejurgensen
d84818649a [transcode] Fix for issue #502, ffmpeg segfault when jpeg encoding
For some reason it seems the Docker version of ffmpeg 3.4 uses "optimal"
Huffman tables (despite not being default), which cause ffmpeg to crash
when mjpeg encoder is encoding artwork jpeg's
2018-04-21 23:19:41 +02:00
ejurgensen
121b812c30 [transcode] Lower log level of "will transcode" messages 2018-03-02 20:51:33 +01:00
ejurgensen
0b3f4dfa15 [transcode] Ignore some errors from avcodec_send_packet(), fixes #483
Since the stream can at least in some cases be transcoded anyway
2018-01-26 22:37:28 +01:00
ejurgensen
c75097b02e [transcode] Log pix_fmt by name instead of enum 2017-09-17 00:00:24 +02:00
ejurgensen
eec98e3b7e [main/transcode] Fix some libav compability + log what ffmpeg/libav we are using 2017-09-16 23:01:42 +02:00
ejurgensen
548d9ada2e [transcode] Fixup dead assignment 2017-08-06 22:31:43 +02:00
ejurgensen
f9375ef915 [transcode] More adjustments for libav 12 2017-08-06 22:31:43 +02:00
ejurgensen
6951639d24 [transcode] Adjustments for libav 12 2017-08-06 22:31:43 +02:00
ejurgensen
441ad006a6 [artwork/transcode] Also let transcode.c handle rescaling of non-file Spotify artwork 2017-08-06 22:31:43 +02:00
ejurgensen
e7f888645f [artwork/transcode] Adjust transcode.c so it can take care of artwork
rescaling, meaning we can do without parallel ffmpeg interfaces.
This also moves artwork rescaling from libswscale to libavfilter, which
seems to fix a problem with PNG rescaling.
2017-08-06 22:31:43 +02:00
ejurgensen
1e180b5ce8 [transcode] Call av_write_trailer before cleanup so that any flushed data
will be written to encode_ctx->obuf, where it can be passed to the caller
2017-08-06 22:20:44 +02:00
ejurgensen
e96b9500db [transcode] Implement new ffmpeg decoding methods: avcodec_send_packet/avcodec_receive_frame 2017-08-06 22:20:44 +02:00
ejurgensen
5afed60a42 [transcode] Implement new ffmpeg encoding methods: avcodec_send_frame/avcodec_receive_packet 2017-08-06 22:20:44 +02:00
ejurgensen
7c8eba74bb [transcode] Remove unused param to open_filter() 2017-08-06 22:20:44 +02:00
ejurgensen
25c1795af2 [transcode] Update to new ffmpeg api - part 1
- no more use of AVStream.codec
- ditch some backwards compability
- move closer to being able do video, at least for artwork
2017-08-06 22:20:44 +02:00
sshambar
c54c909ae4 Added support for libav/ffmpeg dual installs (#346)
* [config] Added support for libav/ffmpeg dual installs

Reordered CPPFLAGS/LIBS so that library flags (includes etc) appear
ahead of prefix/global directives and the correct headers/libraries
are checked (if symbols are defined in alternative libraries).
Updated libav checks to use header declaration checks
rather than link checks (so differences between
libav/ffmpeg can be correctly found), and updated code references
to use new defines.  Added support the alternate pkg-config
package names for libav.  Updated ffmpeg vs libav check
to check MICRO version number (>=100 for ffmpeg).  Simplified
resulting configure script by using a function to merge
CPPFLAGS variables.

* [config] Use FORKED_OPTS prefix for libevent_pthreads option

* [config] Add --with-libav option to select libav even if ffmpeg present
2017-02-19 15:21:00 +01:00
ejurgensen
b44ae55c1d Some scan-build fixing up 2017-01-28 22:37:56 +01:00
ejurgensen
8b5cac0538 [file/http/input] Implement metadata handling through input interface 2017-01-27 22:36:00 +01:00
ejurgensen
785ff21045 Merge pull request #328 from sshambar/fixconfig
Updated configure/makefiles related to Issue #327
2017-01-12 22:41:47 +01:00
Scott Shambarger
ce4ef0aa23 [config] Many updates to configuration and feature checks
- Added custom checks for libraries and pkgconfig modules that test library
 presence with additional checks for use of headers and functions with
 given options.  Also support correct additional feature library checks
 using provided flags.
- Added custom enable/disable feature macros to simplify their use.
- Use custom CFLAGS and LIBS variables for Makefiles to simplify maintenance.
- Update many feature checks from platform to function.
- Streamline many function checks.
- Correctly check gnutls, gcrypt and gpg-error libraries.
- Fix chromecast and spotify config and compile on FreeBSD
- Added inotify, signalfd and kqueue, and byte swap checks.
- Many clarifications of error messages.
- Correct json-c checks to properly use supplied CFLAGS.
- Correct many quoting inconsistencies
- Use __DATE__ in place of BUILDDATE
- Use full path for gperf and antlr3
- Remove unnecessary CFLAGS
- Added tests for pthread_setname_np parameters
- Added tests for clock_gettime and timer_settime
- Added tests for time.h
- Test if pthread, dl and rt libs are required/available.
- Updated checks for libunistring
2017-01-06 00:44:18 -08:00
Scott Shambarger
8ead7ea3b8 [config] configure.ac checks required features, updated porting
Added a real config.rpath
Fixed build date calc for BSD
Require some needed headers at configure time
Correctly check libav functions using pkg-config flags
Made checks for some Linux features available on other ports
Fixed porting issue with antlr dep files
Added default HOST_NAME_MAX if not defined
Added missing libav header
2016-12-29 16:14:22 -08:00
ejurgensen
3bb6220ce9 [transcode] Make sure transcode_seek() only returns negative on error
- newer ffmpeg seems to give timestamps that give negative got_pts when seeking to 0
2016-12-27 00:02:02 +01:00
ejurgensen
51e6008ef6 Merge pull request #305 from chme/streamsetup
Reduce dependency to media file in stream setup methods
2016-11-26 17:43:24 +01:00
ejurgensen
bdd6bab982 [-] Lots of housekeeping thanks to scan-build and input from @acmay 2016-11-19 23:08:50 +01:00
chme
6690ba32eb [player/transcode/httpd] Pass path, data_kind and song_length to
transcode_decode_setup/transcode_setup
2016-11-12 09:11:40 +01:00
ejurgensen
1e3df5ba52 [-] Add forgotten type in err2str() 2016-10-11 21:32:16 +02:00
ejurgensen
e5d328061b [logger] Be better at logging ffmpeg/libav error messages 2016-09-25 22:01:07 +02:00
ejurgensen
1fbb4b0d59 [transcode] Fix problem for file types where ffmpeg decode returns 0
It seems ffmpeg/libav reads a file type like Monkey's audio in large
chunks, so that each packet must be passed to the decoder multiple
times. The decoder will return 0 until the packet is completed. This
change makes forked-daapd able to deal with a return value of 0.
2016-05-06 00:23:07 +02:00
ejurgensen
42e68311eb [transcode] Increase read timeout slightly 2016-03-25 20:56:08 +01:00
ejurgensen
7d1d52e8f0 [transcode] Fix missing channel number for newer ffmpeg (closes #241) 2016-03-20 19:22:16 +01:00