發表文章

目前顯示的是 5月, 2017的文章

ffmpeg example compile error (NOT test yet)

https://trac.ffmpeg.org/ ticket/6089 https://stackoverflow.com/questions/38850260/errors-when-compiling-c-code-with-ffmpeg-library

如何找到ffmpeg的config設定?

config.fate :1:config:x86:x86_64:generic:linux:gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609:--prefix=/home/john/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/john/ffmpeg_build/include --extra-ldflags=-L/home/john/ffmpeg_build/lib --bindir=/home/john/bin --enable-gpl --enable-libfreetype --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --disable-ffplay --disable-ffserver --disable-doc --disable-libopus

Ts to MP4; no transcode

ffmpeg -i seg000.ts -acodec copy -vcodec copy  seg000_new.mp4

trace ffmpeg -i inputfile流程

[John ffmpeg_parse_options() 3249] [John open_input_file() 992] [John avformat_open_input() 515] [John avformat_open_input() 603] s 0x35207c0 s->iformat->read_header 0x69c350 [John mpegts_read_header() 2615] mpegts_read_header =  0x69c350, s 0x35207c0 [John avformat_open_input() 646] nb_streams 3

Cross Compile FFMpeg for ARM

從TS製作m3u8的命令

ffmpeg -i 0301.ts -hls_time 45 0301_test.m3u8 NO transcoding ffmpeg -i 304.ts -c copy -hls_time 45 AVC/0304.m3u8 ffmpeg -i INPUT -codec copy -segment_times SPLIT_TIME -f segment OUT ffmpeg -i 304.ts  -vcodec copy -acodec copy -f segment -segment_list AVC/300.m3u8 -segment_time 10 AVC/seg%3d.ts ffmpeg -i 304.ts  -vcodec copy -an -f segment -segment_list AVC/300.m3u8 -segment_time 10 AVC/seg%3d.ts ffmpeg -i 304.ts  -vn copy -acodec copy -f segment -segment_list AVC/300.m3u8 -segment_time 10 AVC/seg%3d.ts ffmpeg -i 304.ts  -vcodec copy  -f dash -min_seg_duration 3000000  -single_file 0 test.mpd ffmpeg -i udp://10.0.224.28:1234 -c copy -f dash -window_size 5 -min_seg_duration 3000000 -single_file 0 -init_seg_name initavatar-stream\$RepresentationID\$.m4s -media_seg_name chunkavatar-stream\$RepresentationID\$-\$Number%05d\$.m4s -use_template 0 -bsf:a aac_adtstoasc  ftp://user:password@192.168.32.188/liang/liangc.mpd

利用ffmpeg取出ts流中特定的program

https://trac.ffmpeg.org/wiki/Map Example 8 MPEG stream selection: The tricky part with selecting from MPEG TS is it may contain multiple streams/channels, and if you are receiving "live data" just specifying an index might not work because it can change from run to run, so ffmpeg -i INPUT -map 0:6 OUTPUT # might not work the same every run, DO NOT USE THIS WAY! Assuming your file is MPEG, you can run "ffmpeg -i INPUT" (not specify an output) to see what program id's and stream id's it contains, like this example (probesize and analyzeduration specified to help "make sure" it picks up all the streams in it, may not be always needed) $ ffmpeg -probesize 50M -analyzeduration 50M -i INPUT ... Input #0, mpegts, from 'INPUT': Duration: N/A, start: 22159.226833, bitrate: N/A Program 1344 Metadata: service_name : 7 Digital service_provider: Seven Network Stream #0:0[0x401]: Video: mpeg2video (Main) ([2][0][0...