VLC debug 模式编译

./configure –enable-debug –disable-optimizations –disable-sout PKG_CONFIG_PATH=/home/xw/mywork/Qt/5.11.2/gcc_64/lib/pkgconfig

find -name Makefile | xargs -i sed -i “s/-g -O2/-g3 -O0/” {}

find -name Makefile | xargs -i grep -iH “-g3 ” {}

dd 命令分割文件

dd if=base.apk of=./testmidi.wav bs=1 skip=232820652 count=398

bs=BYTES read and write up to BYTES bytes at a time (default: 512);
overrides ibs and obs
cbs=BYTES convert BYTES bytes at a time
conv=CONVS convert the file as per the comma separated symbol list
count=N copy only N input blocks
ibs=BYTES read up to BYTES bytes at a time (default: 512)
if=FILE read from FILE instead of stdin
iflag=FLAGS read as per the comma separated symbol list
obs=BYTES write BYTES bytes at a time (default: 512)
of=FILE write to FILE instead of stdout
oflag=FLAGS write as per the comma separated symbol list
seek=N skip N obs-sized blocks at start of output
skip=N skip N ibs-sized blocks at start of input
status=LEVEL The LEVEL of information to print to stderr;
‘none’ suppresses everything but error messages,
‘noxfer’ suppresses the final transfer statistics,
‘progress’ shows periodic transfer statistics

ubuntu 14.04 build vlc in error

NOTE: autopoint (GNU gettext-tools) appears to be missing or out-of-date.
Please install or update GNU gettext tools.
Otherwise, you will not be able to build a source tarball.
gettext-0.19.8.tar.gz 下载 build install gettext工具

autoreconf: running: aclocal -I m4 –force -I m4
configure.ac:1700: warning: PKG_PROG_PKG_CONFIG is m4_require’d but not m4_defun’d
m4/with_pkg.m4:34: PKG_WITH_MODULES is expanded from…
m4/with_pkg.m4:83: PKG_ENABLE_MODULES_VLC is expanded from…

configure.ac:4150: the top level
configure.ac:1: error: possibly undefined macro: dnl
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:39: error: possibly undefined macro: AC_DEFINE
configure.ac:58: error: possibly undefined macro: AS_IF

下载build pkg-config-0.29.2.tar.gz install

parallel-tests: installing ‘autotools/test-driver’
bin/Makefile.am:41: error: Libtool library used but ‘LIBTOOL’ is undefined
bin/Makefile.am:41: The usual way to define ‘LIBTOOL’ is to add ‘LT_INIT’
bin/Makefile.am:41: to ‘configure.ac’ and run ‘aclocal’ and ‘autoconf’ again.
bin/Makefile.am:41: If ‘LT_INIT’ is in ‘configure.ac’, make sure
bin/Makefile.am:41: its definition is in aclocal’s search path.
bin/Makefile.am: installing ‘autotools/depcomp’
compat/Makefile.am:1: error: Libtool library used but ‘LIBTOOL’ is undefined

下载 build install libtool-2.4.6

vlc 4.0 build failed QT not find


VLC依赖QT作为UI环境,编译时会有如下提示导致没有UI

checking for QT… no
configure: WARNING: No package ‘Qt5Core’ found
No package ‘Qt5Widgets’ found
No package ‘Qt5Gui’ found
Package Qt5Core was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5Core.pc’
to the PKG_CONFIG_PATH environment variable
Package ‘Qt5Core’, required by ‘Qt5 Svg’, not found.

下载QT源码下载工具
http://mirror.bit.edu.cn/qtproject/archive/online_installers/3.0/qt-unified-linux-x64-3.0.5-online.run
cd
/opt/Qt/5.11.1/Src
./configure
sudo make install -j8  编译安装qt
export PKG_CONFIG_PATH=/usr/local/Qt-5.11.1/lib/pkgconfig/
echo $PKG_CONFIG_PATH
配置搜索路径

编译VLC
cd vlccode/
./configure
sudo make






stream 对象创建时机

 
对于所有的文件格式,stream对象都是在probe函数探测到文件格式后调用相应的 AVInputFormat 的int (*read_header)(struct AVFormatContext *); 函数。

537 int avformat_open_input(AVFormatContext **ps, const char *filename,
 538                         AVInputFormat *fmt, AVDictionary **options)
 629 
 630     if (!(s->flags&AVFMT_FLAG_PRIV_OPT) && s->iformat->read_header)
 631         if ((ret = s->iformat->read_header(s)) < 0)
 632             goto fail;
