VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Page 2 of 7
FirstFirst 1 2 3 4 ... LastLast
Results 31 to 60 of 181
Thread
  1. Note - If you're doing it as a batch file, instead of cmd directly, use 2 "%%" instead of 1 "%"

    Code:
    for %%a in ("*.mp4") do ffmpeg -i "%%a" -c:a copy "%%~na.aac"
    pause
    or

    Code:
    for %%a in ("*.mp4") do ffmpeg -i "%%a" -c:a copy -absf aac_adtstoasc "%%~na.m4a"
    pause

    But again, that' s just for MP4's with AAC audio ONLY . You can't use wildcards *.* for the output file extension
    Quote Quote  
  2. Member KneeGrow's Avatar
    Join Date
    Aug 2007
    Location
    "Not Taw City, but T...!"
    Search Comp PM
    So, this was the winner

    PHP Code:
    FOR %%i IN ("*.mp4") DO (
    echo %%
    i
    ffmpeg 
    -%%-vn -acodec copy "newfiles\%%i.aac"


    sadly, the resulting filenames are formatted like this:

    pier0.mp4.m4a
    waip0.mp4.m4a


    sourcefiles are
    pier0.mp4
    waip0.mp4


    can i add a RENAME command to fix that?
    can anyone tell me how exactly to do that?

    would a FOR /L loop be better?
    Looking for the subtitles of: Hk tt0997023 - Lime tt0269480 - Desideria tt0081724 - La cl sur la porte tt0077348 (tt=iMDb.com)
    Quote Quote  
  3. Member KneeGrow's Avatar
    Join Date
    Aug 2007
    Location
    "Not Taw City, but T...!"
    Search Comp PM
    what does this do?
    -c:a

    and this?
    copy -absf aac_adtstoasc

    and the~na in
    "%%~na.m4a"

    thanks for replying.


    EDIT:
    your solution completely defeats the purpose of LOSSLESS ripping!!!! it takes hours and its a huge file
    lossless aka without loss of quality and is FAST!!!
    Last edited by KneeGrow; 13th Aug 2014 at 18:32.
    Looking for the subtitles of: Hk tt0997023 - Lime tt0269480 - Desideria tt0081724 - La cl sur la porte tt0077348 (tt=iMDb.com)
    Quote Quote  
  4. Replace "newfiles\%%i.aac" with "newfiles\%%~ni.aac""
    Quote Quote  
  5. Member KneeGrow's Avatar
    Join Date
    Aug 2007
    Location
    "Not Taw City, but T...!"
    Search Comp PM
    Originally Posted by jagabo View Post
    Replace "newfiles\%%i.aac" with "newfiles\%%~ni.aac""
    ON THE NAIL! you boys are da bomb, thanks.

    Code:
    FOR %%i IN ("*.mp4") DO (
    echo %%i
    ffmpeg -i %%i -vn -acodec copy "newfiles\%%~ni.m4a"
    )
    
    REN  newfiles\?.mp4.m4a  ?.m4a
    REN  newfiles\??.mp4.m4a  ??.m4a
    REN  newfiles\???.mp4.m4a  ???.m4a
    REN  newfiles\????.mp4.m4a  ????.m4a
    REN  newfiles\?????.mp4.m4a  ?????.m4a
    REN  newfiles\??????.mp4.m4a  ??????.m4a
    this works too, but is less elegant.


    If you happen to know a decent explanaton of ffmpeg commands, as in, for dummies, that would be great.

    cos I've seen the one baldrick gave and it's not all that user friendly.
    Last edited by KneeGrow; 14th Aug 2014 at 06:55. Reason: procrastination
    Looking for the subtitles of: Hk tt0997023 - Lime tt0269480 - Desideria tt0081724 - La cl sur la porte tt0077348 (tt=iMDb.com)
    Quote Quote  
  6. Member KneeGrow's Avatar
    Join Date
    Aug 2007
    Location
    "Not Taw City, but T...!"
    Search Comp PM
    Originally Posted by poisondeathray View Post
    But earlier you asked for ANY file - which implies all file types , under every situation - which isn't possible
    This seems inconsistent with:
    Originally Posted by poisondeathray View Post
    Lossless can involve transcoding: for example, demuxing is lossless (stream copy) .
    if it's not possible, then how does demuxing work? that produces the original streams, as-is, or as-was.

    perhaps I was saying lossless when I should've said stream copy.

    Forgive me I was imprecise, but in the grand scheme of things, on average, by the by and largely, all these concepts (demuxing, lossless, stream copy, extracting only audio) seem to boil down to the same thing for me, or even ARE the same.

    "Or if you want to remove adts header"
    Why would I wanna do that? the relevance of that remark HERE is unclear to me. and why did you add this "-c:a copy -absf aac_adtstoasc" ???
    that was the exact opposite of what I asked.

    Look, if it can't be done, it can't, it seems stupid to me because, inconsistencies, but hey.

    Next question:
    can ffmpeg detect the type of audio and use that information as input elsewhere?
    Last edited by KneeGrow; 14th Aug 2014 at 06:21.
    Looking for the subtitles of: Hk tt0997023 - Lime tt0269480 - Desideria tt0081724 - La cl sur la porte tt0077348 (tt=iMDb.com)
    Quote Quote  
  7. Originally Posted by KneeGrow View Post
    perhaps I was saying lossless when I should've said stream copy.

    Forgive me I was imprecise, but in the grand scheme of things, on average, by the by and largely, all these concepts (demuxing, lossless, stream copy, extracting only audio) seem to boil down to the same thing for me, or even ARE the same.
    You're kind of making up your own definitions here based on a specific, limited subset of the actual meanings.

    Originally Posted by KneeGrow View Post
    Next question:
    can ffmpeg detect the type of audio and use that information as input elsewhere?
    It can through scripting, and that's where it gets more complicated than a simple batch command.

    And you're probably into a territory where you should start a new thread.
    Quote Quote  
  8. Beware: muxing with an AAC extension doesn't necessarily mean the audio is AAC. I ran the batch command on an MP4 file with AC3 audio and it produced a file with .AAC as the extension. The audio was still AC3, of course.
    Quote Quote  
  9. Originally Posted by KneeGrow View Post
    Next question:
    can ffmpeg detect the type of audio and use that information as input elsewhere?
    You can use ffprobe to get information about the file, parse it, then ffmpeg to demux the audio appropriately.
    Quote Quote  
  10. Member KneeGrow's Avatar
    Join Date
    Aug 2007
    Location
    "Not Taw City, but T...!"
    Search Comp PM
    Originally Posted by smrpix View Post
    You're kind of making up your own definitions here based on a specific, limited subset of the actual meanings.
    You're not addressing the issue here. Instead you're dissing a person.
    It'd be really nice if you STOPPED doing that, and started to answer the question.
    otherwise stay out of it, go do other stuff.
    Looking for the subtitles of: Hk tt0997023 - Lime tt0269480 - Desideria tt0081724 - La cl sur la porte tt0077348 (tt=iMDb.com)
    Quote Quote  
  11. Member KneeGrow's Avatar
    Join Date
    Aug 2007
    Location
    "Not Taw City, but T...!"
    Search Comp PM
    Originally Posted by jagabo View Post
    Beware: muxing with an AAC extension doesn't necessarily mean the audio is AAC. I ran the batch command on an MP4 file with AC3 audio and it produced a file with .AAC as the extension. The audio was still AC3, of course.
    What surprises me is that many programs can demux any stream, but that ffmpeg apparently can't?

    It seems as if it can not detect whatever type of audio is in the mp4, and then save it as that.

    so, for example if I had an mp4 with an ac3 audio, it should be able to save it as that. telling it what to save it as, seems superfluous for such an advance piece of software.

    Why can't Fffmpeg do this?

    You can use ffprobe to get information about the file, parse it, then ffmpeg to demux the audio appropriately.
    can you point me in the right direction on how to do that?
    Looking for the subtitles of: Hk tt0997023 - Lime tt0269480 - Desideria tt0081724 - La cl sur la porte tt0077348 (tt=iMDb.com)
    Quote Quote  
  12. Originally Posted by KneeGrow View Post
    You're not addressing the issue here. Instead you're dissing a person.
    It'd be really nice if you STOPPED doing that, and started to answer the question.
    otherwise stay out of it, go do other stuff.
    You're mistaken. Please re-read my post and the ones that follow. Best of luck.
    Quote Quote  
  13. I noticed when I was trying to use a batch subtitles were getting dropped. I found a solution:
    Code:
    FOR %%a IN ("*.*") DO ffmpeg -i "%%a" -acodec libvo_aacenc -b:a 112k -vcodec copy -scodec copy "%%a.mp4"
    The problem is now that if a file doesn't have subs it won't process it. Is there a way to specify an if-then logic? I looked through some docs but there wasn't any mention and I wanted to see if I missed something.
    Quote Quote  
  14. Not sure how to do that, because you would need to parse with ffprobe to determine if subs exist
    Quote Quote  
  15. I have made a little javascript for ffmpeg helper, other developer can fork or update this script for all users,
    this is the idea with video
    http://grabanymedia.altervista.org/download-fragments-video-join-ffmpeg/

    If you want check only the script you can find it here
    http://jsfiddle.net/kjx2Lykg/2/

    I hope this help and excuse me for my bad english
    Quote Quote  
  16. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Hello. 2 things.

    With Zerano's build is it
    -c:v h264
    or
    -c:v libx264
    I'd thought it was the former. Is there any difference ?

    I had read somewhere (posts last year) re
    -c:a libvo_aacenc
    that aac encoding quality was not all that great. Is this a new improved version or something ?

    (also, nowadays, don't forget the flags -movflags +faststart to make it webby friendly by placing the MOOV atom at the front of the mp4 file)
    Last edited by hydra3333; 16th Dec 2014 at 20:52.
    Quote Quote  
  17. Originally Posted by hydra3333 View Post

    With Zerano's build is it
    -c:v h264
    or
    -c:v libx264
    I'd thought it was the former. Is there any difference ?
    No difference. There is only 1 AVC encoder


    I had read somewhere (posts last year) re
    -c:a libvo_aacenc
    that aac encoding quality was not all that great. Is this a new improved version or something ?
    libvo_aacenc is still bad.

    You need to use libfdk_aac for higher quality, but they are not compiled with zeranoe builds (licensing issues), you have to compile yourself
    Quote Quote  
  18. I would like to know how to convert an FLV video to an mp4 video without converting the audio portion to AAC, i would much rather have the audio in mp2 or mp3 audio.
    I have found out to do the conversion from FLV to MP4 but it converts the audio to AAC and that's not what i want.
    Quote Quote  
  19. Originally Posted by SouthGaBoy View Post
    I would like to know how to convert an FLV video to an mp4 video without converting the audio portion to AAC, i would much rather have the audio in mp2 or mp3 audio.
    I have found out to do the conversion from FLV to MP4 but it converts the audio to AAC and that's not what i want.
    -c:a libmp3lame for mp3
    Quote Quote  
  20. Originally Posted by poisondeathray View Post
    Originally Posted by SouthGaBoy View Post
    I would like to know how to convert an FLV video to an mp4 video without converting the audio portion to AAC, i would much rather have the audio in mp2 or mp3 audio.
    I have found out to do the conversion from FLV to MP4 but it converts the audio to AAC and that's not what i want.
    -c:a libmp3lame for mp3
    So this is the command I found and used to convert to MP4, ffmpeg -i filename.flv -ar 22050 filename.mp4

    How would i use -c:a libmp3lame for mp3 ? Would i just replace the -ar 22050 and that would be it?
    Quote Quote  
  21. Originally Posted by SouthGaBoy View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by SouthGaBoy View Post
    I would like to know how to convert an FLV video to an mp4 video without converting the audio portion to AAC, i would much rather have the audio in mp2 or mp3 audio.
    I have found out to do the conversion from FLV to MP4 but it converts the audio to AAC and that's not what i want.
    -c:a libmp3lame for mp3
    So this is the command I found and used to convert to MP4, ffmpeg -i filename.flv -ar 22050 filename.mp4

    How would i use -c:a libmp3lame for mp3 ? Would i just replace the -ar 22050 and that would be it?
    -ar is the audio sampling rate e.g. 22.05Khz . If you wanted to upsample to 44.1 or 48Khz you could change it

    -c:a stands for audio codec, so in this case libmp3lame would use lame mp3 to encode mp3

    What kind of video did you want ? Not all compression formats used in FLV are compatible in MP4 container, so you might not be able to "copy" the video (you might have to re-encode it). Here is an example of re-encoding the video. If the video used a compatible compression you could just copy it with -c:v copy

    ffmpeg -i input.flv -c:v libx264 -c:a libmp3lame -b:a 128k output.mp4

    -b:a is the audio bitrate; in this example 128k is 128kbps

    -c:v is the video codec. In this example libx264 uses x264 to encode
    Quote Quote  
  22. Originally Posted by poisondeathray View Post
    Originally Posted by SouthGaBoy View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by SouthGaBoy View Post
    I would like to know how to convert an FLV video to an mp4 video without converting the audio portion to AAC, i would much rather have the audio in mp2 or mp3 audio.
    I have found out to do the conversion from FLV to MP4 but it converts the audio to AAC and that's not what i want.
    -c:a libmp3lame for mp3
    So this is the command I found and used to convert to MP4, ffmpeg -i filename.flv -ar 22050 filename.mp4

    How would i use -c:a libmp3lame for mp3 ? Would i just replace the -ar 22050 and that would be it?
    -ar is the audio sampling rate e.g. 22.05Khz . If you wanted to upsample to 44.1 or 48Khz you could change it

    -c:a stands for audio codec, so in this case libmp3lame would use lame mp3 to encode mp3

    What kind of video did you want ? Not all compression formats used in FLV are compatible in MP4 container, so you might not be able to "copy" the video (you might have to re-encode it). Here is an example of re-encoding the video. If the video used a compatible compression you could just copy it with -c:v copy

    ffmpeg -i input.flv -c:v libx264 -c:a libmp3lame -b:a 128k output.mp4

    -b:a is the audio bitrate; in this example 128k is 128kbps

    -c:v is the video codec. In this example libx264 uses x264 to encode
    Well first off the flv uses x264 so i think i can copy the video but i wanted like mp2 or mp3 audio so i'll have a play around with these options. thanks

    EDIT: ok I tried ffmpeg -i input.flv -c:v libx264 -c:a libmp3lame -b:a 128k output.mp4 but it just gave a bunch of crap that i dont understand. Is there a way i can make it so the output is logged in like a TXT file so i can upload it here for further inspection?

    I dont know if i mentioned this, the FLV is using x264 codec for video and nellymoser codec for audio if this helps any.
    Last edited by SouthGaBoy; 28th Dec 2014 at 20:26.
    Quote Quote  
  23. How to modify the script to mux out all subtitles in all .mkv videos in a folder?
    Quote Quote  
  24. Member
    Join Date
    May 2015
    Location
    Dublin, Ireland
    Search PM
    Apologies for digging up an old thread. i will start a new one if needs be.

    These batches run great, but I've started adding them to the windows "send to" right click menu. Your batches work great when processing all files in a directory, but what if I want to just run an ffmpeg process on a single file, the one I right clicked on?

    As an aside, my goal is an easier way to make framemd5 outputs.

    Thanks!
    Quote Quote  
  25. Originally Posted by kieranjol View Post
    what if I want to just run an ffmpeg process on a single file, the one I right clicked on?
    Then remove the FOR loop and change the filename spec from %%A to %1. Something like:

    Code:
    ffmpeg -i %1 -vcodec copy -acodec copy "%~dpn1.mkv"
    Quote Quote  
  26. Member
    Join Date
    May 2015
    Location
    Dublin, Ireland
    Search PM
    Originally Posted by jagabo View Post
    Originally Posted by kieranjol View Post
    what if I want to just run an ffmpeg process on a single file, the one I right clicked on?
    Then remove the FOR loop and change the filename spec from %%A to %1. Something like:

    Code:
    ffmpeg -i %1 -vcodec copy -acodec copy "%~dpn1.mkv"
    Perfect! Here's what I also got to work, has a pointless for loop:
    Code:
    for %%a in (%1) do fmpeg.exe -i %%a -f framemd5 "%%~na.framemd5"
    pause
    Your drive/path/name variable is nice as well.
    Thank you very much.
    Quote Quote  
  27. The command line you came up with says "for all files that match (the file you selected) do...." Since only one file has that name only that one file is processed. If there are a lot of files in the folder it might take a little longer to process since it has to evaluate the name of each file.
    Quote Quote  
  28. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Originally Posted by m0ck View Post
    How to modify the script to mux out all subtitles in all .mkv videos in a folder?
    Use a batch demuxer like MKVcleaver.

    Or do you want to remove the subtitles from the mkv?
    Quote Quote  
  29. Hello

    How to Adding video into the picture with ffmpeg?

    Example:
    Image Attached Thumbnails Click image for larger version

Name:	example.png
Views:	196
Size:	731.3 KB
ID:	33326  

    Quote Quote  
  30. Member
    Join Date
    Aug 2015
    Location
    England
    Search PM
    Fantastic Tutorial really helped
    Quote Quote  



Similar Threads