Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix excessive transcoding time issue #66

Merged
merged 2 commits into from
Nov 25, 2019
Merged

Fix excessive transcoding time issue #66

merged 2 commits into from
Nov 25, 2019

Conversation

jitingcn
Copy link

add -vn to parameter in order to bypass video during transcoding to avoid excessive transcoding time

add -vn to parameter in order to bypass video during transcoding to avoid excessive transcoding time
@jitingcn
Copy link
Author

Before patch
Convert to "tmpo7qdsgsv.flac" for API.
ffmpeg.exe -hide_banner -y -i ".\Rabi-Ribi.mp4" -ac 1 -ar 44100 "tmpo7qdsgsv.flac"
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\Rabi-Ribi10.14.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2019-11-15T13:10:44.000000Z
  Duration: 00:12:25.88, start: 0.000000, bitrate: 3191 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 2998 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2019-11-15T13:10:44.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2019-11-15T13:10:44.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> png (native))
  Stream #0:1 -> #0:1 (aac (native) -> flac (native))
Press [q] to stop, [?] for help
[flac @ 000001ac6d8ad2c0] encoding as 24 bits-per-sample
[flac @ 000001ac6d8b00c0] Video stream #0 is not an attached picture. Ignoring
Output #0, flac, to 'tmpo7qdsgsv.flac':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    encoder         : Lavf58.29.100
    Stream #0:0(eng): Video: png, rgb24(progressive), 1280x720, q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc (default)
    Metadata:
      creation_time   : 2019-11-15T13:10:44.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : Lavc58.54.100 png
    Stream #0:1(eng): Audio: flac, 44100 Hz, mono, s32 (24 bit), 128 kb/s (default)
    Metadata:
      creation_time   : 2019-11-15T13:10:44.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
      encoder         : Lavc58.54.100 flac
frame= 5322 fps= 18 q=-0.0 Lsize=   14629kB time=00:02:57.84 bitrate= 673.9kbits/s speed=0.593x
video:4670046kB audio:14621kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Interrupted, speed=0.593x that is too sloooooow

After patch
Convert to "tmp2l6eluzc.flac" for API.
ffmpeg -hide_banner -y -i .\Rabi-Ribi.mp4 -vn -ac 1 -ar 44100 tmp2l6eluzc.flac
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\Rabi-Ribi.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2019-11-15T13:10:44.000000Z
  Duration: 00:12:25.88, start: 0.000000, bitrate: 3191 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 2998 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2019-11-15T13:10:44.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2019-11-15T13:10:44.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
Stream mapping:
  Stream #0:1 -> #0:0 (aac (native) -> flac (native))
Press [q] to stop, [?] for help
[flac @ 00000242cc8c0500] encoding as 24 bits-per-sample
Output #0, flac, to 'tmp2l6eluzc.flac':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    encoder         : Lavf58.29.100
    Stream #0:0(eng): Audio: flac, 44100 Hz, mono, s32 (24 bit), 128 kb/s (default)
    Metadata:
      creation_time   : 2019-11-15T13:10:44.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
      encoder         : Lavc58.54.100 flac
size=   58686kB time=00:12:25.87 bitrate= 644.5kbits/s speed= 373x
video:0kB audio:58678kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.013908%

speed= 373x
Note the Stream mapping now only mapping the audio:
Stream #0:1 -> #0:0 (aac (native) -> flac (native))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants