[Slackbuilds-users] a bug+solution found on transcode Slackbuilds

matic maticsavli6 at gmail.com
Sun Apr 24 15:45:35 UTC 2016


Hi,

I would like to give some feedback on the 
https://slackbuilds.org/repository/14.1/multimedia/transcode/
First thanks for providing this package.

Transcode build itself is perfectly fine but I found one bug using 
transcode and ffmpeg mpeg2video codec

A command making me problems and the output log are attached below 
(transcode_failed_log.txt). There is this pointer issue that was already 
found on 
https://bitbucket.org/france/transcode-tcforge/issues/4/segfault-at-end-of-pass-1-ffmpeg-mpeg4.

ffmpeg version used:
     ffmpeg version 2.1 Copyright (c) 2000-2013 the FFmpeg developers
   built on Apr 29 2014 18:30:44 with gcc 4.8.2 (GCC)
   configuration: --prefix=/usr --libdir=/usr/lib64 
--shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg-2.1/html 
--mandir=/usr/man --disable-debug --enable-shared --disable-static 
--enable-pthreads --enable-libtheora --enable-libvorbis --enable-gpl 
--enable-version3 --enable-postproc --enable-swscale --enable-x11grab 
--enable-avfilter --enable-gnutls --enable-libcdio --enable-libssh 
--arch=x86_64 --enable-libmp3lame --enable-libx264

transcode version used:
     from https://slackbuilds.org/repository/14.1/multimedia/transcode/)
     transcode v1.1.7 (C) 2001-2003 Thomas Oestreich, 2003-2010 
Transcode Team

I add the correction (using 
https://bitbucket.org/france/transcode-tcforge/issues/4/segfault-at-end-of-pass-1-ffmpeg-mpeg4) 
for the command above to work in a patch (attached below). Along I 
modified the transcode.SlackBuild to use this patch (also attached 
below). It is important to first use this patch and then all others 
already provided in the package.

This solved the problem. I hope you can modify the Slackbuild package 
using this solution or just to let you know...

Thanks.

Cheers,
matic


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20160424/03eeb388/attachment-0001.html>
-------------- next part --------------
$ transcode -J transform --mplayer_probe -i movie_in.MOV -y ffmpeg,null -F mpeg2video -o movie_out.MOV
     
transcode v1.1.7 (C) 2001-2003 Thomas Oestreich, 2003-2010 Transcode Team
[transcode] V: auto-probing     | 11320001.MOV (OK)
[transcode] V: import format    | (null) in  (module=mplayer)
[transcode] A: auto-probing     | 11320001.MOV (OK)
[transcode] A: import format    | PCM in  (module=mplayer)
[transcode] V: AV demux/sync    | (1) sync AV at initial MPEG sequence
[transcode] V: import frame     | 1920x1080  1.78:1  encoded @ 16:9
[transcode] V: bits/pixel       | 0.029 (low)
[transcode] V: decoding fps,frc | 30.000,5
[transcode] V: video format     | YUV420 (4:2:0) aka I420
[transcode] A: import format    | 0x1     PCM          [32000,16,1]  512 kbps
[transcode] A: export           | disabled
[transcode] V: encoding fps,frc | 30.000,5
[transcode] A: bytes per frame  | 2134 (2133.333333)
[transcode] A: adjustment       | -664 at 1000
[transcode] V: IA32/AMD64 accel | sse42 sse41 ssse3 sse3 sse2 sse mmx cmove asm
[transcode] V: video buffer     | 10 @ 1920x1080 [0x2]
[transcode] A: audio buffer     | 10 @ 32000x1x16
[import_mplayer.so] v0.1.2 (2007-11-01) (video) rendered by mplayer | (audio) rendered by mplayer
[filter_transform.so] v0.98 (2014-01-04) transforms each frame according to transformations
 given in an input file (e.g. translation, rotate) see also filter stabilize
[filter_transform.so] Image Transformation/Stabilization Settings:
[filter_transform.so]     input     = 11320001.MOV.trf
[filter_transform.so]     smoothing = 15
[filter_transform.so]     maxshift  = -1
[filter_transform.so]     maxangle  = -1.000000
[filter_transform.so]     crop      = Keep
[filter_transform.so]     relative  = True
[filter_transform.so]     invert    = False
[filter_transform.so]     zoom      = 0.000000
[filter_transform.so]     optzoom   = 1
[filter_transform.so]     interpol  = Bi-Linear (2)
[filter_transform.so]     sharpen   = 0.800000
[filter_transform.so] Final zoom: 2.117940

[filter_unsharp.so] unsharp: 5x5:0.80 (sharpen luma)
[filter_unsharp.so] unsharp: 5x5:0.40 (sharpen chroma)
[filter_unsharp.so] v1.0.1 (2003-10-27) unsharp mask & gaussian blur
[export_null.so] v0.1.2 (2001-08-17) (video) null | (audio) null
[export_ffmpeg.so] v0.3.18 (2008-11-29) (video) Lavc55.39.100 | (audio) MPEG/AC3/PCM
[import_mplayer.so] mplayer -slave -hardframedrop -vo null -ao pcm:nowaveheader:file="/tmp/mplayer2transcode-audio.jNAmHw"  "11320001.MOV" > /dev/null 2>&1
[import_mplayer.so] tcextract -i /tmp/mplayer2transcode-audio.jNAmHw -x pcm -t raw
[import_mplayer.so] mplayer -slave -benchmark -noframedrop -nosound -vo yuv4mpeg:file=/tmp/mplayer2transcode-video.8QVkWv  "11320001.MOV" -osdlevel 0 > /dev/null 2>&1
[import_mplayer.so] tcextract -i /tmp/mplayer2transcode-video.8QVkWv -x yuv420p -t yuv4mpeg
[export_ffmpeg.so] Using FFMPEG codec 'mpeg2video' (FourCC 'mpg2', MPEG2 compliant video).
[export_ffmpeg.so] No profile selected
[export_ffmpeg.so] warning: Error opening configuration file ./ffmpeg.cfg: No such file or directory
[export_ffmpeg.so] Starting 1 thread(s)
[export_ffmpeg.so] Set display aspect ratio to input
[mpeg2video @ 0x4c62320] removing common factors from framerate
*** Error in `transcode': free(): invalid pointer: 0x00007f14b0deb57d ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7fd8a)[0x7f14c4f5dd8a]
/usr/lib64/libavutil.so.52(av_freep+0xc)[0x7f14afc3eb6c]
/usr/lib64/libavutil.so.52(av_opt_free+0x3c)[0x7f14afc3f6fc]
/usr/lib64/libavcodec.so.55(avcodec_close+0x125)[0x7f14afee7da6]
/usr/lib64/transcode/export_ffmpeg.so(tc_export+0x4d9)[0x7f14b0de8199]
transcode(tcv_export+0x35)[0x413a95]
transcode(tc_encoder_stop+0xa5)[0x414ed5]
transcode(main+0x4745)[0x40cb15]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f14c4effd85]
transcode[0x40d59d]
======= Memory map: ========
00400000-00470000 r-xp 00000000 08:01 1235496                            /usr/bin/transcode
00670000-00673000 rw-p 00070000 08:01 1235496                            /usr/bin/transcode
00673000-0068b000 rw-p 00000000 00:00 0
014ee000-04f00000 rw-p 00000000 00:00 0                                  [heap]
7f149c000000-7f149c024000 rw-p 00000000 00:00 0
7f149c024000-7f14a0000000 ---p 00000000 00:00 0
7f14a4000000-7f14a4021000 rw-p 00000000 00:00 0
7f14a4021000-7f14a8000000 ---p 00000000 00:00 0
7f14a8d7a000-7f14a8d8f000 r-xp 00000000 08:01 1232656                    /usr/lib64/libgcc_s.so.1
7f14a8d8f000-7f14a8f8f000 ---p 00015000 08:01 1232656                    /usr/lib64/libgcc_s.so.1
7f14a8f8f000-7f14a8f90000 rw-p 00015000 08:01 1232656                    /usr/lib64/libgcc_s.so.1
7f14ab5fc000-7f14abaf0000 rw-p 00000000 00:00 0
7f14ac0df000-7f14ac0e0000 ---p 00000000 00:00 0
7f14ac0e0000-7f14ac8e0000 rw-p 00000000 00:00 0
7f14ac8e0000-7f14ac8e1000 ---p 00000000 00:00 0
7f14ac8e1000-7f14ad0e1000 rw-p 00000000 00:00 0                          [stack:14305]
7f14ad0e1000-7f14ad0e2000 ---p 00000000 00:00 0
7f14ad0e2000-7f14ad8e2000 rw-p 00000000 00:00 0
7f14ad8e2000-7f14ad8e3000 ---p 00000000 00:00 0
7f14ad8e3000-7f14ae0e3000 rw-p 00000000 00:00 0
7f14ae0e3000-7f14ae0e4000 ---p 00000000 00:00 0
7f14ae0e4000-7f14ae8e4000 rw-p 00000000 00:00 0                          [stack:14298]
7f14ae8e4000-7f14ae8ea000 r-xp 00000000 08:01 1212182                    /usr/lib64/libogg.so.0.8.0
7f14ae8ea000-7f14aeae9000 ---p 00006000 08:01 1212182                    /usr/lib64/libogg.so.0.8.0
7f14aeae9000-7f14aeaea000 rw-p 00005000 08:01 1212182                    /usr/lib64/libogg.so.0.8.0
7f14aeaea000-7f14aeb31000 r-xp 00000000 08:01 1234438                    /usr/lib64/libmp3lame.so.0.0.0
7f14aeb31000-7f14aed30000 ---p 00047000 08:01 1234438                    /usr/lib64/libmp3lame.so.0.0.0
7f14aed30000-7f14aed32000 rw-p 00046000 08:01 1234438                    /usr/lib64/libmp3lame.so.0.0.0
7f14aed32000-7f14aed60000 rw-p 00000000 00:00 0
7f14aed60000-7f14aed79000 r-xp 00000000 08:01 1212544                    /usr/lib64/libtheoradec.so.1.1.4
7f14aed79000-7f14aef78000 ---p 00019000 08:01 1212544                    /usr/lib64/libtheoradec.so.1.1.4
7f14aef78000-7f14aef79000 rw-p 00018000 08:01 1212544                    /usr/lib64/libtheoradec.so.1.1.4
7f14aef79000-7f14aefb7000 r-xp 00000000 08:01 1212545                    /usr/lib64/libtheoraenc.so.1.1.2
7f14aefb7000-7f14af1b7000 ---p 0003e000 08:01 1212545                    /usr/lib64/libtheoraenc.so.1.1.2
7f14af1b7000-7f14af1b8000 rw-p 0003e000 08:01 1212545                    /usr/lib64/libtheoraenc.so.1.1.2
7f14af1b8000-7f14af1e4000 r-xp 00000000 08:01 1212700                    /usr/lib64/libvorbis.so.0.4.6
7f14af1e4000-7f14af3e3000 ---p 0002c000 08:01 1212700                    /usr/lib64/libvorbis.so.0.4.6
7f14af3e3000-7f14af3e4000 rw-p 0002b000 08:01 1212700                    /usr/lib64/libvorbis.so.0.4.6
7f14af3e4000-7f14af697000 r-xp 00000000 08:01 1212701                    /usr/lib64/libvorbisenc.so.2.0.9
7f14af697000-7f14af896000 ---p 002b3000 08:01 1212701                    /usr/lib64/libvorbisenc.so.2.0.9
7f14af896000-7f14af8b2000 rw-p 002b2000 08:01 1212701                    /usr/lib64/libvorbisenc.so.2.0.9
7f14af8b2000-7f14af9a8000 r-xp 00000000 08:01 1234433                    /usr/lib64/libx264.so.138
7f14af9a8000-7f14afba8000 ---p 000f6000 08:01 1234433                    /usr/lib64/libx264.so.138
7f14afba8000-7f14afbaa000 rw-p 000f6000 08:01 1234433                    /usr/lib64/libx264.so.138
7f14afbaa000-7f14afc25000 rw-p 00000000 00:00 0
7f14afc25000-7f14afc60000 r-xp 00000000 08:01 1234449                    /usr/lib64/libavutil.so.52.48.100
7f14afc60000-7f14afe60000 ---p 0003b000 08:01 1234449                    /usr/lib64/libavutil.so.52.48.100
7f14afe60000-7f14afe65000 rw-p 0003b000 08:01 1234449                    /usr/lib64/libavutil.so.52.48.100
7f14afe65000-7f14afe75000 rw-p 00000000 00:00 0
7f14afe75000-7f14b05c9000 r-xp 00000000 08:01 1234448                    /usr/lib64/libavcodec.so.55.39.100
7f14b05c9000-7f14b07c8000 ---p 00754000 08:01 1234448                    /usr/lib64/libavcodec.so.55.39.100
7f14b07c8000-7f14b0800000 rw-p 00753000 08:01 1234448                    /usr/lib64/libavcodec.so.55.39.100
7f14b0800000-7f14b0ddf000 rw-p 00000000 00:00 0
7f14b0ddf000-7f14b0dec000 r-xp 00000000 08:01 416123                     /usr/lib64/transcode/export_ffmpeg.so
7f14b0dec000-7f14b0feb000 ---p 0000d000 08:01 416123                     /usr/lib64/transcode/export_ffmpeg.so
7f14b0feb000-7f14b0fee000 rw-p 0000c000 08:01 416123                     /usr/lib64/transcode/export_ffmpeg.so
7f14b0fee000-7f14b0fef000 r-xp 00000000 08:01 416106                     /usr/lib64/transcode/export_null.so
7f14b0fef000-7f14b11ee000 ---p 00001000 08:01 416106                     /usr/lib64/transcode/export_null.so
7f14b11ee000-7f14b11ef000 rw-p 00000000 08:01 416106                     /usr/lib64/transcode/export_null.so
7f14b11ef000-7f14b203e000 rw-p 00000000 00:00 0
7f14b203e000-7f14b2041000 r-xp 00000000 08:01 416065                     /usr/lib64/transcode/filter_unsharp.so
7f14b2041000-7f14b2240000 ---p 00003000 08:01 416065                     /usr/lib64/transcode/filter_unsharp.so
7f14b2240000-7f14b2241000 rw-p 00002000 08:01 416065                     /usr/lib64/transcode/filter_unsharp.so
7f14b2241000-7f14b2251000 r-xp 00000000 08:01 416041                     /usr/lib64/transcode/filter_transform.so
7f14b2251000-7f14b2450000 ---p 00010000 08:01 416041                     /usr/lib64/transcode/filter_transform.so
7f14b2450000-7f14b2451000 r--p 0000f000 08:01 416041                     /usr/lib64/transcode/filter_transform.so
7f14b2451000-7f14b2452000 rw-p 00010000 08:01 416041                     /usr/lib64/transcode/filter_transform.so
7f14b2452000-7f14b2454000 r-xp 00000000 08:01 416069                     /usr/lib64/transcode/import_mplayer.so
7f14b2454000-7f14b2653000 ---p 00002000 08:01 416069                     /usr/lib64/transcode/import_mplayer.so
7f14b2653000-7f14b2654000 rw-p 00001000 08:01 416069                     /usr/lib64/transcode/import_mplayer.so
7f14b2654000-7f14c4494000 rw-p 00000000 00:00 0
7f14c4494000-7f14c4499000 r-xp 00000000 08:01 1224541                    /usr/lib64/libXdmcp.so.6.0.0
7f14c4499000-7f14c4698000 ---p 00005000 08:01 1224541                    /usr/lib64/libXdmcp.so.6.0.0
7f14c4698000-7f14c4699000 rw-p 00004000 08:01 1224541                    /usr/lib64/libXdmcp.so.6.0.0
7f14c4699000-7f14c469b000 r-xp 00000000 08:01 1224444                    /usr/lib64/libXau.so.6.0.0
7f14c469b000-7f14c489b000 ---p 00002000 08:01 1224444                    /usr/lib64/libXau.so.6.0.0
7f14c489b000-7f14c489c000 rw-p 00002000 08:01 1224444                    /usr/lib64/libXau.so.6.0.0
7f14c489c000-7f14c48b9000 r-xp 00000000 08:01 1227357                    /usr/lib64/libxcb.so.1.1.0
7f14c48b9000-7f14c4ab8000 ---p 0001d000 08:01 1227357                    /usr/lib64/libxcb.so.1.1.0
7f14c4ab8000-7f14c4ab9000 rw-p 0001c000 08:01 1227357                    /usr/lib64/libxcb.so.1.1.0
7f14c4ab9000-7f14c4abc000 r-xp 00000000 08:01 261956                     /lib64/libuuid.so.1.3.0
7f14c4abc000-7f14c4cbb000 ---p 00003000 08:01 261956                     /lib64/libuuid.so.1.3.0
7f14c4cbb000-7f14c4cbc000 rw-p 00002000 08:01 261956                     /lib64/libuuid.so.1.3.0
7f14c4cbc000-7f14c4cdd000 r-xp 00000000 08:01 261652                     /lib64/liblzma.so.5.0.5
7f14c4cdd000-7f14c4edd000 ---p 00021000 08:01 261652                     /lib64/liblzma.so.5.0.5
7f14c4edd000-7f14c4ede000 rw-p 00021000 08:01 261652                     /lib64/liblzma.so.5.0.5
7f14c4ede000-7f14c509d000 r-xp 00000000 08:01 289334                     /lib64/libc-2.17.so
7f14c509d000-7f14c529c000 ---p 001bf000 08:01 289334                     /lib64/libc-2.17.so
7f14c529c000-7f14c52a0000 r--p 001be000 08:01 289334                     /lib64/libc-2.17.so
7f14c52a0000-7f14c52a2000 rw-p 001c2000 08:01 289334                     /lib64/libc-2.17.so
7f14c52a2000-7f14c52a7000 rw-p 00000000 00:00 0
7f14c52a7000-7f14c52aa000 r-xp 00000000 08:01 289337                     /lib64/libdl-2.17.so
7f14c52aa000-7f14c54a9000 ---p 00003000 08:01 289337                     /lib64/libdl-2.17.so
7f14c54a9000-7f14c54aa000 r--p 00002000 08:01 289337                     /lib64/libdl-2.17.so
7f14c54aa000-7f14c54ab000 rw-p 00003000 08:01 289337                     /lib64/libdl-2.17.so
7f14c54ab000-7f14c54c0000 r-xp 00000000 08:01 261644                     /lib64/libz.so.1.2.8
7f14c54c0000-7f14c56bf000 ---p 00015000 08:01 261644                     /lib64/libz.so.1.2.8
7f14c56bf000-7f14c56c0000 rw-p 00014000 08:01 261644                     /lib64/libz.so.1.2.8
7f14c56c0000-7f14c57c1000 r-xp 00000000 08:01 283242                     /lib64/libm-2.17.so
7f14c57c1000-7f14c59c0000 ---p 00101000 08:01 283242                     /lib64/libm-2.17.so
7f14c59c0000-7f14c59c1000 r--p 00100000 08:01 283242                     /lib64/libm-2.17.so
7f14c59c1000-7f14c59c2000 rw-p 00101000 08:01 283242                     /lib64/libm-2.17.so
7f14c59c2000-7f14c5af6000 r-xp 00000000 08:01 1224411                    /usr/lib64/libX11.so.6.3.0
7f14c5af6000-7f14c5cf6000 ---p 00134000 08:01 1224411                    /usr/lib64/libX11.so.6.3.0
7f14c5cf6000-7f14c5cfc000 rw-p 00134000 08:01 1224411                    /usr/lib64/libX11.so.6.3.0
7f14c5cfc000-7f14c5d0d000 r-xp 00000000 08:01 1224620                    /usr/lib64/libXext.so.6.4.0
7f14c5d0d000-7f14c5f0c000 ---p 00011000 08:01 1224620                    /usr/lib64/libXext.so.6.4.0
7f14c5f0c000-7f14c5f0d000 rw-p 00010000 08:01 1224620                    /usr/lib64/libXext.so.6.4.0
7f14c5f0d000-7f14c5f23000 r-xp 00000000 08:01 1223578                    /usr/lib64/libICE.so.6.3.0
7f14c5f23000-7f14c6123000 ---p 00016000 08:01 1223578                    /usr/lib64/libICE.so.6.3.0
7f14c6123000-7f14c6124000 rw-p 00016000 08:01 1223578                    /usr/lib64/libICE.so.6.3.0
7f14c6124000-7f14c6128000 rw-p 00000000 00:00 0
7f14c6128000-7f14c612f000 r-xp 00000000 08:01 1223585                    /usr/lib64/libSM.so.6.0.1
7f14c612f000-7f14c632e000 ---p 00007000 08:01 1223585                    /usr/lib64/libSM.so.6.0.1
7f14c632e000-7f14c632f000 rw-p 00006000 08:01 1223585                    /usr/lib64/libSM.so.6.0.1
7f14c632f000-7f14c6346000 r-xp 00000000 08:01 283261                     /lib64/libpthread-2.17.so
7f14c6346000-7f14c6546000 ---p 00017000 08:01 283261                     /lib64/libpthread-2.17.so
7f14c6546000-7f14c6547000 r--p 00017000 08:01 283261                     /lib64/libpthread-2.17.so
7f14c6547000-7f14c6548000 rw-p 00018000 08:01 283261                     /lib64/libpthread-2.17.so
7f14c6548000-7f14c654c000 rw-p 00000000 00:00 0
7f14c654c000-7f14c66a7000 r-xp 00000000 08:01 1212824                    /usr/lib64/libxml2.so.2.9.1
7f14c66a7000-7f14c68a6000 ---p 0015b000 08:01 1212824                    /usr/lib64/libxml2.so.2.9.1
7f14c68a6000-7f14c68b0000 rw-p 0015a000 08:01 1212824                    /usr/lib64/libxml2.so.2.9.1
7f14c68b0000-7f14c68b1000 rw-p 00000000 00:00 0
7f14c68b1000-7f14c68d4000 r-xp 00000000 08:01 289360                     /lib64/ld-2.17.so
7f14c68f1000-7f14c6a94000 rw-p 00000000 00:00 0
7f14c6ad2000-7f14c6ad4000 rw-p 00000000 00:00 0
7f14c6ad4000-7f14c6ad5000 r--p 00023000 08:01 289360                     /lib64/ld-2.17.so
7f14c6ad5000-7f14c6ad7000 rw-p 00024000 08:01 289360                     /lib64/ld-2.17.so
7fffb7cca000-7fffb7ceb000 rw-p 00000000 00:00 0                          [stack]
7fffb7dbe000-7fffb7dbf000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
-------------- next part --------------
#!/bin/sh

# Slackware build script for transcode

# Copyright 2008-2015 Heinz Wiesinger, Amsterdam, The Netherlands
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=transcode
VERSION=1.1.7
BUILD=${BUILD:-4}
TAG=${TAG:-_SBo}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

# Fix building with newer ffmpeg
patch -p0 -i $CWD/transcode-1.1.7-export_ffmpeg.patch
patch -p0 -i $CWD/transcode-1.1.7-ffmpeg.patch
patch -p0 -i $CWD/transcode-1.1.7-ffmpeg-0.10.patch
patch -p1 -i $CWD/transcode-1.1.7-ffmpeg-0.11.patch
patch -p1 -i $CWD/transcode-1.1.7-preset-free.patch
patch -p0 -i $CWD/transcode-1.1.7-libav-9.patch
patch -p1 -i $CWD/transcode-1.1.7-preset-force.patch
patch -p1 -i $CWD/transcode-1.1.7-ffmpeg2.patch
patch -p1 -i $CWD/transcode-1.1.7-ffmpeg24.patch

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --mandir=/usr/man \
  --enable-alsa \
  --enable-v4l \
  --enable-libv4l2=${LIBV4L:-yes} \
  --enable-libv4lconvert=${LIBV4L:-yes} \
  --enable-libmpeg2=${LIBMPEG2:-no} \
  --enable-libmpeg2convert=${LIBMPEG2:-no} \
  --enable-ogg \
  --enable-vorbis \
  --enable-theora \
  --enable-x264=${X264:-no} \
  --enable-xvid=${XVID:-no} \
  --enable-faac=${FAAC:-no} \
  --enable-freetype2 \
  --enable-sdl \
  --enable-libxml2 \
  --enable-libdv=${LIBDV:-no} \
  --enable-libquicktime=${QUICKTIME:-no} \
  --enable-mjpegtools=${MJPEGTOOLS:-no} \
  --enable-a52=${A52DEC:-no} \
  --enable-lame=${LAME:-no} \
  --enable-nuv \
  --enable-lzo \
  --enable-libpostproc \
  --enable-imagemagick \
  --build=$ARCH-slackware-linux

make
make install-strip DESTDIR=$PKG

# Install headers
mkdir -p $PKG/usr/include/transcode/{aclib,avilib,libtc,libtcaudio,libtcvideo}
install -m 644 src/*.h $PKG/usr/include/transcode/
install -m 644 aclib/*.h $PKG/usr/include/transcode/aclib/
install -m 644 avilib/*.h $PKG/usr/include/transcode/avilib/
install -m 644 libtc/*.h $PKG/usr/include/transcode/libtc/
install -m 644 libtcaudio/*.h $PKG/usr/include/transcode/libtcaudio/
install -m 644 libtcvideo/*.h $PKG/usr/include/transcode/libtcvideo/
install -m 644 config.h $PKG/usr/include/transcode/

# remove filters shipped by other packages
rm -f $PKG/usr/lib$LIBDIRSUFFIX/transcode/filter_{stabilize,transform}.*

find $PKG/usr/man -type f -exec gzip -9 {} \;

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS ChangeLog COPYING INSTALL README STYLE TODO \
 $PKG/usr/doc/$PRGNAM-$VERSION
# --docdir does not work
mv $PKG/usr/share/doc/$PRGNAM/* $PKG/usr/doc/$PRGNAM-$VERSION/
rm -rf $PKG/usr/share
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transcode-1.1.7-export_ffmpeg.patch
Type: text/x-patch
Size: 824 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20160424/03eeb388/attachment-0001.bin>


More information about the SlackBuilds-users mailing list