For MKV
#0  avformat_new_stream (s=0x7fffe00008c0, c=0x0) at libavformat/utils.c:4456
#1  0x00000000007a1e89 in matroska_parse_tracks (s=0x7fffe00008c0) at libavformat/matroskadec.c:2199
#2  0x00000000007a4077 in matroska_read_header (s=0x7fffe00008c0) at libavformat/matroskadec.c:2657
#3  0x00000000008a1939 in avformat_open_input (ps=0x7fffe83b4d00, filename=0x423a060 "test.mkv", fmt=0x0, options=0x25e1410 <format_opts>) at libavformat/utils.c:631
For AVI 
#0  avformat_new_stream (s=0x7fffe00008c0, c=0x0) at libavformat/utils.c:4456
#1  0x000000000072970d in avi_read_header (s=0x7fffe00008c0) at libavformat/avidec.c:571
#2  0x00000000008a1939 in avformat_open_input (ps=0x7fffe83b4d00, filename=0x425a460 "/home/xw/Documents/videotest/mpeg1.avi", fmt=0x0, options=0x25e1410 <format_opts>) at libavformat/utils.c:631
For ts 
#0  avformat_new_stream (s=0x7fffe00008c0, c=0x0) at libavformat/utils.c:4456
#1  0x00000000007fd3b1 in pmt_cb (filter=0x7fffe0001040, section=0x7fffe0009500 "\002\260\027", section_len=26) at libavformat/mpegts.c:2075
#2  0x00000000007f8531 in write_section_data (ts=0x7fffe00174c0, tss1=0x7fffe0001040, buf=0x7fffe000f60d "\002\260\027", buf_size=183, is_start=1) at libavformat/mpegts.c:441
#3  0x00000000007fe2f1 in handle_packet (ts=0x7fffe00174c0, packet=0x7fffe000f608 "GO\377\020") at libavformat/mpegts.c:2394
#4  0x00000000007feb6e in handle_packets (ts=0x7fffe00174c0, nb_packets=26595) at libavformat/mpegts.c:2583
#5  0x00000000007ff1c3 in mpegts_read_header (s=0x7fffe00008c0) at libavformat/mpegts.c:2704
#6  0x00000000008a1939 in avformat_open_input (ps=0x7fffe83b4d00, filename=0x425d0f0 "/home/xw/Documents/videotest/tt.ts", fmt=0x0, options=0x25e1410 <format_opts>) at libavformat/utils.c:631
For mp3
#0  avformat_new_stream (s=0x7fffe00008c0, c=0x0) at libavformat/utils.c:4456
#1  0x00000000007ecf28 in mp3_read_header (s=0x7fffe00008c0) at libavformat/mp3dec.c:355
#2  0x00000000008a1939 in avformat_open_input (ps=0x7fffe83b4d00, filename=0x425d0f0 "/home/xw/Documents/videotest/tesss.mp3", fmt=0x0, options=0x25e1410 <format_opts>) at libavformat/utils.c:631

ffmpeg debug 调试configuration

configuration: --enable-debug=3 --disable-doc --disable-optimizations --enable-pic --extra-cflags=-fPIC --disable-demuxer=bluray --enable-openssl --enable-demuxer=dash

./configure --enable-debug=3 --disable-doc --disable-optimizations --enable-pic --extra-cflags=-fPIC --enable-openssl --enable-libx264 --enable-libx265 --enable-gpl --enable-nonfree

vim 16进制打开jpeg文件出错处理

在linux下用vim打开jpg文件,使用%!xxd进行16进制显示时,文件头显示为”3f3f
3f3f 0011 0804″文件尾端显示为 “3f3f
0a”;而同样的操作在windows下,就显示为”ffd8 ffc0 0011 0804″和 “ffd9
0a”,这才是正确的jpeg文件头和文件尾标志。
很蹊跷 !
初时,我以为是jpeg在windows和linux下是不同的文件头,后来把jpg后缀去掉,就一个纯文件,现象依旧。考虑可能不是操作系统的差异了。
重新使用ghex打开jpeg数据查看,发现显示正常,为”ffd8 ffc0 0011
0804″和 “ffd9 0a”,正确。
估计应该是vim的问题了。
3f的ascii码是?,那表示vim对文件头、尾没有正常解析,是不是和vim解析文件时用的编码格式有关系呢?
打开.vimrc配置项,屏蔽掉下面这句话:
set fileencodings=utf-8,gb2312,gbk,gb18030,ucs-bom
再用vim打开jpeg文件,显示”ffd8 ffc0 0011 0804″和 “ffd9 0a”,
显示正确。
原来,为了支持识别和显示中文,我规定了vim的fileencodings,
当vim打开文件时,会使用规定的编码格式对数据进行解析,可惜jpeg的文件头FFD8、尾FFD9
不是任何一个中文的编码,vim找不到对应的中文字,就显示为??,即:3f3f。
至此,困惑全部打开。
正确方式可以使用xxd file-want-open | tee filename