replace swresample with libavresample

This commit is contained in:
Isaac Connor 2017-04-10 21:54:23 -04:00
parent 58a0c82015
commit 620797ac18
5 changed files with 406 additions and 299 deletions

View File

@ -564,21 +564,21 @@ if(NOT ZM_NO_FFMPEG)
endif(SWSCALE_LIBRARIES)
# rescale (using find_library and find_path)
find_library(SWRESAMPLE_LIBRARIES swresample)
if(SWRESAMPLE_LIBRARIES)
set(HAVE_LIBSWRESAMPLE 1)
list(APPEND ZM_BIN_LIBS "${SWRESAMPLE_LIBRARIES}")
find_path(SWRESAMPLE_INCLUDE_DIR "libswresample/swresample.h" /usr/include/ffmpeg)
if(SWRESAMPLE_INCLUDE_DIR)
include_directories("${SWRESAMPLE_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${SWRESAMPLE_INCLUDE_DIR}")
endif(SWRESAMPLE_INCLUDE_DIR)
mark_as_advanced(FORCE SWRESAMPLE_LIBRARIES SWRESAMPLE_INCLUDE_DIR)
check_include_file("libswresample/swresample.h" HAVE_LIBSWRESAMPLE_SWRESAMPLE_H)
set(optlibsfound "${optlibsfound} SWResample")
else(SWRESAMPLE_LIBRARIES)
set(optlibsnotfound "${optlibsnotfound} SWResample")
endif(SWRESAMPLE_LIBRARIES)
find_library(AVRESAMPLE_LIBRARIES avresample)
if(AVRESAMPLE_LIBRARIES)
set(HAVE_LIBAVRESAMPLE 1)
list(APPEND ZM_BIN_LIBS "${AVRESAMPLE_LIBRARIES}")
find_path(AVRESAMPLE_INCLUDE_DIR "libavresample/avresample.h" /usr/include/ffmpeg)
if(AVRESAMPLE_INCLUDE_DIR)
include_directories("${AVRESAMPLE_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${AVRESAMPLE_INCLUDE_DIR}")
endif(AVRESAMPLE_INCLUDE_DIR)
mark_as_advanced(FORCE AVRESAMPLE_LIBRARIES AVRESAMPLE_INCLUDE_DIR)
check_include_file("libavresample/avresample.h" HAVE_LIBAVRESAMPLE_AVRESAMPLE_H)
set(optlibsfound "${optlibsfound} AVResample")
else(AVRESAMPLE_LIBRARIES)
set(optlibsnotfound "${optlibsnotfound} AVResample")
endif(AVRESAMPLE_LIBRARIES)
# Find the path to the ffmpeg executable
find_program(FFMPEG_EXECUTABLE

View File

@ -4,7 +4,7 @@
configure_file(zm_config.h.in "${CMAKE_CURRENT_BINARY_DIR}/zm_config.h" @ONLY)
# Group together all the source files that are used by all the binaries (zmc, zma, zmu, zms etc)
set(ZM_BIN_SRC_FILES zm_box.cpp zm_buffer.cpp zm_camera.cpp zm_comms.cpp zm_config.cpp zm_coord.cpp zm_curl_camera.cpp zm.cpp zm_db.cpp zm_logger.cpp zm_event.cpp zm_exception.cpp zm_file_camera.cpp zm_ffmpeg_camera.cpp zm_image.cpp zm_jpeg.cpp zm_libvlc_camera.cpp zm_local_camera.cpp zm_monitor.cpp zm_ffmpeg.cpp zm_mpeg.cpp zm_packetqueue.cpp zm_poly.cpp zm_regexp.cpp zm_remote_camera.cpp zm_remote_camera_http.cpp zm_remote_camera_rtsp.cpp zm_rtp.cpp zm_rtp_ctrl.cpp zm_rtp_data.cpp zm_rtp_source.cpp zm_rtsp.cpp zm_rtsp_auth.cpp zm_sdp.cpp zm_signal.cpp zm_stream.cpp zm_thread.cpp zm_time.cpp zm_timer.cpp zm_user.cpp zm_utils.cpp zm_video.cpp zm_videostore.cpp zm_zone.cpp zm_storage.cpp)
set(ZM_BIN_SRC_FILES zm_box.cpp zm_buffer.cpp zm_camera.cpp zm_comms.cpp zm_config.cpp zm_coord.cpp zm_curl_camera.cpp zm.cpp zm_db.cpp zm_logger.cpp zm_event.cpp zm_exception.cpp zm_file_camera.cpp zm_ffmpeg_camera.cpp zm_image.cpp zm_jpeg.cpp zm_libvlc_camera.cpp zm_local_camera.cpp zm_monitor.cpp zm_monitorstream.cpp zm_ffmpeg.cpp zm_mpeg.cpp zm_packetqueue.cpp zm_poly.cpp zm_regexp.cpp zm_remote_camera.cpp zm_remote_camera_http.cpp zm_remote_camera_rtsp.cpp zm_rtp.cpp zm_rtp_ctrl.cpp zm_rtp_data.cpp zm_rtp_source.cpp zm_rtsp.cpp zm_rtsp_auth.cpp zm_sdp.cpp zm_signal.cpp zm_stream.cpp zm_thread.cpp zm_time.cpp zm_timer.cpp zm_user.cpp zm_utils.cpp zm_video.cpp zm_videostore.cpp zm_zone.cpp zm_storage.cpp)
# A fix for cmake recompiling the source files for every target.
add_library(zm STATIC ${ZM_BIN_SRC_FILES})

View File

@ -1,4 +1,3 @@
//
// ZoneMinder Video Storage Implementation
// Written by Chris Wiggins
// http://chriswiggins.co.nz
@ -214,175 +213,14 @@ VideoStore::VideoStore(const char *filename_in, const char *format_in,
audio_input_context = audio_input_stream->codec;
if ( audio_input_context->codec_id != AV_CODEC_ID_AAC ) {
#ifdef HAVE_LIBSWRESAMPLE
resample_context = NULL;
char error_buffer[256];
static char error_buffer[256];
avcodec_string(error_buffer, sizeof(error_buffer), audio_input_context, 0 );
Debug(3, "Got something other than AAC (%s)", error_buffer );
audio_output_stream = NULL;
audio_output_codec = avcodec_find_encoder(AV_CODEC_ID_AAC);
if ( audio_output_codec ) {
Debug(2, "Have audio output codec");
audio_output_stream = avformat_new_stream( oc, audio_output_codec );
audio_output_context = audio_output_stream->codec;
if ( audio_output_context ) {
Debug(2, "Have audio_output_context");
AVDictionary *opts = NULL;
av_dict_set(&opts, "strict", "experimental", 0);
/* put sample parameters */
audio_output_context->bit_rate = audio_input_context->bit_rate;
audio_output_context->sample_rate = audio_input_context->sample_rate;
audio_output_context->channels = audio_input_context->channels;
audio_output_context->channel_layout = audio_input_context->channel_layout;
audio_output_context->sample_fmt = audio_input_context->sample_fmt;
//audio_output_context->refcounted_frames = 1;
if (audio_output_codec->supported_samplerates) {
int found = 0;
for ( unsigned int i = 0; audio_output_codec->supported_samplerates[i]; i++) {
if ( audio_output_context->sample_rate == audio_output_codec->supported_samplerates[i] ) {
found = 1;
break;
}
}
if ( found ) {
Debug(3, "Sample rate is good");
} else {
audio_output_context->sample_rate = audio_output_codec->supported_samplerates[0];
Debug(1, "Sampel rate is no good, setting to (%d)", audio_output_codec->supported_samplerates[0] );
}
}
/* check that the encoder supports s16 pcm input */
if (!check_sample_fmt( audio_output_codec, audio_output_context->sample_fmt)) {
Debug( 3, "Encoder does not support sample format %s, setting to FLTP",
av_get_sample_fmt_name( audio_output_context->sample_fmt));
audio_output_context->sample_fmt = AV_SAMPLE_FMT_FLTP;
}
//audio_output_stream->time_base = audio_input_stream->time_base;
audio_output_context->time_base = (AVRational){ 1, audio_output_context->sample_rate };
Debug(3, "Audio Time bases input stream (%d/%d) input codec: (%d/%d) output_stream (%d/%d) output codec (%d/%d)",
audio_input_stream->time_base.num,
audio_input_stream->time_base.den,
audio_input_context->time_base.num,
audio_input_context->time_base.den,
audio_output_stream->time_base.num,
audio_output_stream->time_base.den,
audio_output_context->time_base.num,
audio_output_context->time_base.den
);
ret = avcodec_open2(audio_output_context, audio_output_codec, &opts );
if ( ret < 0 ) {
av_strerror(ret, error_buffer, sizeof(error_buffer));
Fatal( "could not open codec (%d) (%s)\n", ret, error_buffer );
} else {
Debug(1, "Audio output bit_rate (%d) sample_rate(%d) channels(%d) fmt(%d) layout(%d) frame_size(%d), refcounted_frames(%d)",
audio_output_context->bit_rate,
audio_output_context->sample_rate,
audio_output_context->channels,
audio_output_context->sample_fmt,
audio_output_context->channel_layout,
audio_output_context->frame_size,
audio_output_context->refcounted_frames
);
#if 1
/** Create the FIFO buffer based on the specified output sample format. */
if (!(fifo = av_audio_fifo_alloc(audio_output_context->sample_fmt,
audio_output_context->channels, 1))) {
Error("Could not allocate FIFO\n");
if ( ! setup_resampler() ) {
return;
}
#endif
output_frame_size = audio_output_context->frame_size;
/** Create a new frame to store the audio samples. */
if (!(input_frame = zm_av_frame_alloc())) {
Error("Could not allocate input frame");
return;
}
/** Create a new frame to store the audio samples. */
if (!(output_frame = zm_av_frame_alloc())) {
Error("Could not allocate output frame");
av_frame_free(&input_frame);
return;
}
/**
* Create a resampler context for the conversion.
* Set the conversion parameters.
* Default channel layouts based on the number of channels
* are assumed for simplicity (they are sometimes not detected
* properly by the demuxer and/or decoder).
*/
resample_context = swr_alloc_set_opts(NULL,
av_get_default_channel_layout(audio_output_context->channels),
audio_output_context->sample_fmt,
audio_output_context->sample_rate,
av_get_default_channel_layout( audio_input_context->channels),
audio_input_context->sample_fmt,
audio_input_context->sample_rate,
0, NULL);
if (!resample_context) {
Error( "Could not allocate resample context\n");
return;
}
/**
* Perform a sanity check so that the number of converted samples is
* not greater than the number of samples to be converted.
* If the sample rates differ, this case has to be handled differently
*/
av_assert0(audio_output_context->sample_rate == audio_input_context->sample_rate);
/** Open the resampler with the specified parameters. */
if ((ret = swr_init(resample_context)) < 0) {
Error( "Could not open resample context\n");
swr_free(&resample_context);
return;
}
/**
* Allocate as many pointers as there are audio channels.
* Each pointer will later point to the audio samples of the corresponding
* channels (although it may be NULL for interleaved formats).
*/
if (!( converted_input_samples = (uint8_t *)calloc( audio_output_context->channels, sizeof(*converted_input_samples))) ) {
Error( "Could not allocate converted input sample pointers\n");
return;
}
/**
* Allocate memory for the samples of all channels in one consecutive
* block for convenience.
*/
if ((ret = av_samples_alloc( &converted_input_samples, NULL,
audio_output_context->channels,
audio_output_context->frame_size,
audio_output_context->sample_fmt, 0)) < 0) {
Error( "Could not allocate converted input samples (error '%s')\n",
av_make_error_string(ret).c_str() );
av_freep(converted_input_samples);
free(converted_input_samples);
return;
}
Debug(2, "Success opening AAC codec");
}
av_dict_free(&opts);
} else {
Error( "could not allocate codec context for AAC\n");
}
} else {
Error( "could not find codec for AAC\n");
}
#else
Error("Not built with libswresample library. Cannot do audio conversion to AAC");
audio_output_stream = NULL;
#endif
} else {
Debug(3, "Got AAC" );
@ -390,13 +228,14 @@ Debug(2, "Have audio_output_context");
if ( ! audio_output_stream ) {
Error("Unable to create audio out stream\n");
audio_output_stream = NULL;
}
} else {
audio_output_context = audio_output_stream->codec;
ret = avcodec_copy_context(audio_output_context, audio_input_context);
if (ret < 0) {
Fatal("Unable to copy audio context %s\n", av_make_error_string(ret).c_str());
}
Error("Unable to copy audio context %s\n", av_make_error_string(ret).c_str());
audio_output_stream = NULL;
} else {
audio_output_context->codec_tag = 0;
if ( audio_output_context->channels > 1 ) {
Warning("Audio isn't mono, changing it.");
@ -404,6 +243,8 @@ Debug(2, "Have audio_output_context");
} else {
Debug(3, "Audio is mono");
}
}
} // end if audio_output_stream
} // end if is AAC
if ( audio_output_stream ) {
@ -412,10 +253,7 @@ if ( audio_output_stream ) {
}
}
} else {
Debug(3, "No Audio output stream");
audio_output_stream = NULL;
}
} // end if audio_input_stream
/* open the output file, if needed */
if (!(output_format->flags & AVFMT_NOFILE)) {
@ -529,8 +367,242 @@ Debug(2, "writing flushed packet pts(%d) dts(%d) duration(%d)", pkt.pts, pkt.dts
avformat_free_context(oc);
#ifdef HAVE_LIBSWRESAMPLE
if ( resample_context )
//if ( resample_context )
//swr_free( &resample_context );
#endif
}
bool VideoStore::setup_resampler() {
#ifdef HAVE_LIBSWRESAMPLE
static char error_buffer[256];
audio_output_codec = avcodec_find_encoder(AV_CODEC_ID_AAC);
if ( ! audio_output_codec ) {
Error("Could not find codec for AAC");
return false;
}
Debug(2, "Have audio output codec");
audio_output_stream = avformat_new_stream( oc, audio_output_codec );
audio_output_context = audio_output_stream->codec;
if ( ! audio_output_context ) {
Error( "could not allocate codec context for AAC\n");
audio_output_stream = NULL;
return false;
}
Debug(2, "Have audio_output_context");
AVDictionary *opts = NULL;
av_dict_set(&opts, "strict", "experimental", 0);
/* put sample parameters */
audio_output_context->bit_rate = audio_input_context->bit_rate;
audio_output_context->sample_rate = audio_input_context->sample_rate;
audio_output_context->channels = audio_input_context->channels;
audio_output_context->channel_layout = audio_input_context->channel_layout;
audio_output_context->sample_fmt = audio_input_context->sample_fmt;
//audio_output_context->refcounted_frames = 1;
if (audio_output_codec->supported_samplerates) {
int found = 0;
for ( unsigned int i = 0; audio_output_codec->supported_samplerates[i]; i++) {
if ( audio_output_context->sample_rate == audio_output_codec->supported_samplerates[i] ) {
found = 1;
break;
}
}
if ( found ) {
Debug(3, "Sample rate is good");
} else {
audio_output_context->sample_rate = audio_output_codec->supported_samplerates[0];
Debug(1, "Sampel rate is no good, setting to (%d)", audio_output_codec->supported_samplerates[0] );
}
}
/* check that the encoder supports s16 pcm input */
if (!check_sample_fmt( audio_output_codec, audio_output_context->sample_fmt)) {
Debug( 3, "Encoder does not support sample format %s, setting to FLTP",
av_get_sample_fmt_name( audio_output_context->sample_fmt));
audio_output_context->sample_fmt = AV_SAMPLE_FMT_FLTP;
}
//audio_output_stream->time_base = audio_input_stream->time_base;
audio_output_context->time_base = (AVRational){ 1, audio_output_context->sample_rate };
Debug(3, "Audio Time bases input stream (%d/%d) input codec: (%d/%d) output_stream (%d/%d) output codec (%d/%d)",
audio_input_stream->time_base.num,
audio_input_stream->time_base.den,
audio_input_context->time_base.num,
audio_input_context->time_base.den,
audio_output_stream->time_base.num,
audio_output_stream->time_base.den,
audio_output_context->time_base.num,
audio_output_context->time_base.den
);
ret = avcodec_open2(audio_output_context, audio_output_codec, &opts );
av_dict_free(&opts);
if ( ret < 0 ) {
av_strerror(ret, error_buffer, sizeof(error_buffer));
Fatal( "could not open codec (%d) (%s)\n", ret, error_buffer );
audio_output_codec = NULL;
audio_output_context = NULL;
audio_output_stream = NULL;
return false;
}
Debug(1, "Audio output bit_rate (%d) sample_rate(%d) channels(%d) fmt(%d) layout(%d) frame_size(%d), refcounted_frames(%d)",
audio_output_context->bit_rate,
audio_output_context->sample_rate,
audio_output_context->channels,
audio_output_context->sample_fmt,
audio_output_context->channel_layout,
audio_output_context->frame_size,
audio_output_context->refcounted_frames
);
#if 1
/** Create the FIFO buffer based on the specified output sample format. */
if (!(fifo = av_audio_fifo_alloc(audio_output_context->sample_fmt,
audio_output_context->channels, 1))) {
Error("Could not allocate FIFO\n");
return false;
}
#endif
output_frame_size = audio_output_context->frame_size;
/** Create a new frame to store the audio samples. */
if (!(input_frame = zm_av_frame_alloc())) {
Error("Could not allocate input frame");
return false;
}
/** Create a new frame to store the audio samples. */
if (!(output_frame = zm_av_frame_alloc())) {
Error("Could not allocate output frame");
av_frame_free(&input_frame);
return false;
}
#if 0
/**
* Create a resampler context for the conversion.
* Set the conversion parameters.
* Default channel layouts based on the number of channels
* are assumed for simplicity (they are sometimes not detected
* properly by the demuxer and/or decoder).
*/
resample_context = swr_alloc_set_opts(NULL,
av_get_default_channel_layout(audio_output_context->channels),
audio_output_context->sample_fmt,
audio_output_context->sample_rate,
av_get_default_channel_layout( audio_input_context->channels),
audio_input_context->sample_fmt,
audio_input_context->sample_rate,
0, NULL);
if (!resample_context) {
Error( "Could not allocate resample context\n");
return;
}
/**
* Perform a sanity check so that the number of converted samples is
* not greater than the number of samples to be converted.
* If the sample rates differ, this case has to be handled differently
*/
av_assert0(audio_output_context->sample_rate == audio_input_context->sample_rate);
/** Open the resampler with the specified parameters. */
if ((ret = swr_init(resample_context)) < 0) {
Error( "Could not open resample context\n");
swr_free(&resample_context);
return;
}
#else
// Setup the audio resampler
resample_context = avresample_alloc_context();
if (!resample_context) {
Error( "Could not allocate resample context\n");
return false;
}
// Some formats (i.e. WAV) do not produce the proper channel layout
if ( audio_input_context->channel_layout == 0 ) {
Error( "Could not allocate resample context channgel_layout\n");
//av_opt_set_int( resample_context, "in_channel_layout", av_get_channel_layout( m_profile->channels == 1 ? "mono" : "stereo" ), 0 );
} else {
av_opt_set_int( resample_context, "in_channel_layout", audio_input_context->channel_layout, 0 );
}
av_opt_set_int( resample_context, "in_sample_fmt", audio_input_context->sample_fmt, 0);
av_opt_set_int( resample_context, "in_sample_rate", audio_input_context->sample_rate, 0);
av_opt_set_int( resample_context, "in_channels", audio_input_context->channels,0);
av_opt_set_int( resample_context, "out_channel_layout", audio_output_context->channel_layout, 0);
av_opt_set_int( resample_context, "out_sample_fmt", audio_output_context->sample_fmt, 0);
av_opt_set_int( resample_context, "out_sample_rate", audio_output_context->sample_rate, 0);
av_opt_set_int( resample_context, "out_channels", audio_output_context->channels, 0);
ret = avresample_open( resample_context );
if ( ret < 0 ) {
Error( "Could not open resample context\n");
return false;
}
#if 0
/**
* Allocate as many pointers as there are audio channels.
* Each pointer will later point to the audio samples of the corresponding
* channels (although it may be NULL for interleaved formats).
*/
if (!( converted_input_samples = (uint8_t *)calloc( audio_output_context->channels, sizeof(*converted_input_samples))) ) {
Error( "Could not allocate converted input sample pointers\n");
return;
}
/**
* Allocate memory for the samples of all channels in one consecutive
* block for convenience.
*/
if ((ret = av_samples_alloc( &converted_input_samples, NULL,
audio_output_context->channels,
audio_output_context->frame_size,
audio_output_context->sample_fmt, 0)) < 0) {
Error( "Could not allocate converted input samples (error '%s')\n",
av_make_error_string(ret).c_str() );
av_freep(converted_input_samples);
free(converted_input_samples);
return;
}
#endif
output_frame->nb_samples = audio_output_context->frame_size;
output_frame->format = audio_output_context->sample_fmt;
output_frame->channel_layout = audio_output_context->channel_layout;
// The codec gives us the frame size, in samples, we calculate the size of the samples buffer in bytes
unsigned int audioSampleBuffer_size = av_samples_get_buffer_size( NULL, audio_output_context->channels, audio_output_context->frame_size, audio_output_context->sample_fmt, 0 );
converted_input_samples = (uint8_t*) av_malloc( audioSampleBuffer_size );
if ( !converted_input_samples ) {
Error( "Could not allocate converted input sample pointers\n");
return false;
}
// Setup the data pointers in the AVFrame
if ( avcodec_fill_audio_frame(
output_frame,
audio_output_context->channels,
audio_output_context->sample_fmt,
(const uint8_t*) converted_input_samples,
audioSampleBuffer_size, 0 ) < 0 ) {
Error( "Could not allocate converted input sample pointers\n");
return false;
}
#endif
return true;
#else
Error("Not built with libswresample library. Cannot do audio conversion to AAC");
return false;
#endif
}
@ -820,7 +892,33 @@ av_codec_is_encoder( audio_output_context->codec)
int frame_size = input_frame->nb_samples;
Debug(4, "Frame size: %d", frame_size );
#if 1
// Resample the input into the audioSampleBuffer until we proceed the whole decoded data
if ( (ret = avresample_convert( resample_context,
NULL,
0,
0,
input_frame->data,
0,
input_frame->nb_samples )) < 0 )
{
Error( "Could not resample frame (error '%s')\n",
av_make_error_string(ret).c_str());
return 0;
}
if ( avresample_available( resample_context ) < output_frame->nb_samples ) {
Debug(1, "No enough samples yet");
return 0;
}
// Read a frame audio data from the resample fifo
if ( avresample_read( resample_context, output_frame->data, output_frame->nb_samples ) != output_frame->nb_samples )
{
Warning( "Error reading resampled audio: " );
return 0;
}
#else
Debug(4, "About to convert");
/** Convert the samples using the resampler. */
@ -877,6 +975,7 @@ av_codec_is_encoder( audio_output_context->codec)
Error( "Could not read data from FIFO\n");
return 0;
}
#endif
/** Set a timestamp based on the sample rate for the container. */
output_frame->pts = av_rescale_q( opkt.pts, audio_output_context->time_base, audio_output_stream->time_base );

