MP plugin for Video Transcoding (1 Viewer)

Frodo

Retired Team Member
  • Premium Supporter
  • April 22, 2004
    1,518
    121
    52
    The Netherlands
    Home Country
    Netherlands Netherlands
    hrmmm Fabrice???

    could it be.... :confused:
    The famous Fabrice from the FFMPEG project ??
    :eek:
    ifso.. respect!! and what can we do so you join the mediaportal team???

    Frodo
     

    fabriceD06

    Portal Pro
    January 28, 2007
    123
    14
    Nice
    Home Country
    France France
    Hello Noelix,

    Thanks a lot for your test !

    I read the log file, and the process is correctly launched but after it crashs :-(

    Can you test the ffmpeg encoder with theses parameters in the config.txt

    encoder.1pass.args=-b 150k -bt 150k -ab 96 -vcodec mpeg4 -g 300 -bf 2 -acodec mp3 -ar 22050 -f avi

    the quality of the video is not good but it is just to verify if the encoding finish correctly.

    and for mencoder (if you prefer) the line following

    encoder.1pass.args=-ovc lavc -oac lavc -ffourcc DX50


    PS for Frodo: I am affraid but i am not the Fabrice of FFMPEG project.

    Bye
    Fab
     

    fabriceD06

    Portal Pro
    January 28, 2007
    123
    14
    Nice
    Home Country
    France France
    Hello fabrice,

    This was on my to do list. So, thanks! Are you the fabrice who holds the copywrite on ffmpeg? If you post the code changes and a working ffmpeg version, I can add it to the svn. Does the included ffmpeg version use libxvidcore or the internal xvid?
    Hello diehard2,

    I don't who holds the copy write of ffpmeg.

    For the code i will wait some people says me it works before to give you ;-) to be sure to have a stable version.

    Currently i use the binarie and not the DLL, because when i used the dll if the encoding crash the process MP crash also. so i prefered the solution to create an external process for not disturb the MP process.

    bye Fab
     

    Frodo

    Retired Team Member
  • Premium Supporter
  • April 22, 2004
    1,518
    121
    52
    The Netherlands
    Home Country
    Netherlands Netherlands
    Fabrice

    Can we also have real-time transcoding ?
    Say i have an mpeg-2 transport stream and i want to transcode it in realtime
    to a lower bitrate and/or lower resolution.
    Output must be mpeg-2 transport stream as well

    If this can be made, we could add it to the tvserver and then we can use clients over the internet
    At the moment this is not possible since streaming a full mpeg-ts channel requires too much bandwidth

    Frodo
     

    fabriceD06

    Portal Pro
    January 28, 2007
    123
    14
    Nice
    Home Country
    France France
    Hello Noelix,

    thanks for your help.

    It is normal for command prompt windows blank, it is the background process. The video transcoding are correclty started, in log file i see


    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err]FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2006 Fabrice Bellard, et al.
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] configuration: --prefix=/mingw --enable-memalign-hack --cc=gcc-4.1 --disable-debug --enable-a52 --enable-dts --enable-gpl --enable-avisynth --enable-amr_nb --enable-amr_wb --enable-xvid --enable-x264 --enable-mp3lame --enable-vorbis --enable-libogg --enable-faac --enable-pp
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] libavutil version: 49.1.0
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] libavcodec version: 51.27.0
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] libavformat version: 51.6.0
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] built on Dec 20 2006 23:36:00, gcc: 4.1.1 [Sherpya]
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err]Input #0, asf, from 'E:\recordings\Afro Samurai SH883483x101 (1_5_2007).dvr-ms':
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] Duration: 00:34:57.0, start: 0.000000, bitrate: 5631 kb/s
    2007-01-30 10:21:02.531250 [Info.][Thread TransErrStream]: [ExternalTranscoder][Err] duration found 2097
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] Stream #0.0: Audio: mp2, 48000 Hz, stereo, 384 kb/s
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] Stream #0.1: Video: mpeg2video, yuv420p, 720x480, 5000 kb/s, 29.97 fps(r)
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err]Output #0, avi, to 'E:\recordings\Afro Samurai SH883483x101 (1_5_2007).avi':
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] Stream #0.0: Video: mpeg4, yuv420p, 720x480, q=2-31, 150 kb/s, 29.97 fps(c)
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] Stream #0.1: Audio: mp3, 22050 Hz, stereo, 96 kb/s
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err]Stream mapping:
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] Stream #0.1 -> #0.0
    2007-01-30 10:21:02.531250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err] Stream #0.0 -> #0.1

    and three minutes , the encoding progress


    2007-01-30 10:23:46.015625 [Info.][12]: ExternalTranscoder[IsFinished] is finish False
    2007-01-30 10:23:46.015625 [Info.][12]: ExternalTranscoder[Percentage] return percentage 130
    2007-01-30 10:23:46.031250 [Debug][Thread TransErrStream]: [ExternalTranscoder][Err]frame= 8245 q=31.0 size= 13876kB time=275.0 bitrate= 413.3kbits/s
    2007-01-30 10:23:46.031250 [Info.][Thread TransErrStream]: [ExternalTranscoder][Err] value found 275.0

    After i suppose you close the blank commant prompt windows ;) and the encoding is stopped.

    When you launch the encoding from the menu compression, you can see the progression in the sub-menu state , can you check this once the transcoding is launched.

    I am agree currently the percentage return is wrong (because by exemple it returns 130 % then it is 13 %, it is my stupid bug of multiplication :oops: )

    For your video of 34 min, the encoding with a bit rate 150kb/s take 20~30 minutes.

    you can change the bitrate in the commande line

    encoder.1pass.args=-b 150k -bt 150k -ab 96 -vcodec mpeg4 -g 300 -bf 2 -acodec mp3 -ar 22050 -f avi

    For a DVD the bit rate is about 1000k - 2500k.

    Can you launch the transcoding (don't close the blank prompt windows) and check in the sub-menu state or status in compression menu. Normally you can check also with the task manager, you can see a process ffmpeg.exe take some cpu ;-)

    :D

    bye
    Fabrice
     

    fabriceD06

    Portal Pro
    January 28, 2007
    123
    14
    Nice
    Home Country
    France France
    Fabrice

    Can we also have real-time transcoding ?
    Say i have an mpeg-2 transport stream and i want to transcode it in realtime
    to a lower bitrate and/or lower resolution.
    Output must be mpeg-2 transport stream as well

    If this can be made, we could add it to the tvserver and then we can use clients over the internet
    At the moment this is not possible since streaming a full mpeg-ts channel requires too much bandwidth

    Frodo
    Hello Frodo,

    Normally it possible to encode in real time (for low bit rate ) with ffmpeg . But not with my currently modification because i use the binarie instead the dll.

    I have few doubt about the topics:

    1. the hardware required to encode in real time, i think some test are necessary.
    2. the usage of API of FFMPEG is in C++, the integration in C# is not easy . because it necessary to wrappe all types like AVOutputStream and AVInputStream to the c# media stream

    But possible:D with time.

    Fabrice
     

    Frodo

    Retired Team Member
  • Premium Supporter
  • April 22, 2004
    1,518
    121
    52
    The Netherlands
    Home Country
    Netherlands Netherlands
    2. c++ is not a problem,
    The main problem i had with ffmpeg was that it was file based
    What i would like is something like:
    Code:
    byte* transCoded=ffmpeg.transcode(byte* tspacket);

    so i supply a mpeg-2 ts packet and get a transcoded mpeg-2 ts packet back

    Frodo
     

    Noelix

    Portal Pro
    February 18, 2006
    393
    1
    Salt Lake City, UT
    Home Country
    United States of America United States of America
    Can you launch the transcoding (don't close the blank prompt windows) and check in the sub-menu state or status in compression menu. Normally you can check also with the task manager, you can see a process ffmpeg.exe take some cpu ;-)

    Alright I gotcha now, sorry I wasn't catching on right away. It completes its task successfully! The % is off as you noticed already, and for some reason MediaPortal.log is now 578MB after transcoding two files. Judging from past log files I've posted, it looks like it has to do with the thumbnail creation for the videos. I don't even view it in thumbnail mode and it's trying to create thumbnails over and over and failing for some reason. I don't think this is a problem with your transcoding process, but there may be a way to stop it from trying to create thumbnails while the file is being encoded... Anyways I could be completely wrong.

    Seems to work great, the only thing I know people would like is to be able to change the config.txt settings within MP, and to have the transcoding process window (blank command prompt window) occur in the background as opposed to minimizing MP and bringing focus to it. Thanks so much for building this!

    EDIT: I noticed that if you choose "delete original file", the MP database is not updated to reflect that change. As a result, the tv show listing remains in the database (aka Recorded TV), but is still pointing to the original .dvr-ms file, and not the new .avi file. So when you try to play the recorded-tv file, it doesn't play.
     

    Users who are viewing this thread

    Top Bottom