Adding srt support in php for mencoder

User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Adding srt support in php for mencoder

Post by Neo » Wed Jan 13, 2010 3:41 am

Can you try this one with -newsubtitle at the end of line.

Code: Select all

$cmd = 'ffmpeg -i '.$in.' -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre hq -crf 22 -threads 2 '.$out_vid.' -newsubtitle '.$in_sub;  
Mysoogal
Captain
Captain
Posts: 223
Joined: Thu Dec 17, 2009 7:15 am
Location: Planet VPS

Re: Adding srt support in php for mencoder

Post by Mysoogal » Wed Jan 13, 2010 3:57 am

little change now creates file.mkv but no encoding taking place

file has zero size so no encoding going on. :evil: evil ffmpeg ! doc not help much even on ffmpeg website
Image
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Adding srt support in php for mencoder

Post by Neo » Wed Jan 13, 2010 4:03 am

Please ignore my last post about adding newsubtitle to the end. x264 has mp4 extension, but I don't think that makes any difference. It seems there are issues in using subtitles in ffmpeg. However I think proper flags must get it working (the problem is it will take quite a lot of time to identify the combination).
Mysoogal
Captain
Captain
Posts: 223
Joined: Thu Dec 17, 2009 7:15 am
Location: Planet VPS

Re: Adding srt support in php for mencoder

Post by Mysoogal » Wed Jan 13, 2010 4:10 am

Neo wrote:Please ignore my last post about adding newsubtitle to the end. x264 has mp4 extension, but I don't think that makes any difference. It seems there are issues in using subtitles in ffmpeg. However I think proper flags must get it working (the problem is it will take quite a lot of time to identify the combination).

exactly why ffmpeg documentation is bad they have little section for subtitle but

http://ffmpeg.org/ffmpeg-doc.html#SEC13

section 3.7 Subtitle options:

they have not update that part since ffmpeg was probably developed :lol: its a shame !! that mencoder can not output compatible mp4 files so they can be used on flash player :geek:

i'm going to check other methods using other tools, like vlc avidemux2 has cli and few others i think :D
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Adding srt support in php for mencoder

Post by Neo » Wed Jan 13, 2010 11:05 am

See whether x264.exe can help you to convert. I used this ones quite a long time ago and it worked perfectly. I not sure about the options you require like subtitles so please check it.

Also, check whether you use the latest ffmpeg.exe. Compare with ffmpeg command line options at https://robot.lk/viewtopic.php?f=39&t=1143. Files are also attached for you.
Mysoogal
Captain
Captain
Posts: 223
Joined: Thu Dec 17, 2009 7:15 am
Location: Planet VPS

Re: Adding srt support in php for mencoder

Post by Mysoogal » Wed Jan 13, 2010 6:40 pm

i've built the ffmpeg directly from svn :o i think from ubuntu forum link http://ubuntuforums.org/showthread.php?t=786095 i followed the hardy 8.04 version since my vps is based on that version :cry: as for x264.exe don't see that -- subtitle option under its list of features maybe need to look again. but

after look more into it, now i know why the subtitles support is bad in ffmpeg the developers didn't mess around with it just look at the changes they made !

from version 0.3: initial public release to version 0.5 nothing about subtitles :cry: that is crazy !

http://ffmpeg.org/Changelog

Code: Select all

root@mysoogal-1:~# ffmpeg -formats
FFmpeg version SVN-r21123, Copyright (c) 2000-2010 Fabrice Bellard, et al.
  built on Jan 10 2010 14:15:54 with gcc 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab
  libavutil     50. 7. 0 / 50. 7. 0
  libavcodec    52.46. 0 / 52.46. 0
  libavformat   52.46. 0 / 52.46. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0. 8. 0 /  0. 8. 0
  libpostproc   51. 2. 0 / 51. 2. 0
