VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. Member
    Join Date
    Apr 2013
    Location
    United States
    Search Comp PM
    Hey guys, I decided to work on a frontend for ffmpeg, and I call it ffe (nice and simple name). It's written in python and works in Windows and Linux (or whatever supports python 2.7 and wxpython), and it also requires ffmpeg and ffprobe (or avconv or avprobe). I want to release it but I'm not sure if it's worth replacing the great converters that are already out.

    I decided to work on this since I found out ffmpeg has the best compatibility with my video collection. Other converters tend to unsync video and audio for my variable-fps videos.

    Here is an album of screenshots: http://imgur.com/a/7E4mR

    Features I like:
    -Nearly everything works on Linux too, given that the builds have the same features
    -Job queueing
    -Somewhat smart subtitle hardcoding
    -Hardcode internal and external streams
    -External subtitle filename matching, unicode characters that are incompatible are copied into a temp directory
    -Disabling of options that are incompatible with other options
    -The ability to change different versions of ffmpeg/ffprobe for the gui (I think other converters allow this too)
    -Specify subtitle/audio streams to hardcode/include based on language pattern matching
    -Customize global options for individual jobs
    -Thumbnails
    -Detailed and practical stream information can be displayed
    -Option to add silent audio stream when a video has no audio streams (some media players won't play video without one)

    Known problems or features that I'd like:
    -Fontconfigs needs to build a font cache or something, so this tend to take a while when hardcoding subtitles.
    -Thumbnail generation tends be a bother when adding lots of videos
    -Revert settings doesn't work
    -Needs quality settings for common video codecs, currently only the h264 group is supported

    I want to release the source code and binaries too. Along with a tutorial on how to add your own ui options and have them depend on other options and such.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Looks fine. And hardcoding subtitle is always welcome.

    Can you adjust any subtitle settings? Position, size, font, etc?
    Quote Quote  
  3. Member ozok's Avatar
    Join Date
    Oct 2011
    Location
    Turkey
    Search Comp PM
    Looks nice. I'll try it when I have time and when you release it.

    BTW what development tool did you use? I write python scripts myself but never done anything with a GUI.
    Last edited by ozok; 2nd Apr 2013 at 04:22.
    Quote Quote  
  4. Member
    Join Date
    Apr 2013
    Location
    United States
    Search Comp PM
    The gui makes sure that ffmpeg has libass enabled, and any other text based subtitles are encoded to that format and a video filter is used to hard code it. Not sure if there's any parameters to could add to override fonts, I'll have to find documentation for it.

    I made it in visual studio with python tools.
    Quote Quote  
  5. Not sure if there's any parameters to could add to override fonts, I'll have to find documentation for it.
    mencoder has '-ass-force-style' to overwrite subtitle parameters loaded through libass, not sure if ffmpeg does -> if you find some documentation for it please post some details.
    Quote Quote  
  6. Member
    Join Date
    Apr 2013
    Location
    United States
    Search Comp PM
    Thanks for the info Selur!
    Quote Quote  
  7. No problem, I use mencoder to embed subtitles in Hybrid so I read up on it some while back,..
    Quote Quote  
  8. Member
    Join Date
    Apr 2013
    Location
    United States
    Search Comp PM
    Well I found out where the subtitle video filter options are at. In FFmpeg, it's in libavfilter/vf_subtitles.c.

    The lastest version of FFmpeg has two subtitle filters, "subtitles" and "ass." The "subtitle" filter simply internally transcodes all decodable subtitles to ass format. Each subtitle video filter shares a "common" option:
    Code:
    #define COMMON_OPTIONS \
        {"filename",       "set the filename of file to read",                         OFFSET(filename),   AV_OPT_TYPE_STRING,     {.str = NULL},  CHAR_MIN, CHAR_MAX, FLAGS }, \
        {"f",              "set the filename of file to read",                         OFFSET(filename),   AV_OPT_TYPE_STRING,     {.str = NULL},  CHAR_MIN, CHAR_MAX, FLAGS }, \
        {"original_size",  "set the size of the original video (used to scale fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL},  CHAR_MIN, CHAR_MAX, FLAGS }, \
    Here, "subtitle" and "ass" filters alls support "filename"/"f" for the subtitle file, and "original_size". So there's nothing about fonts here

    If you go the actually subtitle option entries themselves:
    Code:
    static const AVOption ass_options[] = {
        COMMON_OPTIONS
        {NULL},
    };
    ...
    static const AVOption subtitles_options[] = {
        COMMON_OPTIONS
        {"charenc", "set input character encoding", OFFSET(charenc), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS},
        {NULL},
    };
    The only thing that's new is the "charenc" option to change encodings when transcoding non-ass subtitles. I searched for anything font related in the normal output options and only found mkv's support for font-file attachments.

    The only thing I can think of doing is overriding all the defined styles in a ASS file. Hm, not sure how reliable that is though.
    Quote Quote  
  9. Overwriting all styles in a subtitle file with one new style sounds like a bad idea (if there are more than one style), especially without a preview to check the result before hardcoding.
    -> I wouldn't overwrite all defined styles, but only the default style. If you have multiple styles in one file you should really use a subtitle editor and not ffmpeg.

    Cu Selur

    Ps.: I normally don't use ffmpeg since it a doesn't support DVD input and supports even less filters than mencoder.
    Quote Quote  
  10. Member
    Join Date
    Apr 2013
    Location
    United States
    Search Comp PM
    Heh, mencoder is what made me use ffmpeg in the first place. I've had audio/video sync issues with mencoder with variable fps videos, but mencoder worked really nice at other times.

    How about giving a user the option to override all or a certain style? Where you use can use asterisk to mark all styles, or choose "Default."
    Quote Quote  
  11. sure you could:
    0. convert the input to .ass if it's text based and not already an .ass file (and create a tempSubtitle file)
    1. parse the input file, collect all styles and their content
    2. let the user decide which style he wants to change
    3. change the style according to the user wishes (modify the temp file)
    (4. add some sort of preview, since blindly selecting fonts, sizes, etc. doesn't seem so clever )
    5. use the temp file for during hardsubbing

    Cu Selur
    Quote Quote  
  12. Member
    Join Date
    Apr 2013
    Location
    United States
    Search Comp PM
    I've pretty much had already implemented these steps except for 4. I could implement number 4 the same way I implemented thumbnails. So this is all okay?
    Quote Quote  
  13. > So this is all okay?
    Sounds okay to me, but in the end you will have to wait for feedback from Baldrick, since he's the one that started the whole subtitle adjusting thing.

    btw. while at it, matroska allows mixing the Audio from a PAL DVD and a NTSC DVD without the need to reencode any of the streams by 'stretching' on of the streams, have you tried how your gui handles those files?
    (I wrote myself some code by parsing the 'mkvinfo -v ' output of those files, but since this takes quite some time I was wondering how other people handle this.)

    Cu Selur
    Quote Quote  
  14. Member
    Join Date
    Apr 2013
    Location
    United States
    Search Comp PM
    Oh no, I have no idea. So why do they need stretching? Is it because the audio is stored in a way that is respectful to the video framerate?
    Last edited by ChazZeromus; 3rd Apr 2013 at 09:21.
    Quote Quote  
  15. Why is simple:
    they start in example with:
    - a video stream (A) of a movie which is from a NTSC DVD so is normally 23.976fps.
    - an audio stream (B) from the same movie (which is synched against the 23.976 fps)
    - an audio stream (C) of the same movie from a PAL DVD, so the audio is synched against 25fps
    now the goal is to combine all three stream into a single file and still have synchronous playback.

    One thing one could do would be to reencode stream C and stretch/shrink it while reencoding to match the length of B.
    Downside there is the reencoding, which normally will:
    a. loose all dynamic compression settings for ac3/dts streams
    b. lower the quality simply due to recompression

    So solve this, Matroska offers the possibility to use it's stretch (shrink) which will adjust the av-synch flags (timecodes) for the selected stream. So instead of recompressing C one would simply set a stretch value of 25/23.976.
    So far so good, depending on the player this all works fine, depending on the quality of the audio processing.
    Downside is all hell breaks loose if you want to reencode or remux the stream and you are not aware of this change.
    (it's kind of like what happens if you reencode a vfr source and forget to also remux the timecodes,..)

    Cu Selur
    Quote Quote  
  16. Member
    Join Date
    Feb 2009
    Location
    India
    Search Comp PM
    I avoid using DTS simply because it takes up a lot of disk space. I am not sure what DTS actually stands for, "Digital Theatre System" or "Digital Time Stamp". In any case if it is "digital time stamp" pal / NTSC should not matter since it would be time based and not frame related.

    I would love to try any new front end for ffmpeg. Recently I switched from Handbrake to "Video to Video" simply because it allows sharpen filter which is missing in Handbrake. There are limitaions in V2V about resizing picture size. Just wish some one would come up with resizing, cropping filters similar to AviDemux AND be capable of handling H264 / X264 codec without problems.
    Quote Quote  



Similar Threads