« first day (3594 days earlier)      last day (1429 days later) » 

12:44 AM
Hey guys
Anybody there?
Basically I've been running into this problem with Windows Powershell
I'm trying to do this ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "01 - intro.m3u8" -c copy "01 - intro.mp4"
But I want to automate it (i.e. go through every .m3u8 file in the folder and convert it to mp4)
I've tried this: for %f in (*.m3u8) do ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i %f -c: copy %~nf.mp4
But it's not working :/ - it says Missing opening '(' after keyword 'for'.
Can anyone please help? Thanks :)
 
My crystal ball says this is because you haven't installed ffmpeg.
 
I have installed it and it works
The first command works
When I try to automate it, it doesn't
 
for (%f in *.m3u8).....
probably.
 
@MichaelFrank Thanks but when I try it I get this:
my code:
for (%f in *.m3u8) do ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i %f -c: copy %~nf.mp4
Error:
At line:1 char:19
+ for (%f in *.m3u8) do ffmpeg -protocol_whitelist file,http,https,tcp, ...
+ ~
Missing statement body in for loop.
At line:1 char:22
+ for (%f in *.m3u8) do ffmpeg -protocol_whitelist file,http,https,tcp, ...
+ ~
Missing statement body in do loop.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingLoopStatement
 
Check your syntax against what they have there.
 
12:53 AM
@MichaelFrank I've tried this:
for (%f in *.m3u8; do ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i %f -c: copy %~nf.mp4)
Because I can't tell if there's any init
but I get:
At line:1 char:105
+ ... col_whitelist file,http,https,tcp,tls,crypto -i %f -c: copy %~nf.mp4)
+ ~
Missing statement body in for loop.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingLoopStatement
 
ss64.com/ps/foreach.html might be better.
But ultimately, your syntax is letting you down.
What you want is foreach ($thing in $collection) {do something to those things}
 