File formats:
 D. = Demuxing supported
 .E = Muxing supported
 --
  E 3g2             3GP2 format
  E 3gp             3GP format
 D  4xm             4X Technologies format
 D  IFF             IFF format
 D  ISS             Funcom ISS format
 D  MTV             MTV format
 DE RoQ             raw id RoQ format
 D  aac             raw ADTS AAC
 DE ac3             raw AC-3
  E adts            ADTS AAC
 D  aea             MD STUDIO audio
 DE aiff            Audio IFF
 DE alaw            PCM A-law format
 DE amr             3GPP AMR file format
 D  anm             Deluxe Paint Animation
 D  apc             CRYO APC format
 D  ape             Monkey's Audio
 DE asf             ASF format
  E asf_stream      ASF format
 DE ass             SSA/ASS format
 DE au              SUN AU format
 DE avi             AVI format
  E avm2            Flash 9 (AVM2) format
 D  avs             AVS format
 D  bethsoftvid     Bethesda Softworks VID format
 D  bfi             Brute Force & Ignorance
 D  c93             Interplay C93
 D  caf             Apple Core Audio Format
 D  cavsvideo       raw Chinese AVS video
 D  cdg             CD Graphics Format
  E crc             CRC testing format
 DE daud            D-Cinema audio format
 DE dirac           raw Dirac
 DE dnxhd           raw DNxHD (SMPTE VC-3)
 D  dsicin          Delphine Software International CIN format
 DE dts             raw DTS
 DE dv              DV video format
 D  dv1394          DV1394 A/V grab
  E dvd             MPEG-2 PS format (DVD VOB)
 D  dxa             DXA
 D  ea              Electronic Arts Multimedia Format
 D  ea_cdata        Electronic Arts cdata
 DE eac3            raw E-AC-3
 DE f32be           PCM 32 bit floating-point big-endian format
 DE f32le           PCM 32 bit floating-point little-endian format
 DE f64be           PCM 64 bit floating-point big-endian format
 DE f64le           PCM 64 bit floating-point little-endian format
 DE ffm             FFM (FFserver live feed) format
 D  film_cpk        Sega FILM/CPK format
 DE flac            raw FLAC
 D  flic            FLI/FLC/FLX animation format
 DE flv             FLV format
  E framecrc        framecrc testing format
  E gif             GIF Animation
 D  gsm             raw GSM
 DE gxf             GXF format
 DE h261            raw H.261
 DE h263            raw H.263
 DE h264            raw H.264 video format
 D  idcin           id Cinematic format
 DE image2          image2 sequence
 DE image2pipe      piped image2 sequence
 D  ingenient       raw Ingenient MJPEG
 D  ipmovie         Interplay MVE format
  E ipod            iPod H.264 MP4 format
 D  iv8             A format generated by IndigoVision 8000 video server
 D  lmlm4           lmlm4 raw format
 DE m4v             raw MPEG-4 video format
 DE matroska        Matroska file format
 DE mjpeg           raw MJPEG video
 DE mlp             raw MLP
 D  mm              American Laser Games MM format
 DE mmf             Yamaha SMAF
  E mov             MOV format
 D  mov,mp4,m4a,3gp,3g2,mj2 QuickTime/MPEG-4/Motion JPEG 2000 format
  E mp2             MPEG audio layer 2
 DE mp3             MPEG audio layer 3
  E mp4             MP4 format
 D  mpc             Musepack
 D  mpc8            Musepack SV8
 DE mpeg            MPEG-1 System format
  E mpeg1video      raw MPEG-1 video
  E mpeg2video      raw MPEG-2 video
 DE mpegts          MPEG-2 transport stream format
 D  mpegtsraw       MPEG-2 raw transport stream format
 D  mpegvideo       raw MPEG video
  E mpjpeg          MIME multipart JPEG format
 D  msnwctcp        MSN TCP Webcam stream
 DE mulaw           PCM mu-law format
 D  mvi             Motion Pixels MVI format
 DE mxf             Material eXchange Format
  E mxf_d10         Material eXchange Format, D-10 Mapping
 D  nc              NC camera feed format
 D  nsv             Nullsoft Streaming Video
  E null            raw null video format
 DE nut             NUT format
 D  nuv             NuppelVideo format
 DE ogg             Ogg
 D  oma             Sony OpenMG audio
 DE oss             Open Sound System playback
  E psp             PSP MP4 format
 D  psxstr          Sony Playstation STR format
 D  pva             TechnoTrend PVA file and stream format
 D  qcp             QCP format
 D  r3d             REDCODE R3D format
 DE rawvideo        raw video format
  E rcv             VC-1 test bitstream
 D  rl2             RL2 format
 DE rm              RealMedia format
 D  rpl             RPL/ARMovie format
  E rtp             RTP output format
 D  rtsp            RTSP input format
 DE s16be           PCM signed 16 bit big-endian format
 DE s16le           PCM signed 16 bit little-endian format
 DE s24be           PCM signed 24 bit big-endian format
 DE s24le           PCM signed 24 bit little-endian format
 DE s32be           PCM signed 32 bit big-endian format
 DE s32le           PCM signed 32 bit little-endian format
 DE s8              PCM signed 8 bit format
 D  sdp             SDP
 D  shn             raw Shorten
 D  siff            Beam Software SIFF
 D  smk             Smacker video
 D  sol             Sierra SOL format
 DE sox             SoX native format
  E spdif           IEC958 - S/PDIF (IEC-61937)
  E svcd            MPEG-2 PS format (VOB)
 DE swf             Flash format
 D  thp             THP
 D  tiertexseq      Tiertex Limited SEQ format
 D  tmv             8088flex TMV
 DE truehd          raw TrueHD
 D  tta             True Audio
 D  txd             Renderware TeXture Dictionary
 DE u16be           PCM unsigned 16 bit big-endian format
 DE u16le           PCM unsigned 16 bit little-endian format
 DE u24be           PCM unsigned 24 bit big-endian format
 DE u24le           PCM unsigned 24 bit little-endian format
 DE u32be           PCM unsigned 32 bit big-endian format
 DE u32le           PCM unsigned 32 bit little-endian format
 DE u8              PCM unsigned 8 bit format
 D  vc1             raw VC-1
 D  vc1test         VC-1 test bitstream format
  E vcd             MPEG-1 System format (VCD)
 D  video4linux     Video4Linux device grab
 D  video4linux2    Video4Linux2 device grab
 D  vmd             Sierra VMD format
  E vob             MPEG-2 PS format (VOB)
 DE voc             Creative Voice file format
 D  vqf             Nippon Telegraph and Telephone Corporation (NTT) TwinVQ
 D  w64             Sony Wave64 format
 DE wav             WAV format
 D  wc3movie        Wing Commander III movie format
 D  wsaud           Westwood Studios audio format
 D  wsvqa           Westwood Studios VQA format
 D  wv              WavPack
 D  xa              Maxis XA File Format
 DE yuv4mpegpipe    YUV4MPEG pipe format
Mysoogal
Captain
Captain
Posts: 223
Joined: Thu Dec 17, 2009 7:15 am
Location: Planet VPS

Re: Adding srt support in php for mencoder

Post by Mysoogal » Thu Jan 14, 2010 3:56 am

hi neo, after looking for a method to my problem with mencoders mp4 output not compatible with flash player, i've read i could use MP4box
To create the interleaving metadata (which will allow for mid stream resumes, and rewinds/fforwards),
could i use the $file_output after encoding has completed to pass through MP4box to fix the issue on the original srt avi encoding code ? :shock:


Code: Select all

sudo apt-get install gpac

and then the command to run MP4Box was:

Code: Select all

MP4Box -add ‘filename.mp4? ‘newfilename.mp4?
could this be done within the script ? or do i need to make new one and fire the mp4box script after encoding has taken place ?
Mysoogal
Captain
Captain
Posts: 223
Joined: Thu Dec 17, 2009 7:15 am
Location: Planet VPS

Re: Adding srt support in php for mencoder

Post by Mysoogal » Thu Jan 14, 2010 5:19 am

sorry , discharge comment above thank you

:geek:

mp4box is not what im looking for
Post Reply

Return to “PHP & MySQL”