View File

@ -8,6 +8,9 @@ extern "C" {
#ifdef HAVE_LIBSWRESAMPLE
#include "libswresample/swresample.h"
#endif
#ifdef HAVE_LIBAVRESAMPLE
#include "libavresample/avresample.h"
#endif
}
#if HAVE_LIBAVCODEC
@ -44,7 +47,10 @@ private:
AVAudioFifo *fifo;
int output_frame_size;
#ifdef HAVE_LIBSWRESAMPLE
SwrContext *resample_context = NULL;
//SwrContext *resample_context = NULL;
#endif
#ifdef HAVE_LIBAVRESAMPLE
AVAudioResampleContext* resample_context;
#endif
uint8_t *converted_input_samples = NULL;
@ -66,6 +72,8 @@ private:
int64_t filter_in_rescale_delta_last;
bool setup_resampler();
public:
VideoStore(const char *filename_in, const char *format_in, AVStream *video_input_stream, AVStream *audio_input_stream, int64_t nStartTime, Monitor * p_monitor );
~VideoStore();

View File

@ -53,8 +53,8 @@
#cmakedefine HAVE_LIBAVUTIL_MATHEMATICS_H 1
#cmakedefine HAVE_LIBSWSCALE 1
#cmakedefine HAVE_LIBSWSCALE_SWSCALE_H 1
#cmakedefine HAVE_LIBSWRESAMPLE 1
#cmakedefine HAVE_LIBSWRESAMPLE_SWRESAMPLE_H 1
#cmakedefine HAVE_LIBAVRESAMPLE 1
#cmakedefine HAVE_LIBAVRESAMPLE_AVRESAMPLE_H 1
#cmakedefine HAVE_LIBVLC 1
#cmakedefine HAVE_VLC_VLC_H 1
#cmakedefine HAVE_LIBX264 1