Tried this and it doesn't like it haha
foreach (%f in *.m3u8) { do ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i %f -c: copy %~nf.mp4}
At line:1 char:10
+ foreach (%f in *.m3u8) { do ffmpeg -protocol_whitelist file,http,http ...
+ ~
Missing variable name after foreach.
At line:1 char:22
+ foreach (%f in *.m3u8) { do ffmpeg -protocol_whitelist file,http,http ...
+ ~
Unexpected token ')' in expression or statement.
At line:1 char:28
+ foreach (%f in *.m3u8) { do ffmpeg -protocol_whitelist file,http,http ...
+ ~
Missing statement body in do loop.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
 
You don't need the do
 
got rid of one error haha
 
Also, if you are using powershell, variables are designated with $, like $f
 
12:57 AM
Yes seems a bit better: foreach ($f in *.m3u8) { ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i $f -c: copy $~nf.mp4}
*.m3u8 : The term '*.m3u8' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:16
+ foreach ($f in *.m3u8) { ffmpeg -protocol_whitelist file,http,https,t ...
+                ~~~~~~
    + CategoryInfo          : ObjectNotFound: (*.m3u8:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
When you paste your error, can you click the format button ----> ?
 
That's weird because there's defo m3u8 files in the folder
 
*.m3u8 doesn't mean anything to PowerShell. It's not a 1:1 CMD replacement, or whatever they used in the example you got your code snippet from.
 
sigghh
stackoverflow.com/a/28805554/2835880 this person seems to be able to use *.xml fine?
 
What you probably want, is something like this:

foreach ($f in gci C:\path\to\files -filter *.m3u8) {ffmpeg stuff}
Yep, they are using Powershell commands though.
 
1:06 AM
Thank the lords the program works haha but saves the file as $~nf.mp4 and tries to overwrite it for every file
Would it be $f.Basename?
The code is currently:
 
Could be
 
foreach ($f in gci "filepath" -filter *.m3u8) {ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i $f -c: copy $~nf.mp4}
 
If you need to reference a variable attribute, use $($f.BaseName)
 
How would you join that to the .mp4 file tho?
 
It's probably this part of your command: -c: copy $($f.BaseName).mp4
 
1:10 AM
It's not liking it
foreach ($f in gci "filepath" -filter *.m3u8) {ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i $f -c: copy $($f.BaseName).mp4}
"At least one output file must be specified"
Bloody thing haha
 
I'm not familiar with ffmpeg formatting tbh
 
But isn't this powershell formatting?
 
Yes, but inserting the powershell variable into the ffmpeg parameter string is what's tripping this us.
Try with "copy "$($.BaseName).mp4"
 
lol now it's not even recognising that I've entered anything
If I remove the quotation marks it says:
$.BaseName : The term '$.BaseName' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:208
+ ... list file,http,https,tcp,tls,crypto -i $f -c: copy $($.BaseName).mp4}
+                                                          ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: ($.BaseName:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
I tried messing with the -i command
foreach ($f in gci "FILEPATH" -filter *.m3u8) {ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i $f -c: copy -i .mp4}
Now I get "01 - class-trailer.m3u8: No such file or directory"
When it's clearly automatically inputted the file
crying
 
Getting there
foreach ($f in gci "FILEPATH" -filter *.m3u8) {ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i $f -c: copy -i "$($f.baseName).mp4"}
Try that one.
 
1:22 AM
For the love all that is good and holy
eek it recognises the file
and ffmpeg kind of processes it
But then it says "01 - class-trailer.mp4: No such file or directory"
 
Is that all it says?
 
Yh
It doesn't like understand that we're trying to output it to .mp4
We're close tho
 
Okay, so it's probably complaining that you're not telling it where to put the file.
You could try something like "C:\save\location\$($f.baseName).mp4"
 
Would that be before the $ sign?
like "FILEPATH" + "$($f.baseName).mp4"
or "FILEPATH\$($f.baseName).mp4"
 
Yea, the second one.
 
1:26 AM
It still says ""FILEPATH\01 - class-trailer.mp4: No such file or directory"
 
Did you literally put filepath in there?
 
No as in the filepath to the file
U think I'm a noob :P
 
No, but if I didn't ask and you had been just putting FILEPATH in there...
 
tru tru
 
Okay, try this one...
foreach ($f in gci FILEPATH -filter *.m3u8) {write-host "$($f.DirectoryName)\$($f.baseName).mp4"}
Remember to replace FILEPATH. ;)
 
1:34 AM
Thanks but where's the ffmpeg stuff?
 
This is just a test, I want to see if it will print what output you want.
 
Yh it outputted what I wanted
 
Okay, so you should be able to replace write-host with your ffmpeg command up to the last -i.
 
fingers crossed haha!
Yayy it works!
Thank you internet stranger :)
You've saved me a lot of time haha
 
Nice!
 
1:39 AM
So much effort for such a simple thing haha
 
This is why the GUI was invented.
The best part about this though, is that you can apply that command to any folder of files you want to convert now.
Hell, replace FILEPATH with a simple . , and it will run in your current working directory on the command line, ANYWHERE.
 
True exactly what I was looking for haha!
I'm a super user 💪
 
If you get adventurous... gci . -recurse is an option.
Just remember...
 
Haha cute
 
 
3 hours later…
4:31 AM
Hey, is Wikipedia down?
Oct 21 '15 at 21:43, by DragonLord
The common "Wikimedia Foundation error" message (WFEM) is sometimes called a "server error" but might be caused by a recent edit which a user made to the current page being displayed. The message is an indication that the webpage being processed for display could not be completely formatted within the time allotted, typically 60 seconds. It rarely indicates that there is a fatal problem with an actual file server at the Wikimedia Foundation, which has been preparing the webpage. === Template limits cause WFE error === During 2009 into 2012, some very slow templates, when used many times per page...
 
 
2 hours later…
6:36 AM
Sorry this may be off topic, but I want to copy the whole numerics data from an excel fle
without copying the word columns present (the headings)
Hi guys!
 
7:03 AM
Morning!
@BAYMAX I don't understand the question, don't select the headings?
 
7:47 AM
I have an excel file with many rows and many columns
the first row has text and so does the first column
But the remaining celss have numbers
I want to select all those numbers
I am not sure how to do this
@CaldeiraG
 
@BAYMAX Select everything then unselect the first row and the first column.
 
oh cool
So I do ctrl+A first to select all, then how to unselect the first row and first column?
 
Hold down ctrl and click the first column number and then the first row number.
 
oh cool
Thank you@DavidPostill
 
 
13 hours later…
9:16 PM
The other side of USB-C is rotationally symmetric except that the 3rd pin from the top is designated FIREWIRE TRIBUTE PIN.
4
 
lol
 
 
3 hours later…
11:59 PM
Hey guys, I'm having an issue with windows powershell. When I open powershell from the start menu everything works fine, but, when I run it from WIN+R or "Open PowerShell window here", the colors are all messed up (screenshot included). Any ideas for where I can start looking to debug this? Google searches have not been helpful thus far.
 

« first day (3594 days earlier)      last day (1429 days later) »