VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Hello, this is my second thread I need your help!

    I have TV video recordings encoded in MPEG-2 at 4300 Kbps (a 30 minutes movie has a filesize of 1GB)

    I converted it using Handbrake, setting "MPEG-2 (FFmpeg)" as video codec and lowering average bitrate to 700 Kbps). I kept the original framesize, framerate, and audio settings.

    The result is on output file of 200 MB (instead of 1 GB!) and the video quality and encoding time are great for my needs.

    The problem is that the only available containers in Handbrake (for what I can see in the main interface) are "MP4" and "MKV", but I need the standard MPG container (I don't know anything about it, but I know that there are three extensions: ".mpg", ".mp4", and ".mkv", so I need the first one). And I don't think (or at least I hope) the container type would change the internal encoded file characteristics (quality and final filesize especially).

    I tried other free applications to use FFmpeg with a GUI (WinFF, Avanti, StaxRip), but all failed in someway.

    The best I found is "FFmpeg GUI" by Create Software downloaded from http://sourceforge.net/projects/ffmpeg-gui/ but the final result, with the same settings I used in Handbrake, is worse in video quality (the picture is "pixelated", like a mosaic of -I think- about 20x20 pixels squares, although all fine details are present).

    So my last option is to catch in someway the settings that Handbrake uses when it launches "FFMPEG.exe" and use "FFmpeg.exe" via command line with those settings. But I don't know anything of FFmpeg command line use, and I can't find those settings in the Handbrake "verbosity:2 (the maximum value" text log files, that I'll quote here below in my post.

    So, have you any suggestions to get the Handbrake "real" FFmpeg settings or to create the Handbrake output file described above but in a MPG container instead of the MP4 one?

    Thank you very much!

    --- START EDITED SECTION ---:
    While waiting for some answer to my question above, I tried to play the converted mp4 (Handbrake) and mpg (FFmpegGUI) files through my digital terrestrial receiver (the one that I use to record the "original" movies cited at the top of this post) but the device shows a black screen on my TV. This makes me think that anyway the format I chose to convert the original files to, is not the right one.

    The receiver manual says "Video playback: MPEG-1 and MPEG-2 encoded (mpg)" and:

    Video Decoder
    Profile level: MPEG-2MP@ML
    Video resolution: 720 x 576 pixels (PAL), 720 x 480 (NTSC)
    Decoding & Video Out: PAL & NTSC
    Aspect ratio: 4:3 Letterbox, 4:3 Pan & Scan, 16:9

    Audio Decoder
    MPEG MusiCam Layer II
    Sampling rate: 32, 44.1, 48 kHz
    Audio mode: Stereo, Joint Stereo,
    Dual Mono, Mono

    I should match the format characteristics of the original recordings, so I used the MediaInfo application to detect them. I'll post them in a quote at the bottom of this post. Could you help me find a way to make such a type of output movie? Thank you again so much!
    ---END EDITED SECTION---



    P.S.:
    Note#1:
    Avanti always stops when starting the conversion giving me a "Error #03 - FFmpeg didn't respond within the time-out threshold." error message.

    Note#2:
    WinFF only converts to MP4, not Mpeg2

    Note#3:
    FFMpeg GUI has also the problem that it works only with the first mpg file of a set of recorded files (my TV recorder, set on "MPEG PS", creates about 1 GB files for longer-than-about-30-minutes recordings: "000.mpg", "001.mpg", "002.mpg" and so on. FFMpeg GUI gives me an error with 001, 002, etc. files: something like "it's needed an output destination file". All right and no errors when processing "000.mpg" files.

    Note#4:
    I also tried other free applications to convert from MPG2 to MPG2 lowering the video bitrate (Freemake Video Converter, DVDVideoMedia Free Video Converter, DVDVideosoft Free Studio, XVID4PSP), but all failed taking very long conversion times or creating messy files. I think they don't use FFmpeg for the Mpeg2 conversion.



    Here's the Handbrake encoding log (I only substituted real paths and some filenames with a "xyz" fake text):

    HandBrake 0.9.8 2012071700
    OS: Microsoft Windows NT 6.1.7601 Service Pack 1
    CPU: Intel(R) Core(TM)2 Duo CPU T5550 @ 1.83GHz
    Ram: 2046 MB, Screen: 1280x800
    Temp Dir: C:\xyz
    Install Dir: C:\Program Files\Handbrake
    Data Dir: C:\xyz

    -------------------------------------------
    CLI Query: -i "D:\xyz\000.MPG" -t 1 -c 1 -o "C:\xyz.mp4" -f mp4 --crop 0:0:0:0 --strict-anamorphic -e ffmpeg2 -b 700 --vfr -a 1 -E copy -B 0 -6 auto -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 --verbose=2
    User Query: False

    [11:51:17] hb_init: starting libhb thread
    [11:51:17] thread 1d925f8 started ("libhb")
    HandBrake 0.9.8 (2012071700) - MinGW i686 - http://handbrake.fr
    2 CPUs detected
    Opening D:\xyz\000.MPG...
    [11:51:17] hb_scan: path=D:\xyz\000.MPG, title_index=1
    [11:51:17] thread 1d93100 started ("scan")
    libbluray/bdnav/index_parse.c:157: indx_parse(): error opening D:\xyz\000.MPG/BDMV/index.bdmv
    libbluray/bluray.c:1471: nav_get_title_list(D:\xyz\000.MPG) failed (01D935D8)
    [11:51:17] bd: not a bd - trying as a stream/file instead
    libdvdnav: Using dvdnav version 4.1.3
    libdvdread: Encrypted DVD support unavailable.
    libdvdnav: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
    libdvdnav: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
    libdvdread: Can't open file VIDEO_TS.IFO.
    libdvdnav: vm: failed to read VIDEO_TS.IFO
    [11:51:17] dvd: not a dvd - trying as a stream/file instead
    [11:51:17] file is MPEG Program Stream
    [11:51:18] Probing 1 unknown stream
    [11:51:18] Probe: Found stream mpeg2video. stream id 0xe0-0x0
    [11:51:18] Found the following streams
    [11:51:18] Video Streams :
    [11:51:18] 0xe0-0x0 type MPEG2 (0x2)
    [11:51:18] Audio Streams :
    [11:51:18] 0xc0-0x0 type MPEG2 (0x4)
    [11:51:18] Other Streams :
    [11:51:18] stream id 0xc0 (type 0x4 substream 0x0) audio 0xc0
    [11:51:20] scan: decoding previews for title 1
    [11:51:20] scan: preview 1
    [11:51:20] fifo_close: trashing 0 buffer(s)
    [11:51:20] scan: audio 0xc0: mp2, rate=48000Hz, bitrate=200000 Unknown (MPEG2) (2.0 ch)
    [11:51:20] scan: preview 2
    Scanning title 1...
    [11:51:20] scan: preview 3
    [11:51:20] Interlacing detected in preview frame 3
    [11:51:20] scan: preview 4
    Scanning title 1...
    [11:51:20] scan: preview 5
    [11:51:21] scan: preview 6
    [11:51:21] scan: preview 7
    [11:51:21] scan: preview 8
    Scanning title 1...
    [11:51:21] scan: preview 9
    [11:51:21] scan: preview 10
    [11:51:21] scan: 10 previews, 720x576, 25.000 fps, autocrop = 2/0/8/12, aspect 16:9, PAR 64:45
    [11:51:21] scan: title (0) job->width:704, job->height:400
    [11:51:21] stream: 74 good frames, 0 errors (0%)
    [11:51:21] thread 1d93100 exited ("scan")
    [11:51:21] thread 1d93100 joined ("scan")
    [11:51:21] libhb: scan thread found 1 valid title(s)
    + title 1:
    + stream: D:\xyz\000.MPG
    + duration: 00:28:12
    + size: 720x576, pixel aspect: 64/45, display aspect: 1.78, 25.000 fps
    + autocrop: 2/0/8/12
    + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:28:12
    + audio tracks:
    + 1, Unknown (MPEG2) (2.0 ch) (iso639-2: und)
    + subtitle tracks:
    [11:51:21] thread 1d93100 started ("work")
    [11:51:21] 1 job(s) to process
    [11:51:21] starting job
    [11:51:21] Auto Passthru: no codecs allowed
    [11:51:21] Auto Passthru: fallback is AC3 (ffmpeg)
    [11:51:21] Auto Passthru: passthru not possible for track 1, using fallback
    [11:51:21] sync: expecting 42317 video frames
    [11:51:21] job configuration:
    [11:51:21] * source
    [11:51:21] + D:\xyz\000.MPG
    [11:51:21] + title 1, chapter(s) 1 to 1
    [11:51:21] * destination
    [11:51:21] + C:\xyz.mp4
    [11:51:21] + container: MPEG-4 (.mp4 and .m4v)
    [11:51:21] * video track
    [11:51:21] + decoder: mpeg2
    [11:51:21] + bitrate 4300 kbps
    [11:51:21] + frame rate: same as source (around 25.000 fps)
    [11:51:21] + strict anamorphic
    [11:51:21] + storage dimensions: 720 * 576 -> 720 * 576, crop 0/0/0/0, mod 0
    [11:51:21] + pixel aspect ratio: 64 / 45
    [11:51:21] + display dimensions: 1024 * 576
    [11:51:21] + encoder: MPEG-2 (FFmpeg)
    [11:51:21] + bitrate: 700 kbps, pass: 0
    [11:51:21] * audio track 1
    [11:51:21] + decoder: Unknown (MPEG2) (2.0 ch) (track 1, id 0xc0)
    [11:51:21] + mixdown: Stereo
    [11:51:21] + encoder: AC3 (ffmpeg)
    [11:51:21] + bitrate: 224 kbps, samplerate: 48000 Hz
    [11:51:21] file is MPEG Program Stream
    [11:51:21] Probing 1 unknown stream
    [11:51:21] Probe: Found stream mpeg2video. stream id 0xe0-0x0
    [11:51:21] thread 1d952c0 started ("Reader")
    [11:51:21] thread 1d95358 started ("AudioSynchronization")
    [11:51:21] reader: first SCR 238 id 0xe0 DTS 28116
    [11:51:21] thread 26a08b0 started ("MPEG-2 decoder (libmpeg2)")
    [11:51:21] thread 1e43de8 started ("Renderer")
    [11:51:21] encavcodecInit: MPEG-2 encoder
    [11:51:21] encavcodec: encoding with stored aspect 64/45
    [11:51:21] thread 1e451d0 started ("FFMPEG encoder (libavcodec)")
    [11:51:21] thread 1e45488 started ("Audio decoder (libavcodec)")
    [mp2 @ 028F92A0] Header missing
    [11:51:21] mpeg2: "" (1) at frame 0 time 0
    [11:51:21] mpeg2 tag botch: pts 52774, tag pts 13288 buf 0x00000000
    [11:51:21] mpeg2 tag botch: pts 45630, tag pts 16860 buf 0x00000000
    [11:51:21] thread 256ff50 started ("AVCodec Audio encoder (libavcodec)")
    [11:51:21] thread 1e45390 started ("Video Synchronization")
    [11:51:21] muxmp4: track 0, chunk duration 14400
    [11:51:21] muxmp4: track 1, chunk duration 7680
    [11:51:21] thread 2a9fee8 started ("Muxer")
    [11:54:02] mpeg2 tag botch: pts 61828860, tag pts 61796344 buf 0x00000000
    [11:54:03] sync: video time didn't advance - dropped 4 frames (delta 120 ms, current 62077252, next 62080888, dur 3636)
    [11:58:47] reader: done. 1 scr changes
    [11:58:47] thread 1d952c0 exited ("Reader")
    [11:58:48] work: average encoding speed for job is 94.862167 fps
    [11:58:48] thread 1e451d0 exited ("FFMPEG encoder (libavcodec)")
    [11:58:48] thread 1e43de8 exited ("Renderer")
    [11:58:48] thread 1e45390 exited ("Video Synchronization")
    [11:58:48] thread 1e45390 joined ("Video Synchronization")
    [11:58:48] sync: got 42305 frames, 42317 expected
    [11:58:48] thread 1e45488 exited ("Audio decoder (libavcodec)")
    [11:58:48] thread 1d95358 exited ("AudioSynchronization")
    [11:58:48] thread 1d95358 joined ("AudioSynchronization")
    [11:58:48] thread 256ff50 exited ("AVCodec Audio encoder (libavcodec)")
    [11:58:48] thread 2a9fee8 exited ("Muxer")
    [11:58:48] thread 26a08b0 exited ("MPEG-2 decoder (libmpeg2)")
    [11:58:48] thread 26a08b0 joined ("MPEG-2 decoder (libmpeg2)")
    [11:58:48] mpeg2 done: 42309 frames
    [11:58:48] thread 1e43de8 joined ("Renderer")
    [11:58:48] render: lost time: 0 (0 frames)
    [11:58:48] render: gained time: 0 (0 frames) (0 not accounted for)
    [11:58:48] fifo_close: trashing 0 buffer(s)
    [11:58:48] fifo_close: trashing 0 buffer(s)
    [11:58:48] thread 1e451d0 joined ("FFMPEG encoder (libavcodec)")
    [11:58:48] encavcodec: closing libavcodec
    [11:58:48] thread 1e45488 joined ("Audio decoder (libavcodec)")
    [11:58:48] mp2-decoder done: 0 frames, 0 decoder errors, 0 drops
    [11:58:48] thread 256ff50 joined ("AVCodec Audio encoder (libavcodec)")
    [11:58:48] encavcodeca: closing libavcodec
    [11:58:48] thread 2a9fee8 joined ("Muxer")
    [11:59:06] mux: file size, 195740557 bytes
    [11:59:06] mux: track 0, 42305 frames, 147662575 bytes, 697.94 kbps, fifo 4096
    [11:59:06] mux: video bitrate error, -436425 bytes
    [11:59:06] mux: track 1, 52886 frames, 47385856 bytes, 223.97 kbps, fifo 4096
    [11:59:06] mux: overhead, 7.27 bytes per frame
    [11:59:06] thread 1d952c0 joined ("Reader")
    [11:59:06] stream: 617021 good frames, 0 errors (0%)
    [11:59:06] fifo_close: trashing 0 buffer(s)
    [11:59:06] fifo_close: trashing 0 buffer(s)
    [11:59:06] fifo_close: trashing 0 buffer(s)
    [11:59:06] fifo_close: trashing 0 buffer(s)
    [11:59:06] fifo_close: trashing 0 buffer(s)
    [11:59:06] fifo_close: trashing 0 buffer(s)
    [11:59:06] fifo_close: trashing 0 buffer(s)
    [11:59:06] fifo_close: trashing 0 buffer(s)
    [11:59:06] fifo_close: trashing 0 buffer(s)
    [11:59:06] Freed 32 buffers of size 1024
    [11:59:06] Freed 32 buffers of size 2048
    [11:59:06] Freed 32 buffers of size 4096
    [11:59:06] Freed 32 buffers of size 8192
    [11:59:06] Freed 32 buffers of size 16384
    [11:59:06] Freed 32 buffers of size 32768
    [11:59:06] Freed 17 buffers of size 65536
    [11:59:06] Freed 4 buffers of size 131072
    [11:59:06] Freed 2 buffers of size 262144
    [11:59:06] Freed 32 buffers of size 1048576
    [11:59:06] Allocated 39131136 bytes of buffers on this pass and Freed 37781504 bytes, 1349632 bytes leaked
    [11:59:06] thread 1d93100 exited ("work")
    [11:59:06] thread 1d93100 joined ("work")
    [11:59:06] libhb: work result = 0
    Encode done!
    [11:59:06] thread 1d925f8 exited ("libhb")
    [11:59:06] thread 1d925f8 joined ("libhb")
    HandBrake has exited.
    Here are the original recorded movies characteristics:

    General
    Complete name : D:\xyz\000.MPG
    Format : MPEG-PS
    File size : 924 MiB
    Duration : 28mn 12s
    Overall bit rate : 4 581 Kbps

    Video
    ID : 224 (0xE0)
    Format : MPEG Video
    Format version : Version 2
    Format profile : Main@Main
    Format settings, BVOP : Yes
    Format settings, Matrix : Custom
    Format settings, GOP : M=3, N=24
    Duration : 28mn 12s
    Bit rate : 4 300 Kbps
    Width : 720 pixels
    Height : 576 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Standard : PAL
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Top Field First
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 0.415
    Stream size : 867 MiB (94%)

    Audio
    ID : 192 (0xC0)
    Format : MPEG Audio
    Format version : Version 1
    Format profile : Layer 2
    Duration : 28mn 12s
    Bit rate mode : Constant
    Bit rate : 192 Kbps
    Channel(s) : 2 channels
    Sampling rate : 48.0 KHz
    Compression mode : Lossy
    Delay relative to video : -164ms
    Stream size : 38.7 MiB (4%)

    Menu

    Last edited by falco2000; 23rd Sep 2012 at 16:13.
    Falco2000, video newbie.
    Let's everyone help each other.
    Quote Quote  
  2. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Hi
    Looking at those HandBrake settings, this is the command I would try with FFmpeg.
    Code:
    ffmpeg -i "D:\xyz\000.MPG" -c:v mpeg2video -b:v 700k -c:a copy output.mpg
    Quote Quote  
  3. Originally Posted by bat999 View Post
    Hi
    Looking at those HandBrake settings, this is the command I would try with FFmpeg.
    Code:
    ffmpeg -i "D:\xyz\000.MPG" -c:v mpeg2video -b:v 700k -c:a copy output.mpg
    Oh thank you really bat999! The result is almost like the Handbrake one, just slightly "mosaic-ed", but not too much as it was in the FFmpegGUI output.

    Who knows what other parameter should be inserted in the FFmpeg command line to obtain the exact Handbrake result...

    Anyway... Three questions:

    1) The one in the above post: how can I match my receiver specifications to make my converted movie playable by it? I'm not talking about bitrate obviously, I don't think that value can be a problem. Maybe something linked with the container format, or the fact that the manual and the OnScreenDisplay of the receiver talks about "MPEG2-PS"? I don't know anything about that...

    2) How should I modify the string you gave me to also convert audio to MP3 Stereo 80Kbps?

    3) Is there a suggested guide for FFmpeg command line options, for newbies?

    Thanks a lot. I hope to be helpful to you in the future!
    Last edited by falco2000; 25th Sep 2012 at 20:23.
    Falco2000, video newbie.
    Let's everyone help each other.
    Quote Quote  
  4. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by falco2000 View Post
    1) The one in the above post: how can I match my receiver specifications to make my converted movie playable by it? I'm not talking about bitrate obviously, I don't think that value can be a problem. Maybe something linked with the container format, or the fact that the manual and the OnScreenDisplay of the receiver talks about "MPEG2-PS"? I don't know anything about that...
    1)Provide a sample file that plays OK and a link to the manual.


    Originally Posted by falco2000 View Post
    2) How should I modify the string you give me to also convert audio to MP3 Stereo 80Kbps?
    2)Like this:-
    Code:
    ffmpeg -i "D:\xyz\000.MPG" -c:v mpeg2video -b:v 700k -c:a libmp3lame -b:a 80k -ar 44100 -ac 2 output.mpg
    Originally Posted by falco2000 View Post
    3) Is there a suggested guide for FFmpeg command line options, for newbies?
    3)Official documentation is here ---> http://ffmpeg.org/ffmpeg.html
    Search www for newbie versions.
    Quote Quote  
  5. Originally Posted by bat999 View Post
    Originally Posted by falco2000 View Post
    1) The one in the above post: how can I match my receiver specifications to make my converted movie playable by it? I'm not talking about bitrate obviously, I don't think that value can be a problem. Maybe something linked with the container format, or the fact that the manual and the OnScreenDisplay of the receiver talks about "MPEG2-PS"? I don't know anything about that...
    1)Provide a sample file that plays OK and a link to the manual.
    Here's the link to all that concerns my receiver, including the manual and the technical data page (a tab of the product page):

    http://www.strong.tv/en/software-documentation?search=srt%205222 [edited and corrected link: now it works]

    I'll send you a sample file as soon as possible. In the meanwhile, did you already read all the infos given by the MediaInfo program about a movie recorded with my receiver? I posted them in the first message of this thread after having edited it (maybe you didn't notice it). Have a look to the second and last quote in that post (search for "Here are the original recorded movies characteristics"):

    https://forum.videohelp.com/threads/349434-How-to-convert-MPG2-to-lower-bitrate-with-FF...=1#post2188689

    Thanks again for all the other info, you're very kind!
    Last edited by falco2000; 25th Sep 2012 at 11:47.
    Falco2000, video newbie.
    Let's everyone help each other.
    Quote Quote  
  6. Originally Posted by bat999 View Post
    Originally Posted by falco2000 View Post
    1) The one in the above post: how can I match my receiver specifications to make my converted movie playable by it? I'm not talking about bitrate obviously, I don't think that value can be a problem. Maybe something linked with the container format, or the fact that the manual and the OnScreenDisplay of the receiver talks about "MPEG2-PS"? I don't know anything about that...
    1)Provide a sample file that plays OK and a link to the manual.
    Ok, I attached to this post a 14 seconds video recorded with my TV receiver ("000.mpg"). I already provided the link to the receiver manual in the last post.

    I'll wait for your reply, thanks!
    Image Attached Files
    Falco2000, video newbie.
    Let's everyone help each other.
    Quote Quote  
  7. I already provided the link to the receiver manual in the last post.
    A broken lint,.. the link should be
    Code:
    http://www.strong.tv/en/software-documentation?search=srt%205222
    instead of
    Code:
    http://www.strong.tv/en/software-documentation?search=srt-5222
    Quote Quote  
  8. You are right, I corrected my linked in the post above, thanks
    Last edited by falco2000; 25th Sep 2012 at 11:55.
    Falco2000, video newbie.
    Let's everyone help each other.
    Quote Quote  
  9. Doesn't work here with Chrome/Safari/Firefox/IE/Conqueror -> probably some cache or auto completion magic on your end,... because the entry in the search box needs to be 'srt 5222' and not 'srt-5222'
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!