VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. hi everyone,
    i'm not an ffmpeg expert and i'm not english so i apolgy for my poor language
    i'm trying to convert an mp4 file into mpeg2.
    i used this:
    ffmpeg '-i' '/Users/nene/Desktop/test_hd.mp4' '-y' '-deinterlace' '-target' 'pal-dvd' '-aspect' '16:9' '-pass' '1' '-passlogfile' '/tmp/SeZU0U' '-async' '1' '-vsync' '0' '-acodec' 'mp2' '-ab' '224' '-r' '25' '/Users/nene/Desktop/test.mpg'

    everything seems to be ok but my qucktime doesn't detect the audio.
    i want to convert it into this audio codec which works:

    - Format: Mpeg-1 layer 2 (mp2)
    - Size: 1016.07 MB (4%)
    - FourCC: 0x50
    - Number(s) and language(s): 192 (0xC0): Undefined
    - Profile: Layer 2
    - Bitrate: 224 Kbps
    - Bitrate mode: Constant
    - Rate: 48.0 KHz
    - Channel(s): 2 (stereo)

    where is the error?
    please help me
    Quote Quote  
  2. where is the error?
    No clue, since you did not post any infos about the input that you feed to ffmpeg (i.e. a mediainfo analysis) or the output your command line produces,..

    it might help if you specify the audio sampling rate (i.e. -ar 48000), since Quicktime is a really picky piece of software,...
    if you want a constant audio bit-rate you also need to specify '-minrate' and '-maxrate' otherwise the output will not be cbr.

    Cu Selur

    Ps.: ffmpegs deinterlacer really sucks,.. better use '-vf yadif' it's still not as good as some other deinterlacers that are out there but a lot better than ffmpegs -deinterlace)
    Quote Quote  
  3. Thanks Selur
    this the input mediainfo:

    ffmpeg version git-2011-09-29-ecf31a6, Copyright (c) 2000-2011 the FFmpeg developers
    built on Sep 29 2011 13:38:37 with clang 2.1 (tags/Apple/clang-163.7.1)
    configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --cc=/usr/bin/clang --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid
    libavutil 51. 18. 0 / 51. 18. 0
    libavcodec 53. 18. 0 / 53. 18. 0
    libavformat 53. 13. 0 / 53. 13. 0
    libavdevice 53. 4. 0 / 53. 4. 0
    libavfilter 2. 43. 6 / 2. 43. 6
    libswscale 2. 1. 0 / 2. 1. 0
    libpostproc 51. 2. 0 / 51. 2. 0
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/paolo/Desktop/Zoncolan_final.mp4':
    Metadata:
    major_brand : mp42
    minor_version : 19529845
    compatible_brands: mp42isom
    creation_time : 2012-03-21 14:10:11
    Duration: 00:03:55.32, start: 0.000000, bitrate: 11019 kb/s
    Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 256 kb/s
    Metadata:
    creation_time : 2012-03-21 14:10:11
    Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 10758 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
    creation_time : 2012-03-21 14:10:11
    Quote Quote  
  4. That's not the output of mediainfo but the output of ffmpeg regarding the input,.. + what does it say about the output?
    Quote Quote  
  5. do you mean this?
    input:

    Format : MPEG-4
    Format profile : Base Media / Version 2
    Codec ID : mp42
    File size : 309 MiB
    Duration : 3mn 55s
    Overall bit rate mode : Variable
    Overall bit rate : 11.0 Mbps
    Encoded date : UTC 2012-03-21 14:10:11
    Tagged date : UTC 2012-03-21 14:10:11

    Video
    ID : 2
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.0
    Format settings, CABAC : Yes
    Format settings, ReFrames : 2 frames
    Muxing mode : Container profile=Baseline@4.0
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 3mn 55s
    Bit rate mode : Variable
    Bit rate : 10.8 Mbps
    Maximum bit rate : 22.0 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.208
    Stream size : 302 MiB (98%)
    Language : English
    Encoded date : UTC 2012-03-21 14:10:11
    Tagged date : UTC 2012-03-21 14:10:11

    Audio
    ID : 1
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : 40
    Duration : 3mn 55s
    Bit rate mode : Constant
    Bit rate : 256 Kbps
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Compression mode : Lossy
    Stream size : 7.18 MiB (2%)
    Language : English
    Encoded date : UTC 2012-03-21 14:10:11
    Tagged date : UTC 2012-03-21 14:10:11

    output:
    Complete name : /Users/video/Public/test.mpg
    Format : MPEG-PS
    File size : 46.8 MiB
    Duration : 1mn 0s
    Overall bit rate mode : Variable
    Overall bit rate : 6 534 Kbps

    Video
    ID : 224 (0xE0)
    Format : MPEG Video
    Format version : Version 2
    Format profile : Main@Main
    Format settings, BVOP : No
    Format settings, Matrix : Default
    Format settings, GOP : M=1, N=15
    Duration : 1mn 0s
    Bit rate mode : Variable
    Bit rate : 5 956 Kbps
    Maximum bit rate : 9 000 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 : Progressive
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 0.575
    Stream size : 42.6 MiB (91%)

    Audio
    ID : 189 (0xBD)-128 (0x80)
    Format : AC-3
    Format/Info : Audio Coding 3
    Mode extension : CM (complete main)
    Muxing mode : DVD-Video
    Duration : 59s 840ms
    Bit rate mode : Constant
    Bit rate : 448 Kbps
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Compression mode : Lossy
    Stream size : 3.20 MiB (7%)
    Quote Quote  
  6. yes that would be a mediainfo analysis output form mediainfo for the input,... but you still did not post the same info for the output of your ffmpeg call,... (btw. your ffmpeg version is quite old, you might want to update it)

    (+ you also do not want to deinterlace since you input is not interlaced - deinterlacing progressive content will result in arefacts)
    Quote Quote  
  7. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by ilpilo View Post
    Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 256 kb/s
    Metadata:
    creation_time : 2012-03-21 14:10:11
    Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR
    The video and audio channels are in an unusual order - usually the video stream has a lower ID value than the audio. This can probably be fixed by using ffmpeg's -map option to tell it which stream is which.

    I'll need to do a few tests before I suggest a set of command line parameters.
    Quote Quote  
  8. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    I don't know why you're using quotes around every parameter. It shouldn't be necessary with MacOS.

    Try this:
    Code:
    ffmpeg -i '/Users/nene/Desktop/test_hd.mp4' -map 0:1 -map 0:0 -y -target pal-dvd -aspect 16:9 -pass 1 -passlogfile '/tmp/SeZU0U' -async 1 -vsync 0 -acodec mp2 -ab 224 -r 25 /Users/nene/Desktop/test.mpg
    **the -map parameters will cause problems for other source files - so only use them when necessary.

    The -map syntax is quite confusing. If you want to know more about how it works, just ask.

    --
    Selur is right about not deinterlacing. Unfortunately, ffmpeg doesn't automatically preserve interlacing when converting from high definition to standard definition.

    I will try and find out how to do this properly.

    EDIT: I've just noticed the HD source video (test_hd.mp4) is progressive according to mediainfo. So in this instance you shouldn't need to deinterlace at all.
    Last edited by intracube; 23rd Mar 2012 at 11:43.
    Quote Quote  
  9. I've just noticed the HD source video (test_hd.mp4) is progressive according to mediainfo. So in this instance you shouldn't need to deinterlace at all.
    that's what I wrote

    btw. I would also add a -sameq there somewhere if no datarate is specified,...
    Quote Quote  
  10. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by Selur View Post
    I've just noticed the HD source video (test_hd.mp4) is progressive according to mediainfo. So in this instance you shouldn't need to deinterlace at all.
    that's what I wrote
    D'oh!

    Too much coffee, not enough sleep
    Quote Quote  
  11. thanks everyone.
    back to work again!
    intracube, i put the code
    ffmpeg -i '/Users/nene/Desktop/test_hd.mp4' -map 0:1 -map 0:0 -y -target pal-dvd -aspect 16:9 -pass 1 -passlogfile '/tmp/SeZU0U' -async 1 -vsync 0 -acodec mp2 -ab 224 -r 25 /Users/nene/Desktop/test.mpg

    but it generates an empty file
    also it shows me a warning:
    WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
    Output #0, dvd, to '/Users/video/desktop/test.mpeg':
    Stream #0.0: Video: mpeg2video, yuv420p, 720x576 [PAR 64:45 DAR 16:9], q=2-31, pass 1, 6000 kb/s, 90k tbn, 25 tbc
    Stream #0.1: Audio: mp2, 48000 Hz, stereo, s16, 0 kb/s
    Codec type mismatch for mapping #0.1 -> #0.0

    i can't uderstand the error, i try to change the -ab parameter but didn't work
    Last edited by ilpilo; 28th Mar 2012 at 10:52.
    Quote Quote  
  12. i can't uderstand the error, i try to change the -ab parameter but didn't work
    instead of -ab 224 you should use -ab 224000
    Quote Quote  
  13. thanks
    i'll try as soon as possible
    Quote Quote  
  14. thanks Selur,
    but still don't work.
    i read somewhere this error occurs because the inversion of the audio and video channels:
    Codec type mismatch for mapping #0.1 -> #0.0
    if it's so, how can i invert the channels?
    Quote Quote  
  15. I wouldn't change the mapping at all, since afaik there's no standard that specifies, that the first stream needs to be the video stream,.. personally I would use something like:
    Code:
    ffmpeg -i "/Users/nene/Desktop/test_hd.mp4" -y -target pal-dvd -aspect 16:9 -pass 1 -sameq -acodec mp2 -ab 224000 -r 25 "/Users/nene/Desktop/test.mpg"
    Quote Quote  
  16. Thanks Selur,
    you are a Guru.
    Now everything works smoothly
    Quote Quote  



Similar Threads

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